Page 1 of 1

How to display array tag values in a field ?

Posted: Fri May 24, 2013 3:36 am
by Nicolas2121
I have created an array tag. My example is : Name = array_tag, dataType = FLOAT, Size = 1, ArraySize = 6, GlobalDataType = FLOAT.
I affect its values in a script module :

Globals.Tags.array_tag[0].Value = 1;
Globals.Tags.array_tag[1].Value = 2;
Globals.Tags.array_tag[2].Value = 3;
Globals.Tags.array_tag[3].Value = 4;
Globals.Tags.array_tag[4].Value = 5;
Globals.Tags.array_tag[5].Value = 6;

I have read in help that array tags can be used to edit charts, but in my application, I want to parameter a series of coefficients which are used in a calculation.

I want to display a tag’s value in a field in an HMI view (Globals.Tags.array_tag[0].Value as an example).


Is it possible to display array tag values in a field ? If it is, could you tell me how to do that ?

Thanks a lot,

Re: How to display array tag values in a field ?

Posted: Tue May 28, 2013 11:47 am
by mark.monroe
You would have to use script to set the value of the AnalogNumericBox:

Code: Select all

this.AnalogNumeric1.Value = Globals.Tags.Tag1[0].Value;
However, you can not use the same method to get the value that is in the AnalogNumericBox. Rather, you would have to use the tag associated with the AnalogNumericBox to get the value that is in the box.

Code: Select all

//The below will not work
Globals.Tags.Tag3.Value = this.AnalogNumeric1.Value;