12.10.15          Loop to change Arrayed Text Constant Tags

This Script "loops" through a Text Array type constant Point.  Text Arrays are processed faster than individual Tags allowing scripts to run faster.  This script uses a GETVAL and SETVAL to two 1000 element text arrays (1000 GETVAL and 1000 SETVAL).  The time to process is about 2 seconds, about ¼ the time as 200 tags.  This is because the there are only 2 tag ids that must be found with the two text arrays and there are 200 tag ids that must be found for the 200 individual tags. 

It is important to turn Action Log Off: each SETVAL writes to Action Log file and possibly to Action Log ODBC database. Turn off Action log to make scripts faster.

 

# important to turn Action Log off

SETVAL %DALOGSTATUS=0

 

# analog1 is Screen Tag to allow users to adjust how many tags  are read

set loops [GETVAL analog1]

 

# This reads tags from TextArryB and writes tags to TextArryA

# TextArryA and TextArryB  are both Constant Tag Text Array

# of 1000 elements, 70 characters each element

 

for {set Z 0} {$Z<$loops} {incr Z} {

      SETVAL "TextArryA($Z)=[GETVAL TextArryB($Z)]"

}

SETVAL %DALOGSTATUS=1