Jump to content

UniStream allow user to change Modbus Slave addresses

Recommended Posts

  • MVP 2021

This has come up in the forum before - adding some of the Vision functionality to the UniStream.

I'm working on a project that will be using UniStream PLCs as data concentrators / SQL gateways for many existing Vision series controllers via Modbus TCP.  I will be talking to existing and yet-to-be-installed Vision controllers - probably 30 nodes on each network.

The IP addresses I'm using on my test network are not the same as what will be installed, so when I take this over there I'll have to open UniLogic to manually re-enter the Modbus Slave addresses as part of the program.

I (or the end user) can use Uni-Apps to change the Panel and CPU IP addresses in the field. 

UniStream has an IP data type.  Is it possible to put an IP tag in the Modbus TCP Slave configuration table?

Joe T.


Link to comment
Share on other sites

  • 2 weeks later...
  • MVP 2021

So I learned something new about UniStream regarding Modbus.

I called Support and asked about this topic and they said "Joe - you can do that with Advanced Modbus Functions."


In UniLogic, go to Project->Options and check "Show MODBUS Advanced Ladder Functions"



This is unchecked by default when you install UniLogic.  There's some other fun stuff on this screen regarding the IP defaults.

These functions are not documented in the Help.

NOTE - if you're new to Modbus, use the Protocol -> Modbus tables method in UniLogic; it's so much easier for basic operations.  Stop reading this now.  If you start your post with "I'm new to UniLogic and Modbus and I have questions on Advanced Modbus Functions" I will criticize you in public.  





OK - if you're still here, download the UniLogic examples and look at Communication->UniStream_070_Modbus_TCP_advanced.ulpr.  You'll see a similarity to the old Visilogic way of doing Modbus but UniStream uses two special data types called "Modbus Request" and "Modbus Request Descriptor".  You assign tags using these structs and then stuff them with what you'll need to manually fire them out of the Ethernet port.  You'll need to define a TCP client to work with this.  Of course, our old Visilogic friends "TCP Connect" and "TCP Disconnect" are still involved, although the example doesn't bother disconnecting.  This will need to be added to talk to multiple slaves.

The code in the example is heavily connected to the included HMI screens and it works well as downloaded.  There's a lot of mixing of reading, writing, and function selecting out of necessity to the example application.

I'm going to try to condense this into a couple of UDFB's that are more single purpose and streamlined.  I'll let everyone know how it goes.

Joe T.


  • Like 1
Link to comment
Share on other sites

  • 9 months later...

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.

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