Tech Note 1006 - Managing Symbol Script Timeouts When Using WW MES API Pop-Up Dialogs
Tech Note 1006 - Managing Symbol Script Timeouts When Using WW MES API Pop-Up Dialogs
All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.
Topic#: 002837
Created: January 2014
Introduction
Wonderware MES provides many ways to customize script or code in order to meet variable production requirements. One solution is to
take advantage of Wonderware Application Server to implement custom code in script, and show a user interface within an InTouch
window.
There are many concerns when utilizing ArchestrA or Symbol script for MES customization. This Tech Note addresses how the timeout
setting affects the script behavior, and includes relevant recommendations to avoid such effect.
Application Versions
Wonderware Application Server 3.x or higher
If a script loop does not complete execution within the timeout limit, WindowViewer automatically terminates the loop and writes a
message to the Logger. You can check or change timeout setting via WindowMaker > Special > Configure > WindowViewer >
Managed Application tab (Figure 1 below).
By design, the timeout setting only affects the scripts including loop logic. In most cases, there's no concern as the script is supposed to
be executed successfully in few seconds. However, when the script is also including any kind of user interaction, it is most likely the
script will timeout, resulting in the script halting at the next Loop logic code. It will execute other code but still generate a timeout error
message.
Note: This Tech Note includes detailed Timeout setting information for ArchestrA Graphics. Detailed explanation of FOR loops will be
added to ArchestrA Graphics User's Guide in a future release.
PopupEntitySelection()
PopupItemReasonSelection()
PopupUtilReasonSelection()
PopupOperationSelection()
PopUpAddConsDlg()
And Others
If the custom script includes at least one of above APIs with additional loop logic inside the same script, it is likely that some of the
transactions can fail due to timing out.
The sample MES custom code in a Symbol Script to verify this behavior.
In this sample code, it is simple to allow user to select the entity and show all entity attributes in the list box:
Loop through the dataset and call ListBox.AddItem() to display all attributes.
Sample Code
When executing the whole script in WindowViewer within default 5 seconds, the complete list of entity attributes should be displayed
successfully as below:
From the SMC log, we can observe all correct log lines without any error.
This is because the timeout limit is triggered. From the SMC we can observe uncompleted log lines with additional timeout
warnings.
There's a big concern that not all of the MES transactions are completed, resulting in data inconsistence in MES database. However, it
does not make sense to limit user to interact the popup UI (e.g. Entity Selection in this example) within this limited interval.
1. Create the necessary custom properties in ArchestrA Graphic as public variables, e.g. EntityID and FillLB.
2. Include the loop logic in another named script to fill in list box, e.g. FillListBox.
3. Delete the loop logic from original script only to include popup dialog and necessary transactions. Call the named script FillListBox
(triggered by FillLB) instead.
4. Re-execute the graphic in WindowViewer even when exceeding the timeout interval. You would still be expected to see additional
timeout warning in SMC log by design. However, the complete list of entity attributes should display successfully.
FIGuRE 10: SMC LOG fOR TImEOut OPERatION aftER SEPaRatING ORIGINaL ScRIPt
S. Hong
Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also
technical information on our software products at Wonderware Technical Support.
Back to top
©2014 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 any information storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Terms of Use.