MVP 2023 Flex727 Posted March 11, 2015 MVP 2023 Report Share Posted March 11, 2015 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 More sharing options...
s.pratt Posted March 11, 2015 Report Share Posted March 11, 2015 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 More sharing options...
MVP 2023 Flex727 Posted March 11, 2015 Author MVP 2023 Report Share Posted March 11, 2015 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 More sharing options...
s.pratt Posted March 11, 2015 Report Share Posted March 11, 2015 Hello, VisiLogic did not contain structs; this is a feature within UniLogic. Could you please explain further by what you mean for VisiLogic? Are you able to assign vectors to Modbus read and write commands now? Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted March 11, 2015 Author MVP 2023 Report Share Posted March 11, 2015 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 More sharing options...
s.pratt Posted March 12, 2015 Report Share Posted March 12, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now