Jump to content
Lacey

Reading Modbus Registers From a Non Unitronics Controller

Recommended Posts

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!!!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

+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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...