![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-v2-0/cx-supervisor-v2-0_user-manual_744213283.webp)
CHAPTER 17 – Best Practices
OMRON
Page 260
Release 2.0
•
Never use ‘On Regular Interval’ scripts
You should (almost!) never need to use ‘On Regular Interval’ scripts. Always question:
•
If it is used for logging - use the logging facilities instead
•
If it is used for timing - use PLC ladder instead as this is much more reliable.
•
When they start with (or contain) “IF <condition> THEN …” you should probably be
using an “On Condition” script using <condition> from the IF statement.
•
When they perform calculations on PLC or memory points (e.g. “Z = X * Y), use “On
Condition” to recalculate when the source data changes e.g. with a condition X || Y ||
TRUE (which forces execution even if value changes to value 0). This will
guarantee
the calculated is up to date with the latest source information, plus stress the system
much less while the value doesn’t change.
•
Never use Sleep() command
You should (almost!) never need to use the Sleep command. It can also create confusing applications
as it can create re-entrant scripts and asynchronous PLC communications. Always question:
•
If it is used for timing - use PLC ladder instead as this is much more reliable.
•
Consider if the code following the Sleep should in fact be executed on an event e.g.
after completion flag returned from PLC instruction or new data value etc
•
Use Animations if possible
Always choose direct object animations in preference to page/object scripts: blink, colour, disable,
height, width, horizontal%fill, vertical%fill, move, rotate, display and close. These are both quicker
and clearer.
•
Keep scripts short
Although the script editor can manage hundreds of lines this would suggest a serious design problem.
Consider 30 lines as a practical maximum
Data Logging
This section covers some data logging related good practices.
•
Utilise Data Logging performance
Always use the inbuilt Data Logging in preference to trend graphs or file I/O functions, as the
performance is far superior.
•
Always use “On Change”
Always log data “On Change”. There is no sampling error and CPU, disk activity and storage
required are almost certainly reduced.
Summary of Contents for CX-SUPERVISOR - V2.0
Page 2: ...CX Supervisor User Manual Software Release 2 0...
Page 3: ......
Page 5: ...CX Supervisor User Manual OMRON Page ii Revision 2 0...
Page 7: ...CX Supervisor User Manual OMRON Page iv Revision 2 0...
Page 11: ...CX Supervisor User Manual OMRON Page viii Revision 2 0...
Page 13: ...CX Supervisor User Manual OMRON Page x Revision 2 0...
Page 15: ...CX Supervisor User Manual OMRON Page xii Revision 2 0...
Page 17: ...CX Supervisor User Manual OMRON Page xiv Revision 2 0...
Page 19: ...CX Supervisor User Manual OMRON Page xvi Revision 2 0...
Page 21: ...CX Supervisor User Manual OMRON Page xviii Revision 2 0...
Page 23: ......
Page 67: ......
Page 97: ......
Page 137: ...CHAPTER 7 Graphics Library OMRON Page 114 Release 2 0...
Page 183: ...CHAPTER 9 Animation OMRON Page 160 Release 2 0...
Page 215: ......
Page 263: ......
Page 269: ......
Page 274: ...OMRON CHAPTER 16 Connecting to Omron Industrial Components Release 2 0 Page 251...
Page 275: ......
Page 285: ......
Page 319: ......
Page 331: ......
Page 351: ......
Page 359: ...GLOSSARY OF TERMS CX Supervisor User Manual OMRON Page 336 Release 2 0...