LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus TCP

check one of my Mod bus RTU Module Developed for connecting with Multispan Multi Function Meter working fine as expected.

 

ModbusRTU.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 11 of 28
(1,205 Views)

Thank you for your reply. Interestingly, i have previously had this work using serial communications. This time when i using Ethernet - it is where i am experiencing the problem. I am no further forward at the moment and unsure of steps to take to resolve.

0 Kudos
Message 12 of 28
(1,182 Views)

are you saying it did work with modbus on R485 connection, but when you switched to TCP it stopped? Otherwise I would suggest to try modbus poll or something to check what actually is been sent. Modbus sniffer plus ioninja or something like that

0 Kudos
Message 13 of 28
(1,165 Views)

yes, I got the attached vi to work. this was a few years ago.
Now the only difference is there is a device which converts RS485 to ETH and i connect to that over TCP

Download All
0 Kudos
Message 14 of 28
(1,153 Views)

Hi  LeeBowers1 , 

Did you try to put "register values' array indicator out of the loop and make the tunnel mode to indexing. After that if the VI's work normal the output array will have collected values.

In your case it is showing the last value, that the Read holding registers.vi read. 

 

Regards )

0 Kudos
Message 15 of 28
(1,137 Views)

@LeeBowers1 wrote:

Thank you for your reply, makes good sense to attach the vi - why i didnt do that initially - no idea!

I could not see a coercion dot?

Would you be able to help?

For fullness, the data is coming from a receiver which transmit RS485, i am then using am RS485/Eth adapter. I can see the tx/rx lights flash as I poll for data and I get something, but just not the 10 addresses as i need


Just sticking an eithernet to RS-485 adapter in your setup does not change the MODBUS protocol from MODBUS 485 to MODBUS TCP/IP.  The data layer is still MODBUS 485! because, that is what the remote endpoint uses.


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 28
(1,130 Views)

@JÞB wrote:

@LeeBowers1 wrote:

Thank you for your reply, makes good sense to attach the vi - why i didnt do that initially - no idea!

I could not see a coercion dot?

Would you be able to help?

For fullness, the data is coming from a receiver which transmit RS485, i am then using am RS485/Eth adapter. I can see the tx/rx lights flash as I poll for data and I get something, but just not the 10 addresses as i need


Just sticking an eithernet to RS-485 adapter in your setup does not change the MODBUS protocol from MODBUS 485 to MODBUS TCP/IP.  The data layer is still MODBUS 485! because, that is what the remote endpoint uses.


Without knowing the low level details of how your ethernet to 485 device works, I suspect it has enough intelligence to be addressed like any IP device, then strips off the TCP/IP header and error checking data and sends the data in the packet along as RS-485. So you will probably need to use the TCP/IP functions to send a 485 Modbus communication string. The library you are using (I believe the NI Modbus library) does not expose that message data. You can roll your own, try another library, or get the source code for the NI Modbus Library and modify it to give you the Modbus formatted data. 

 

Here is the repo for the NI Modbus library

https://github.com/NISystemsEngineering/LabVIEW-Modbus-API 

0 Kudos
Message 17 of 28
(1,118 Views)

maybe try again, from scratch. With the 3 wire modbus cable (R485). Then work your way up.

Also I found once, one of the modbus vis did not work (had a whole line, probing multiple clusters of registers). Then I deleted it and put it in and it worked. Also there are 2 modbus libraries, may try the other library as well. From memory, the icons  are more yellow

https://www.ni.com/en-au/innovations/white-papers/12/introduction-to-modbus-using-labview.html

https://forums.ni.com/t5/LabVIEW/Modbus-tcp-1-2-problem-with-labview-8-5/td-p/893940

0 Kudos
Message 18 of 28
(1,094 Views)

Thank you (and thank you to all who have replied on this issue)

That makes sense to me, in a common sense way - I just need it a little more labview for dummies for me to implement. Apologies in advance for my lack of experience / knowledge in this area. Are you able to further exlain

Thank you again in advance

0 Kudos
Message 19 of 28
(1,074 Views)

 LeeBowers1, 

I have already written this offer, but I have not received any response.

So check this. Put "register values' array indicator out of the loop and make the tunnel mode to indexing. After that if the VI's work normal the output array will have collected values.

In your case it is showing the last value, that the Read holding registers.vi reads. 

 

Will wait for response, Regards )

0 Kudos
Message 20 of 28
(1,048 Views)