how to use user defined tags in control logix 5000

A UDT (User Defined Type) is a template for a new data type.

For example - DINT is a data type - one supplied by the system. It is a 32 bit number. But the definition of DINT is not a tag. You create a tag and set that it is of type DINT. Only then do you have a memory space reserved with the name you have given.

In like manner a UDT just lays out the structure of a new data type. Once it is defined - then you can make tags and state that it is of the new data type you have defined. The name of the data type even appears in the list of other types.

Once you have set up a tag as your new type you can move any of the appropriate values into its members.
 
thank u bernie, does the user defined tag is a memory location and to put data in it i have to write a program such as copy
 
Correct - once you have set up one tag of a User Defined Type you will use MOV or COP or any other normal method of placing information into it.
 
dhirdesh - there is no mystery in the use of User-Defined data types. Data types are "templates" that are used in the creation of data tags.

There are only a very small number of data-types that exist...

BOOL -   1 bit   - Value 0/1
SINT - 8 bits - Value Range -128/+127
INT - 16 bits - Value Range -32768/+32767
DINT - 32 bits - Value Range -2,147,483,648/+2,147,483,647
REAL - 32 bits - Value Range long forgotten, but it's an IEEE floating point



These are the Atomic data-types, from which all of the others are fabricated. Look at some of the Pre-Defined data-types, and you will see that they are all constructed from these atomic types.

A Timer, for instance, is a data-type that has been constructed by Rockwell from 2 DINTS and 3 BOOLS.

There is a big collection of pre-defined types that you can use, but if you can't see a type that fits your application, you can create your own. And you can nest types within types.
 
UDT's are pretty useful. You can create a UDT that contains all the information you want to have under one tag name.

I use a UDT to classify and transfer data via produced and consumed tags for data collection. I called it DA for Data Acquisition.

The name can be anything you want. But the data types contained within it are specific.

DA.Run_Trigger (BOOL)
DA.Idle_Trigger (BOOL)
DA.Fault_Trigger (BOOL)
DA.Fault_Code (DINT)
DA.Idle_Code (DINT)
DA.Product_Name (STRING)
DA.Max_Cases_Per_Hour (REAL)
etc.

Although the UDT can be called anything you want, naming it something relevant is always a good idea.

When I need to create a tag to transfer data using that configuration I create a new tag with the data type called DA. Once your UDT has been created, it becomes available in the drop down list of data types you can select from when you create a new tag. It then inherits the data type definition you specified when the UDT was first created.

Example for tag named Your_Tag_Name using the UDT called DA.

Your_Tag_Name.Run_Trigger (BOOL)
Your_Tag_Name.Idle_Trigger (BOOL)
Your_Tag_Name.Fault_Trigger (BOOL)
Your_Tag_Name.Fault_Code (DINT)
Your_Tag_Name.Idle_Code (DINT)
Your_Tag_Name.Product_Name (STRING)
Your_Tag_Name.Max_Cases_Per_Hour (REAL)
etc.

Look at the UDT for Motor as an example. It should explain this better.

Hope this helps.

Dave
 

Similar Topics

I'm rebuilding a panelview app and have a question. Control Logix will be the platform, I have a screen that shows data for the last 10 event...
Replies
4
Views
1,288
Hello again, My problem is that a company sent me some program changes to install. It tells me to add a few tags under UDT>SYS_FAULT. When I...
Replies
2
Views
3,003
1) I am poor 2) I have written some useful plc code in the past 3) Anyone here ever try and sell a user defined FB?
Replies
29
Views
6,672
I am working on a project on an s7-1200 with an hmi, but I am looking to remove the HMI and substitute its functionality using the User-Defined...
Replies
2
Views
1,919
Hi all, is there an easy way to reset a user defined shift register to 0? i have a data type containing 8 bools for an array of 10 and would like...
Replies
12
Views
3,194
Back
Top Bottom