where to apply array, struct, string and UDT

Jan P.

Member
Join Date
Mar 2012
Location
Belgium
Posts
4
Hi,
I would like to know what good applications are for an array, struct, string and UDT? I pretty much know how to use them (moving the data around in step7) but don't really know wherefore i can use them :).
So i mean something like:
array1: speeds conveyor belts in mode 1
array2: speeds conveyor belts in mode 2
string1: username1 via HMI interface..
I would be great to have more examples like this, in particular for machines like stacker, destackers, industrial elevators, conveyor belts, industrial washers, pick&place, enz...

thanks in advance..
 
think of UDT as template for data, like for motor you can define RunCmd, Running, Current, Error and thne whenever you have motor control you can just use UDT type...
as for array first thing to come to my mind is modbus data. put what you get in array then copy it to some other place...
as for struct, this is similar to UDT but struct are used for grouping similar thing like in time you use struct to access hour, minutes and seconds (e.g. time.h, time.min, time.sec)

arrays are also useful when using them with AT command where, for instance, you can define byte as array of bits.
 
Last edited:
Like balash said, UDTs are templates for data.
Use them for controlling standard devices, like motors or sensors.

Suppose you have 100 analog sensors in your plant. You create UDT that contains every variable that you need, like alarms, alarm limits, scaling factors etc, lets call that "udt_analog". After that create a data block that contains data types udt_analog for analog sensors. Now you have all the data for your sensors in one Data Block in nice fixed intervals.

Now lets say you create Function for calculating everything for analog sensor, like scaled value, alarms etc. and its input is of type udt_analog. Use that function for each sensor and each time point to different udt_analog in your datablock.

After that controlling 100 sensors is just copy-paste job, just change the udt address for different sensor. Hardest part is getting the udt and function just right.
 

Similar Topics

I received an email from a student with the following code attached. This is supposed to control a floodgate system, and supposed to be written...
Replies
23
Views
778
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
I have a lot of different equipment that I inherited from my father's company, he allowed me to sell it, how can I do this? Siemens Simatic S7...
Replies
4
Views
304
Can anyone help me find where is recipe plus or recipe manager in View desginer(studio 5000) software. i want to create an recipe but i am unable...
Replies
2
Views
176
Hi everyone: I went to AB.com, found only firmware, no EDs file showing up. i took a pix of device properties of RSLinx. Thanks
Replies
1
Views
123
Back
Top Bottom