11-30-2012 01:21 AM
I am using LV9 and modbus library from NI.
About this problem i have read some post but it is about master only.
My exact setup is as follows:
I have a third party modbus master software and want to poll 200 coils of data from labview modbus slave.
I am getting values upto register address - 16, but after that the values are'nt changing.
please suggest.
Regards,
Shrek
12-03-2012 02:48 PM - edited 12-03-2012 02:49 PM
Hi,
Did you made the slave VI yourself ?
How does the master access the registers ? One by one are through multiple registers reads ? How many registers ?
Kees
12-03-2012 11:34 PM
Third Party Modbus Master querying LV Slave : Slave Address : 1
Function : Read Coils
Start Address: 1
Length : 200.
values till address 16 for coils are read perfectly, but 17 onwards are not read by modbus master.
Regards,
Shrek.
12-03-2012 11:42 PM
Maybe the device is only capable of returning up to 16 values in one request. In order to do 200, you might have to break it down to multiple requests in groups of 16. Are any modbus error messages being raised? If you put some indicators or probes on the string that is coming out of the modbus read, you can see what the raw serial data looks like. If you are familiar with a modbus data packet, you can decode the binary to see how many bytes of data are being returned.
12-04-2012 01:56 AM
The single bit coil data is bit packed, so status of 200 coils would come in 25 bytes. I would question the addressing and make sure that address 17 of the slave is bit access and not register access which would demand a different function code.
12-04-2012 04:21 AM
The slave is LV program only, Modbus Slave example provided by NI.
and surely i will check the string what it returns for the 17 register.
Regards,
Shrenik
12-04-2012 07:44 AM
Your third party master - What is it?
It *may* have limitiations on how it assembles querys, and you may have to attempt a two reads less that 200 bits, one starting at the 17th register.
Then again perhaps the NI has the limitation. If so I would expect some exception code seen at the master (invalid address etc...).
Clarification:
You say you are reading 200 coils (bits). And getting up to 16 registers. 16X16 = 256. This is more than 200 coils. Or am I missing something?
12-04-2012 07:57 AM
third party master is also having its own slave, when i communicate between those master and slave then it works fine.
i am not reading analog registers, reading coils i.e. bits.
12-04-2012 07:03 PM
Please be more specific about what you are communicating with and how. From what I can gather, you have a third party Modbus RTU master and you are trying to communicate with two different types of slave devices:
Some code would help.
12-04-2012 11:07 PM
please find the attached file