From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-16-2009 06:05 AM
Hello,
I am trying to communicate with a unitronics PLC via ModBus tcp/ip, I use a simple VI with a TCP open connection.vi and a MB Ethernet Master Query.vi. Unfortunately, I am able to write registers or coils to PLC even though an error 56 is occured at MB Ethernet Receive.vi but I am not able to read from PLC because of that error. I changed the value of timeout and the result was the same.I also have tested the communications via ModBus serials vi and the outcome was successful.
Any suggestions? I have already searched the forum and the site of NI without success......
The version of Labview is 8.5 on Windows XP.
01-16-2009 06:15 AM
Hi zankour,
are you sure you send some data from PLC back to PC? Maybe you receive to less values? The error tells you that you didn't receive the expected number of values in the given time.
Mike
01-16-2009 07:49 AM
adding to Mike's post...
Check the addressing of your registers. If you ask for an address that is wrong, you will not be able to read it so ------> Time Out.
Ben
01-19-2009 05:45 AM
Hi Mike,
Thanks for the reply.Your assumption was correct PLC didn't send data (I checked it from plc's registers indicating the number of transmit and receive session) so I tried to communicate with it via an OPC server to see if this is a problem of PLC or Labview . The result was successful (modbus IP), but I notice that in the parameters the module ID was necessary which is not in Labview (according to Ethernet example master.vi) so I added the MBAP header and the problem was solved. What is funny is that the ID in MBAP needn't to correspond to the actual ID of the PLC. I guess I 've missed something... The truth is that I haven't much experience neither in Labview nor in modbus.
01-20-2009 10:49 AM
Try the ethernet query llb file that I put in this thread. Then compare it to your code.
http://forums.ni.com/ni/board/message?board.id=170&message.id=144522&query.id=35841#M144522