Hi!
I have problem with intouch script and indirect tags.
I have script which create csv files and i want to automatize it to write data from indirect tags and to be able to set how many tags we want to write to csv.
original script looks like that but i want to make it automatized
CSVField2 = csv_field_1_indirect.Name;
CSVField3 = csv_field_2_indirect.Name;
I wrote
{write tag names to indirect tags}
csv_field_1_indirect.Name = Temperature_SP.Name ;
csv_field_1_indirect.Value = Temperature_SP.Value;
csv_field_2_indirect.Name = Control_TC_1.Name;
csv_field_2_indirect.Value = Control_TC_1.Value;
csv_field_3_indirect.Name = Load_TC1.Name;
csv_field_3_indirect.Value = Load_TC1.Value;
{TagCounter - number of used tags}
FOR TempLoopCounter = 1 TO TagCounter
{assemble indirect tag name - ex. csv_field_1_indirect.Name }
name11 = "csv_field_" + Text(TempLoopCounter,"0") + "_indirect.name";
{assemble csv file tag name - ex CSVField1}
name2.Name= "CSVField" + Text(TempLoopCounter+1,"0");
{write value from indirect tag to csv file tag}
name2.Value= "name11";
NEXT;
where
name11 - memory message
name2 - memory message
Could you point me correct direction how to do that?
Thanks!
I have problem with intouch script and indirect tags.
I have script which create csv files and i want to automatize it to write data from indirect tags and to be able to set how many tags we want to write to csv.
original script looks like that but i want to make it automatized
CSVField2 = csv_field_1_indirect.Name;
CSVField3 = csv_field_2_indirect.Name;
I wrote
{write tag names to indirect tags}
csv_field_1_indirect.Name = Temperature_SP.Name ;
csv_field_1_indirect.Value = Temperature_SP.Value;
csv_field_2_indirect.Name = Control_TC_1.Name;
csv_field_2_indirect.Value = Control_TC_1.Value;
csv_field_3_indirect.Name = Load_TC1.Name;
csv_field_3_indirect.Value = Load_TC1.Value;
{TagCounter - number of used tags}
FOR TempLoopCounter = 1 TO TagCounter
{assemble indirect tag name - ex. csv_field_1_indirect.Name }
name11 = "csv_field_" + Text(TempLoopCounter,"0") + "_indirect.name";
{assemble csv file tag name - ex CSVField1}
name2.Name= "CSVField" + Text(TempLoopCounter+1,"0");
{write value from indirect tag to csv file tag}
name2.Value= "name11";
NEXT;
where
name11 - memory message
name2 - memory message
Could you point me correct direction how to do that?
Thanks!