ok i got it working all the lights and dial work great now giving feedback, the tutorial was a little misleading but i learned a lot about hal and pyvcp panels and pins in the process, i take no credit for the tutorial as i say as mBender was the person who did all the work i just got it working for me also this should help others who got stuck with this vfd combo and rs485 connection
the readme file from the files in the github repository
github.com/xsnoopy/LinuxCNC-Yalang-yl620...Modbus-ClassicLadder
says to add this to the end of your .ini file which is incorrect it is meant to be put at the end of your .hal file without the last line
" POSTGUI_HALFILE = vfd.hal" which belongs in your ini file in the [hal section]
========================================================================================================
loadrt classicladder_rt numS32out=100
addf classicladder.0.refresh servo-thread
loadusr classicladder --modmaster vfd.clp
net spindle-on classicladder.0.in-00 spindle.0.on
net spindle-brake classicladder.0.in-01 spindle.0.brake
net spindle-forward classicladder.0.in-02 spindle.0.forward
net spindle-reverse classicladder.0.in-03 spindle.0.reverse
net spindle-cmd-rpm <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs classicladder.0.floatin-00
POSTGUI_HALFILE = vfd.hal
===============================================================================================================
so copy and paste this excluding the last line into your .hal file
and as mentioned above the last line belongs in your .ini file so in your machine .ini file edit these sections:
in the [DISPLAY] section add "PYVCP = vfd.xml"
in the [HAL] section add "POSTGUI_HALFILE = vfd.hal"
www.waveshare.com/usb-to-rs485.htm
also to point out if you use the usb to r485 adapter linked above it will show up as /dev/ttyACMO and the classicladder configuration tab doesnt have this as a selectable option so to remedy this open the vfd.clp file towards the bottom you should see this text
MODBUS_MASTER_SERIAL_PORT=/dev/ttyUSB0
MODBUS_MASTER_SERIAL_SPEED=19200
MODBUS_MASTER_SERIAL_DATABITS=8
MODBUS_MASTER_SERIAL_STOPBITS=1
MODBUS_MASTER_SERIAL_PARITY=0
MODBUS_ELEMENT_OFFSET=0
MODBUS_MASTER_SERIAL_USE_RTS_TO_SEND=0
MODBUS_MASTER_TIME_INTER_FRAME=100
MODBUS_MASTER_TIME_OUT_RECEIPT=500
MODBUS_MASTER_TIME_AFTER_TRANSMIT=100
MODBUS_DEBUG_LEVEL=0
MODBUS_MAP_COIL_READ=0
MODBUS_MAP_COIL_WRITE=1
MODBUS_MAP_INPUT=0
MODBUS_MAP_HOLDING=0
MODBUS_MAP_REGISTER_READ=1
MODBUS_MAP_REGISTER_WRITE=0
_/FILE-com_params.txt
MODBUS_MASTER_SERIAL_PORT=/dev/ttyUSB0
(this is the line that needs editing with /dev/ttyACM0)
when you open linuxcnc and open up the config window in classicladder you will see it has changed to/dev/ttyACM0 and it will now work
also i set the vfd to 19200 8 n 1 and kept the same in the the classicladder config,
also you need to add your user to the dialout group and configure your usb adapter to the correct setting
to add user to dialout group open a terminal and type this command
sudo adduser "YOUR USERNAME" dialout
then check groups for your user with this command
sudo groups "YOUR USERNAME"
and it will list the groups your username is added to
and to configure the usb adapter i installed an app called GTKTERM by again opening a terminal and typing this command
sudo apt-get install gtkterm
when installed go to application and under accessories should now be a new application called "serial port terminal"
open it up and on the configuration tab you can now change and save a permanent configuration for your adapter and any other adapter you are using. this way i had a solid connection as some people were complaining about the vfd being noisy and dropping connection, so they gave up using the rs485 method but im not using a shielded cable from the rs485 port on the vfd, it is a jst-xh 3 pin male cable thats about 20cm long. DO NOT and i repeat DO NOT BY ANY MEANS use a usb extention cable. the adapter came with a cable that has a built in ferrite and is also shielded but if i used it, as soon as i send a command to linuxcnc the connection would drop straight away. so if your trying to get this method working DONT use an extention cable for the usb adapter. also buy the adapter i listed above as people were sayin they had to use resistors to negate noise from the vfd signal to the adapter but this has them on the adapter pcb and is also lighting proof according to the specs. i tried a cheap usb adapter previously but due to a noisy signal couldnt get that working, you may be lucky but the setup is problematic enough without adding caveats yourself.
again thankyou to mBender for the github tutorial as without it id never have gotten this working and i hope this solves your issues for anyone else having the same problems as me
ive edited and linked the edited files including the readme file edited with the correct files and i will post it on github when i get chance unless mBender will want to edit the readme and github repo with the changes outlined in this post
p.s when i uploaded the files they have a date in the name so just rename them without the dates to
vfd.clp
vfd.xml
vfd.hal
or download from the repo i put up with the edited file
github.com/handsomebeast20/yl620-a-rs485-modbus-classicladder
or follow this tutorial on the printnc wiki for the classic ladder method
wiki.printnc.info/en/electronics/vfd/yl620a-rs485
i am using axis gui also with linuxcnc 2.8.4 and it is working