Professional Documents
Culture Documents
This Tech Note outlines some aspects of activation of I/O tags and presents options to properly
handle I/O tag activation from a script.
Introduction
I/O Tags get their values from an external source defined via an Access Name. An InTouch I/O
tag is said to be active when WindowViewer opens a communication channel with the I/O server
and requests the value of the tag to be send. The I/O server will respond to the client with the
value, timestamp, and quality data. After that, the I/O server will only update the client (the
InTouch application) whenever changes in value or quality occur; this functionality is commonly
known as "Report By Exception." For more information please refer to Tech Note 116, Overview
of How Wonderware I/O Servers Operate.
1/3
8/23/13
recipe is used in a script function such as RecipeLoad(). It is then necessary to activate those
I/O tags beforehand.
2/3
8/23/13
- Open a window that references the tags that are part of the loop before executing the code
in the loop (and allow time for the tags to read from I/O). If the Window script on Show is used,
the script will execute; if an Action script for a push button is used, the script won't execute
unless the button is clicked. In both cases, though, the tags will become active while the
window is open and will deactivate upon closing it.
- Control the loop in a time basis instead of using a For/Next loop. For example, a condition
script "While True every Xmsec" (where X is long enough to assure items are active).
- Add a delay from the time the indirect gets assigned to the time the indirect is used. For
example, set a flag (discrete tag) and create a while true script every Xmsec for that flag
(again with X long enough to make sure that the item is active); once the indirect is used then
reset the flag.
- Replace the For-Next loop and use a different logic based on the .ReferenceComplete dot field.
Two different Data Change scripts are required:
Data Change for "IndTag.ReferenceComplete":
IF IndTag.ReferenceComplete THEN
{Reference is complete means that the indirect has the value of
the I/O tag}
Sum = Sum + IndTag.Value;
{Now increment tag that controls loop or reset if exceeding the
limit of 10}
IF i < 10 THEN
i = i + 1;
ELSE
i = 0;
ENDIF;
ENDIF;
Data Change for i:
IF i > 0 THEN
{Change reference for indirect tag}
IndTag.Name = "Tag" + Text(i, "#");
ENDIF;
This code requires that "i" and "sum" are defined as tags and that Tag1 through Tag10 are not
otherwise active (if they are, the dot reference complete Data Change script will not execute).
F. Gonzalez / B. Good
Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc.,
26561 Rancho Parkway South, Lake Forest, C A 92630. There is also technical information on our software
products at Wonderware Technical Support
For technical support questions, send an e-mail to support@wonderware.com.
back to top
2013 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be
reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying,
recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from
Invensys Systems, Inc. Terms of Use.
https://wdnresource.wonderware.com/support/kbcd/html/1/t001089.htm
3/3