Jump to content

Recommended Posts

Posted

I need to read multiple Modbus registers from a non Unitronics controller. These registers are not consecutive registers. What is the best way to do this? Multiple Read Holding Registers (3) one after another? Rung examples of your ideas would be most helpful and appreciated.

 

Thanks!!!

  • MVP 2023
Posted

Any multiple register read I put into a vector of MIs, and then pick out the ones I want to work with by using the store function to put them into other MIs, or put them in a data table.

What I also do during this transition is have a +/- addition going on, that lets me fine tune readings to my external master, be it pressure, temp etc.  I try to never adjust a sending device direct.

cheers, Aus

  • MVP 2023
Posted
16 hours ago, Lacey said:

I need to read multiple Modbus registers from a non Unitronics controller. These registers are not consecutive registers. What is the best way to do this? Multiple Read Holding Registers (3) one after another? Rung examples of your ideas would be most helpful and appreciated.

Unitronics MODBUS communications are very forgiving in my experience. If the registers are non-consecutive, but not too far apart it's probably easier to read the entire vector that encompasses the data you want and then select what you need via ladder (as Ausman suggests above). If the registers are too spread out (total vector >120 registers) then you can certainly do consecutive reads. If there are a large number of them, then set up timers to read them individually, but if you just need a small number read, they can be read in the same cycle. The example below shows both a read and write in the same PLC cycle (using MODBUS TCP/IP). The second one just waits until the first one is complete (due to MB 20).

If you're not sure, just try it - you won't break anything.

image.png.6059a4d0e488bbc7ccdb333da4c56f01.png

  • 2 weeks later...
Posted

+1 to both Aus and Flex regarding reading an entire vector and picking out what you want if they are close, or separate reads if they are spread out.

Similar to Flex's example, I typically use a state machine of sorts, to step through each read via an index count (which is reset after the last read).

image.png.b734cc5906269f5e9be96c1c59a18637.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.