-87 is “Open Error” (You can look these up in PAC Control, Help, Error Lookup).
What kind of Opto device are you using? EPIC? If EPIC, USB to serial, or CSERI module? The comm handle is different depending on the kind of device you are using, and I suspect that is where your issue is.
Hello Philip! Thank you so much for your response. I am using groov EPIC PR2 with the CSERI module on slot 0. The comm. handle that I am using is “ser:0,19200,n,8,1”. Is this the right one?
Thank you, Beno and Philip! You are awesome! As Philip mentioned, the issue was in the comm. handle. I had to change the line in the ‘General Setup’ optoscript block to this to make it work:
SetCommunicationHandleValue(“@VFD_301:baud=19200,parity=n,data=8,stop=1”, chModbusMaster);
I am seeing non-zero data come through now. I am yet to figure out what I am seeing, doesn’t look right at the moment. But I am seeing another issue now.
Sometimes I get all zeros and sometimes I get non-zero data in the return table.
When I get all zeros, I checked the nStatus/n03AsFloatStatus bit and it was toggling between 0 and 2. I checked the error description for value “2” , it is “Checksum or CRC Mismatch”.
When I get non-zero data, the nStatus bit stays at 0.
Is there something that I am doing that is causing Checksum or CRC Mismatch? Please help.
Thanks a lot again.
Make sure you have a at least a 2ms delay (1920 characters/sec and 3.5 character modbus spec delay) between modbus requests to allow the VFD RS-485 transceivers to switch from transmit to receive.
I have set a 20ms delay in the blue ‘Read Delay’ block. Is that where you wanted me to check? Or, is it inside the O22Modbus03ReadHoldingRegistersAsFloat subroutine in the Modbus master kit?
Please advise. Thank you.
The communication is working for me now and the data that I am receiving makes sense now. Some things I noticed earlier about the nStatus value toggling between 0 and 2 and also later between 0 and 4, incase somebody else has similar issues.
I do not know the exact reason, but this toggling happened whenever I entered a register address that was not a holding register address. For example, my data was at register address 9505 (decimal) and if I entered 9504, I saw the toggling happen and it left me with all zeros as the return data. If I entered a valid address, then there is no toggling and data looks good.
Thank you again, Beno and Philip for your help!
Hello Ben,
Would you have any advice on how to set up a communication handle for a second serial device on groov EPIC’s GRC-CSERI module?
Currently, I using the following code to talk to the first device, on CSERI module’s channel 0:
SetCommunicationHandleValue(“@VFD_301:baud=19200,parity=n,data=8,stop=1”, chModbusMaster);
Do I need a different comm. handle for a second serial device?
Please advise. Thank you.