Start & stop, Synchronous or asynchronous, Control switch – Sensaphone SCADA 3000 Users manual User Manual
Page 201
16-15
Chapter 16: Programming in C
Click on Run Once to test-run your program one time. The form will display The Run Time—
the amount of time it took for your program to complete, and whether or not it ran from
beginning to end without errors. If not, it will display any errors encountered. The run time is
useful in deciding whether to run the C program in synchronous mode or asynchronous mode.
It will also help you to decide what to enter for the reload time if you choose asynchronous
mode.
Start & Stop
After the program has been compiled, run once, and all errors have been corrected, you
can START the program. Before STARTING though, you must determine if the program
will be running synchronously or asynchronously, and if running asynchronously, you must
also determine what the Reload Time will be. The Reload Time is the time between each
successive execution of the C Program. This is programmable so that you can make the unit
most efficient by telling the SCADA 3000 to execute the program only when necessary. For
instance, if you require the program to run every half hour, it is not necessary to waste SCADA
3000’s time and have the program run every 10 seconds.
The Reload Time must be at least double the Run Time and can only be programmed in whole
numbers. The Run Time is provided when you RUN the program. So if your Run Time is 1.5
seconds, the Reload Time must be at least 3 seconds.
After the program is STARTED, SCADA 3000 will run the program depending on your pro-
grammed Reload Time (Async. mode) or every time your ladder program runs (Sync. Mode).
Synchronous or Asynchronous
You can have your C program run sequentially with your ladder program (synchronous) or you
can have it run independently on a fixed time interval (asynchronous). It depends on what your
application requires. In synchronous mode, the inputs are scanned before the program starts
and the outputs will not update until the C program has finished executing. In asynchronous
mode, inputs and outputs are updated as changes occur during program execution. Generally, if
you have a long C program or it takes a long time to run, you do NOT want it to run synchro-
nously because this will slow your ladder program & input/output scanning to unacceptable
levels.
Order of events in synchronous mode
1) Read motherboard inputs
2) Read expansion module inputs (if any)
3) Run ladder program (if enabled)
4) Run C program (if enabled)
5) Update main board outputs
6) Update expansion module outputs (if any)
Control Switch
On the front panel of the SCADA 3000 is a switch labeled “CNTRL”. This switch is used to
manually deactivate any control programs (Ladder, C program, PID control) onsite. If this
switch is in the DISABLE position, no control programs will run. Additionally, you can have
the control switch turn all outputs OFF.
See the section on the Ladder & C-Program Start/Stop form (“Running and Stopping Ladder
Execution”) in Chapter 15.