Using user defined tags

S

Thread Starter

soverel28

How many people are using UDT (user defined tags) in their programs? I have never really seen the need and it looks like it would just add complexity to the overall program.
 
B

bob peterson

I have found they can be quite helpful in keeping data in consistent, managable chunks. That makes it easier to spot mistakes and in debugging. Especially true where there are multiple instances used.

I think they are not all that useful for many projects, especially smaller ones.
 
K

Ken Emmons Jr.

Please define what a User defined tag is as different software has different terminology.

Mitsubishi has something called UDT, but they are user defined data types which really means grouping of multiple variables into one unit. I use them to pass a large amount of data into a function block and when I want to group things logically together.

Ex: UDT MyServo has two bits and one word for enable, alarm, and position.

I'm using Structured Text notation (ST) here, but you could do this in ladder too:

MyServo.Enable := true;

If(MyServo.Alarm = true) then .... etc etc....


As far as using tag names to refer to IO and memory it *definitely* is a time saver on all but the most basic programs. I don't like to keep track of which timers I've used or any of that garbage.

KEJR
 
D

David Ferguson

I use them all the time, they allow you to take numerous data types and "group" them together which saves memory space. And you essentially are creating "objects" which you can pop out code easier and make troubleshooting easier.

For example......

I use them for numerous projects for example I create a motor data type containing numerous status bits, fault timers, run cycle counters etc using a modified ISA naming convention. For example bits for motor start MZ (final control element), MK ( mode control station), MI (Motor Indicator), MIF (Motor indicator forward), MIR (reverse), MAF(Motor Alarm Forward), MCMS (Motor control manual start), MCAS (motor control auto start), MCI (motor control interlocks) MCP (motor control permissive), MA (fault timer) etc.

We have like 25 motor "parameters". Then I assign motor numbers via area and motor number for example 13-1234 and make the data type "motor" and then every motor gets all the parameters ex 13_1234.MZF is the motor forward output etc.

Then I use AOI's and make a motor instruction containing all the code for motor control and assign the M12_1234 tag to the AOI and poof motor done. So once the infrastructure is built, I can pop out motor code in seconds including importing from spreadsheets.

I also built global object graphics that are tied to these UDT tags and poof a motor done.

Hard to explain on a phone but hope that helps....

Dave Ferguson
Control Systems Engineer

Sent from my iPhone
 
Top