Schneider (Modicon) Arrays using structures as data types

Join Date
Aug 2015
Location
Michigan
Posts
12
Somewhat new to Schneider (aka Modicon) PLC's and the Unity Pro XL programming software. I have a TSX P57 6634M PLC. I would like to take an existing solution created for a Rockwell StudioLogix application and translate it without having to do too much total rewrite.

I've hit a roadblock however and hoping to find a reasonable solution. I am using arrays that are using data type Structure which are made up of a mix of DINTs and other structures. What I would like to do is to be able to query the Length of the array similar to how the SIZE command in Rockwell returns a value for the array length. The SIZE command can handle arrays of UDT's as well as the elementary data types such as INT, DINT, etc. I found the LENGTH array instruction in the Unity Pro library but it looks like it is only capable of working on elementary data types. Does anyone know of a work-around or if there is a different approach to achieve the same result?
🤞🏻
 
Somewhat new to Schneider (aka Modicon) PLC's and the Unity Pro XL programming software. I have a TSX P57 6634M PLC. I would like to take an existing solution created for a Rockwell StudioLogix application and translate it without having to do too much total rewrite.

I've hit a roadblock however and hoping to find a reasonable solution. I am using arrays that are using data type Structure which are made up of a mix of DINTs and other structures. What I would like to do is to be able to query the Length of the array similar to how the SIZE command in Rockwell returns a value for the array length. The SIZE command can handle arrays of UDT's as well as the elementary data types such as INT, DINT, etc. I found the LENGTH array instruction in the Unity Pro library but it looks like it is only capable of working on elementary data types. Does anyone know of a work-around or if there is a different approach to achieve the same result?
🤞🏻


I realized I should be clearer in my description when I mentioned arrays using data type of "structure". For Unity Pro it is more proper to use the term DDT - Derived Data Type. Hope this helps clarify what I originally posted.
 
The function 'SIZEOF' gives the length of a variable in bytes.
The variable can be any type eg an array of structures
Hope this helps
Also have a look at the 'EXTRACT' function it may also be useful.
 

Similar Topics

Everything was working fine, but suddenly CPU went into error mode, and the ERR and TER LEDs lit up. Now I can't download or connect with the PLC...
Replies
0
Views
32
I have an old PLC (circa 2007) consisting of Telemecanique/Modicon/Schneider Electric devices. The system has developed errors and unfortunately...
Replies
2
Views
230
Hey all, I do not have the original source code of a Modicon M172 PLC (HVAC PLC). I want to modify some of the code but read you cant upload...
Replies
2
Views
335
Hi, I have an older Kohler Generator/ATS controller that has a Schneider Electric (Modicon) Momentum PLC and has a Advantech HMI. I assume this...
Replies
3
Views
707
Hello, I'm having a hard time understanding how to get a Modicon M340 to pull a Modbus address from an ABB Totalflow via Ethernet. I set up a port...
Replies
5
Views
1,150
Back
Top Bottom