i'm having same issue , eg unable to change default device value (even if source seems to have this implemented). i'm sure the wj200 is properly connected as
./modpoll -b9600 -d8 -s1 -pnone -r1 -c8 /dev/ttyUSB0 resturn correct value (50.00 Hz) in my case.
starting from base cd install , here what i did to compile the driver having changed the hard coded "/dev/tty0" with "/dev/ttyUSB0"
we need some aditionnal packages
needed packages (modbus-dev and linuxcnc-dev and git for the linuxcnc repo)
sudo apt-get install modbus-dev linuxcnc-dev git
#clone linuxcnc repo
mkdir dev
cd dev
git clone
github.com/LinuxCNC/linuxcnc.git
cd linuxcnc/src/hal/user_comps/wj200_vfd
#some include and lib dirs need to be added manually so we need to generate .c from .comp
halcompile --preprocess wj200_vfd.comp
#now wj200_vfd.c is here you can edit it to change/test
#compile to have the cmd line
halcompile --compile wj200_vfd.com
#this will give an error but display the cmd line
#copy then paste it to a new cmd line
#change /tmp/xxxxxxx/wj200_vfd.c to ./wj200_vfd.c
#add at the end -I/usr/include/modbus because modbus.h include is in a subdir (this is a i)
#add -std=c99 because we got a for loop error
#add -lmodus because linker need it (this a L)
so the command should look something like this :
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o wj200_vfd ./wj200_vfd.c -Wl,-rpath,/lib -L/lib -llinuxcnchal -lmodbus
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o wj200_vfd ./wj200_vfd.c -Wl,-rpath,/lib -L/lib -llinuxcnchal -I/usr/include/modbus -std=c99 -lmodbus
#then you get a binary, it need to be moved to the proper place
#change owner
sudo chown root:root wj200_vfd
#change attributes
sudo chmod 755 wj200_vdf
#save original
sudo mv /usr/bin/wj200_vfd /usr/bin/wj200_vfd.orig
#move the freshly compiled driver
sudo mv wj200_vfd /usr/bin/wj200_vfd
#then start linuxcnc for testing...