Jump to content

MODBUS limitations in UniLogic


Flex727

Recommended Posts

  • MVP 2023

It appears that there is no way to communicate via MODBUS with more than one coil or register per Operation. Normally I would send or receive a vector of coils or registers, either directly, or using the handy vector STRUCT function in VisiLogic.

 

I'd like to send a thousand coils from one PLC to another. Obviously this cannot be done with one operation per coil in the MODBUS configuration in UniLogic. Are the true MODBUS commands #1, 3, 15, & 16 available?

Link to comment
Share on other sites

Hello,

 

The Modbus commands are still there, they are just configured for you.

 

When you assign a tag to the operation, you have the option to set an array length.  This will either read to that array, or write form that array, depending on what you are trying to do.

 

The same is also true when you create a Modbus slave.  When the tag is created/assigned, you assign the array length as well.

 

Hope this helps!

Link to comment
Share on other sites

  • MVP 2023

I tried that and the tag is red unless I select a single bit from the array.

 

Edit: I see now that it is automatically trying to select a single bit and I have to backspace over the opening bracket to select the whole array.

 

How about an equivalent to the vector STRUCT function in VisiLogic? Does that exist?

Link to comment
Share on other sites

  • MVP 2023

Yes, I am able to send and receive a vector of coils using MODBUS. Thanks for your help, s.pratt.

 

What I am referring to in VisiLogic is the Struct function block listed under Vector in the Ladder menu. It allows non-contiguous coils and registers to be assigned to a contiguous vector of registers for ease in communications. It works in both directions by selecting "From vector to mixed data locations" or "From mixed data locations to vector".

 

I can see that this wouldn't be as necessary in UniLogic as it is in VisiLogic, but it would be nice when I am sending a large amount of data to 10 different slaves so that I don't have to recreate the list for each Modbus slave definition. I'm presuming I can't send more complex structs nor can I send anything but Global variables.

Link to comment
Share on other sites

Oh, I see.  I apologize, I did not realize you referring to that function block.

 

In UniLogic, we can create structs via the "Struct" tab at the bottom where the global variables and system tabs are found.  This will create a "template" where you can associate large amounts of various data to one "file" name/type.

 

Once the struct has been created, you can then make many different tags with the same data layout in the global variables section.  When creating a new tag, select the "type" as the name of your struct, then memory space will be allocated for these tags.

 

We commonly use the elevator example with this.  For instance, if you have 4 elevators, all with the same amount of floors, sensors, and buttons; we would create a struct called "elevator", then add members (floor, sensor, button).  When we create a new tag with this struct type (Elevator1), we will be able to call the floors as Elevator1.floor, the sensors as Elevator1.sensor, and so on.  We can also add as many of these as we can fit (Elevator1, Elevator2, Elevator3, ..).

 

Let us know if this helps.

Link to comment
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...