Help with string data structures

elcraft

Member
Join Date
May 2023
Location
Split
Posts
1
Hi,

I'm new with ST and especially data structures and I am trying to create a data structure to store the following shapes and properties:

Name: Location: Form: Color:
Shape1 Bench Round Red
Shape2 Motor Square Blue
Shape3 Gear Round Red
Shape4 Room Triangle Green

I started with this:
TYPE
Name: (Shape1, Shape2, Shape3, Shape4);
Location: (Bench, Motor, Gear, Room);
Type: (Round, Square, Round/*again?*/, Triangle);
Color: (Red, Blue, Red/*again?*/, Green);
END_TYPE

Shapes:
STRUCT
ShapeName: Name;
LocationName: Location;
TypeName: Type;
ColorName: Color;
END_STRUCT
I have two questions:
1) For Type and Color, should or am I allowed to repeat the repeating properties, like Round or Red?
2) How do I make the associations? Are they made automatically if the arrays are the same size, or how do I make the associations: e.g. Shape1 associated with Bench, Round and Red?

Thank you.
 

Similar Topics

I'm new to ST so go easy. Studio 5000 L33ER PLC I'm trying to take 2 strings, merge them into 1 string. with a space between the 2 strings...
Replies
3
Views
2,254
I have a Horner PLC that is reading Ascii string from a device. When the device responds, it responds with the hex value in Ascii. I need to...
Replies
8
Views
2,385
hi, i try to capture barcode data using UDT with SINT ascii array. i have all the data i need but it in array format, how can i convert to 1...
Replies
5
Views
3,061
Hello all, I am stumped about how to validate an expression in order to meeting the following conditions. Here's what I want to do: I have a...
Replies
4
Views
2,825
Could somebody please point me in the right direction? I'm trying to incorporate a table into each motor's faceplate. It's a simple, two...
Replies
2
Views
3,202
Back
Top Bottom