06-18-2021 02:56 AM
Hi Steven, I am Carlo from Gefran ( Italy). I have to communicate with Modbus with a device ( I attach a device photo with a modbus parameter) that has a specific address but I note one error ( code 56 ). I download some Modbus library to do this work. I have tried to use one example vi that I am attaching to you. Could you give me some indications to solve this problem?
I am attaching also two doc file relative to Modbus device protocol
Thanks & Regards
06-18-2021 09:58 AM
First, you would be better off to start a new thread rather than ask your question in a post that is over 7 years.
Now, I suspect that issue with your code is that you don't have your device network configured properly. It is using the Microsoft MDNS addresses. It should be configured for the network it will reside on. Also, in the exaplme you posted the device address is listed as localhost. This needs to be the IP address of your device. Once it is configured as suggested, you should use that address in the example. The last thing to note is that modbus registers are normally listed as 1 based addresses. The NI libraries use 0 based addressing. So you usually need to subtract 1 from the documented register address when passing the address to one of the NI library VIs.