You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 4th, 2017, 11:34 AM   #1
HalfManHalfBiscuit
Member
United States

HalfManHalfBiscuit is offline
 
HalfManHalfBiscuit's Avatar
 
Join Date: Aug 2015
Location: Michigan
Posts: 12
Schneider (Modicon) Arrays using structures as data types

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?
  Reply With Quote
Old December 4th, 2017, 12:45 PM   #2
HalfManHalfBiscuit
Member
United States

HalfManHalfBiscuit is offline
 
HalfManHalfBiscuit's Avatar
 
Join Date: Aug 2015
Location: Michigan
Posts: 12
Quote:
Originally Posted by HalfManHalfBiscuit View Post
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.
  Reply With Quote
Old December 4th, 2017, 06:19 PM   #3
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
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.
__________________
Geoff C
______________________________________
  Reply With Quote
Old December 5th, 2017, 09:45 AM   #4
HalfManHalfBiscuit
Member
United States

HalfManHalfBiscuit is offline
 
HalfManHalfBiscuit's Avatar
 
Join Date: Aug 2015
Location: Michigan
Posts: 12
Thumbs up

Thanks for the feedback GeoffC. Much obliged!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Any way to use double data types in RsLogix? opmal7 LIVE PLC Questions And Answers 8 July 22nd, 2016 09:37 PM
Loading .Pre in an array of timers? dginbuffalo LIVE PLC Questions And Answers 24 March 11th, 2016 06:44 PM
Schneider Vijeo Designer Data Management Tool v4.5.1 John Morris LIVE PLC Questions And Answers 0 March 4th, 2016 10:51 AM
Vijeo Citect - Modicon M340 DDT (Derived Data Types) majorv LIVE PLC Questions And Answers 2 April 29th, 2009 06:34 PM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 07:24 AM


All times are GMT -5. The time now is 07:58 AM.


.