![background image](http://html1.mh-extra.com/html/omron/cx-supervisor/cx-supervisor_user-manual_744211291.webp)
Appendix B Frequently Asked Questions
290
This is by Microsoft's design for these operating systems, however it is
possible to force the old operation, depending on which controls you need
to expose for use in CX-Supervisor. Contact your supplier to receive
details of the required Registry changes.
•
How does Sleep() work?
The CX-Supervisor Sleep function is designed to create a short pause in
script execution. The parameter specifies the duration of the pause in
milliseconds. For example:
<statements A>
<statements B>
Sleep(100)
<statements C>
In this example 'statements B' will begin executing immediately when
'statements A' complete, though 'statements C' will not begin execution
until 100ms after 'statements B' have completed.
Note 1: In a well designed, truly event driven system use of the Sleep()
statement should never be required. Always consider if the statements
after the Sleep should be in their own script, executed when a Condition
occurs.
Note 2: The Granularity (or intervals) differs between Operating Systems.
In Windows NT (and 2000) expiration is checked every 10ms, so
'Sleep(100)' actually pauses for 100 to 109.99 milliseconds depending on
when it was started. For Windows 98 and ME the granularity is 55ms so
'Sleep(100)' actually pauses for 110 (2 times 55) to 164.99 milliseconds
(nearly 3 times 55). For this reason, Sleep statements can act differently
on different Operating Systems making the application OS dependant.
Note 3: Sleep should never be used as a delay for timing processes, for
the following reasons:
- The actual time delay depends on the OS
- There is always an error of 0 to 1 granularity, depending on when the
action is started.
- The frequency cannot be guaranteed as the OS may be busy, or
handling other processes.
Note 4: Because of Note 2 and Note 3 above, Sleep should not be used
for creating output or logic pulses e.g. setting a bit on, sleeping, then
setting the bit off. Instead, just use the PC to set the bit and allow the PLC
to clear the bit, either after a duration timed by the PLC real time clock or
when the triggered process is complete.
The requirement for Sleep is quite simple but the implementation is
actually very complex. In the example above, the application must
continue to run during the pause i.e. read PLC data, log data, check
alarms, animate graphics etc. For this reason, any script with a Sleep
statement must be executed in parallel with the system. This can result in
unexpected results when a Sleep is added, and previously functioning
script commands are now running in parallel. Redesign the script
considering parallel processing.
This can also result in unexpected behaviour when a Sleep is added to a
Project initialisation or Page initialisation script as some parts of the
system or objects may not be loaded at time of execution.
Содержание CX-Supervisor
Страница 1: ...CX Supervisor Software Cat No W10E EN 01 User Manual Software Release 3 1...
Страница 3: ...Copyright Notice 2...
Страница 16: ...15...
Страница 17: ...16...
Страница 27: ...Tip of the Day SECTION 1 Graphics Editor 26...
Страница 35: ...CX Supervisor Preferences SECTION 2 Pages 34...
Страница 79: ...Responding to Events SECTION 5 ActiveX Objects 78...
Страница 115: ...Printing the Graphics Library SECTION 7 Graphics Library 114...
Страница 181: ...Data Logging SECTION 11 Data Logging 180...
Страница 201: ...Examples SECTION 12 Databases 200...
Страница 243: ...Performance Monitor SECTION 16 Application Analysis Performance Monitor 242...
Страница 253: ...Using with Omron s CX Server OPC SECTION 17 Using CX Supervisor as an OPC Cli 252...
Страница 259: ...Creating a CX Supervisor Client application SECTION 18 Connecting to a remote CX 258...
Страница 263: ...Adding a Point Linked to a Parameter SECTION 19 Connecting to Omron Industrial 262...
Страница 271: ...Data Logging SECTION 20 Best Practices 270...
Страница 275: ...Configuring a Server PC running Windows NT or 2000 Appendix A Configuring a PC 274...
Страница 277: ...Appendix B Frequently Asked Questions 276...
Страница 296: ...Appendix B Frequently Asked Questions 295...
Страница 297: ...Appendix B Frequently Asked Questions 296...
Страница 298: ...Appendix B Frequently Asked Questions 297...
Страница 299: ...Appendix B Frequently Asked Questions 298...
Страница 333: ...Revision history 332...