ControlLogix 5000 Structured Text

rigsha97

Member
Join Date
Jun 2009
Location
.
Posts
9
I need to move values from a UDT to a new array.
Currently I am using:

HMI_BZ_PS[00] := XtrA_Bz1.PS;
HMI_BZ_PS[01] := XtrA_Bz2.PS;
HMI_BZ_PS[02] := XtrA_Bz3.PS;
HMI_BZ_PS[03] := XtrA_Bz4.PS;
HMI_BZ_PS[04] := XtrA_Bz5.PS;

But I have a lot of these to do. In the past I have been able to move large amounts of data using the following:

For i := 1 to 11 by 1

Do

OfflineDie_Zone_Heat_Cntrl.PS := HMI2CLx_REAL_OfflineDie_PS;

End_For;

I am wondering if there is a way to to add another variable to have it do the same function but to have it fill in number in the tag also:


HMI_BZ_PS := XtrA_Bz(b).PS;
HMI_BZ_PS := XtrA_Bz(b).PS;
HMI_BZ_PS := XtrA_Bz(b).PS;
 
The two ways I know to do what you are talking about one is:

A lot of work to redo your tag structure - use two arrays

The other I do not know if ST supports and that is concatenating strings, I have done similar to what you want in C# using this method, I assume its in VB also, but I do not know about ST - also this method might take more processing time it involves converting number to string, concatenating the string then making that string your variable name to equal the array element

Other than that its like Daba said in the linked post, big hammer method
 

Similar Topics

Has anyone had any experence using structured text on a Contrologix 5000 L62 platform. We have a new factory coming on line and they have...
Replies
6
Views
8,966
I'm attempting to read tags from a 1756L81E(FactoryTalk Logix Echo) controller using the PLC4J api. I have one read and one write bool setup in...
Replies
10
Views
2,286
Hey All, I'm currently building a control system for a large building in a industrial setting. Doing lighting, vent, roof control, door access...
Replies
12
Views
3,498
I know there's the DTOS Function, but I have a value of "35" that is really "0035", and that's how I want it converted. Looks like the function...
Replies
2
Views
1,521
I am an Electric Engineer working as a maintenance engineer and manage some technician on the production hall now but in the past, I mostly focus...
Replies
12
Views
3,545
Back
Top Bottom