07-01-2024 01:54 PM
Hello,
I have trying to connect a modbus device using Labview but it does not work at all. My previous application uses Python (pymodbusTCP) and it works well.
I have gotten the errors 56 and 66. I suppose it can not be a network problem because it works well with a python script. The address and port is all the same.
Thank you.
Solved! Go to Solution.
07-01-2024 10:20 PM
Are you using NI Modbus Library Toolkit for LabVIEW?
You can Performing a Good NI I/O Trace Capture for Debugging/Troubleshooting to debug the data sent and received
07-02-2024 01:39 AM
Hi Zyong,
Thank you for replying. I have used so far two libraries, NI Modbus Library and Plasmionique Modbus Master. None of them has worked.
To begin I just would like to read the holding registers from the device.
I have been using Labview 2024 Q1.
Best,
Henrique
07-02-2024 08:55 AM
Can you share your code for version 2020 ?
07-02-2024 09:15 AM - edited 07-02-2024 09:17 AM
I have been using Labview version 2024 Q1.
07-02-2024 09:51 AM - edited 07-02-2024 10:02 AM
A picture is not code! Why are there terminals without label?
Do you really want to do two things (reading/writing) in parallel with no clue what happens first?
@henk1000 wrote:
I have been using Labview version 2024 Q1.
07-02-2024 10:12 AM
I have tried also only reading and the result was the same. The program is quite simple so I find it not necessary to post it. If it is really necessary I can post it.
07-02-2024 10:21 AM - edited 07-02-2024 10:22 AM
@henk1000 wrote:
The program is quite simple so I find it not necessary to post it.
Again, a picture of code with unlabeled terminal and coercion dots (e.g. your "register to write" should not be U8) raises a lot of red flags. We also can't tell any of the wire values. Is LabVIEW allowed to use the network? Do you really think you should branch the wire?
(disclaimer: I don't do modbus and I am not familiar with your toolkits. Hopefully somebody else will help.)
07-02-2024 11:24 AM
Hi,
This is the code.
07-02-2024 04:30 PM - edited 07-02-2024 04:31 PM
The biggest gotcha I usually see is the address, from the NI Modbus documentation:
So I would check to make sure the register you want to read is correct.
Usually error 56/66 are a a result of the remote application closing the connection. Which could likely happen if the address, or amount of bytes are wrong.