Jump to content

UniStream allow user to change Modbus Slave addresses


Recommended Posts

  • MVP 2023

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 2023

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"

image.png.3115349e455070c398a564e027042825.png

 

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

  • 9 months later...
  • 8 months later...

The ability to programmatically set Modbus slave addresses, as well as REST server addresses, would've saved me a lot of work on my most recent project. I hadn't considred those features could be missing when I selected the UniStream, and if I'd known I might not have. I ended up having to roll my own routines using the Advanced Modbus functions (despite their missing documentation) as well as my own REST functions using the Message Composer (which also has very lacking documentation). If the Modbus and REST server addresses could be changed programmatically then I would've been able to use those built-in features and it would've saved me a lot of frustration.

Link to comment
Share on other sites

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.