beautypg.com

3 timedcontrol instruction – Campbell Scientific SDM-CD8S 8 Channel Solid State DC Control Module User Manual

Page 26

background image

SDM-CD8S 8 Channel Solid State DC Control Module

In the example in Section 8.3, the logic that controls the SDM-CD8S is in the
processing task. In the pipeline mode the measurements continue to occur at
the proper time. If the processing falls behind the measurement the values
used to set the SDM-CD8S will be updated only when the processing task gets
to that point. This will be later than would be expected if the processing task
were not falling behind.

The TimedControl instruction allows the timing of when to switch SDMCD16
settings to be part of the measurement task rather than the processing task.

8.4.3 TimedControl Instruction

TimedControl: This instruction allows a sequence of fixed values and
durations (number of scans) to be controlled by the measurement task. It
allows a series of SDM-CD16 settings to be defined so that the switching
sequence occurs at the proper times even if processing is lagging behind the
measurement task.

TimedControl(Size,Sync_interval, Interval_Units,Default_Value, Index_dest,

Source_Array, ClockResetOpt)

Size: The number of values in the sequence.

Sync_interval: When the program is compiled and starts running or when the
TimedControl is reset the program will wait until an even multiple of this
interval to start the sequence. Enter 0 to start immediately. See Clock/Reset
Option for more information on what happens prior to the start.

Interval_Units: The time units for the Sync_Interval.

Default_Value: The value to set the output to prior to starting the sequence.

Index_dest: A variable in which to store the index of the value that is
currently being used in the source_array. This instruction will load 0 for the
index if the instruction is waiting for the Sync_interval to start.

Source_Array: A two dimension array that contains the values to use and the
duration (in number of scans) for which that value is to remain in use. For
Example, arrayname(x,2) where the array must be dimensioned to have at least
as many variables in the x dimension as the Size parameter requires. For any
variable pair i, arrayname(i,1) = the value to set, and arrayname(i,2) = the
duration in number of scans to use that value before moving to the next value
in the array.

ClockResetOpt: When the TimedControl instruction occurs before
BeginProg
this option is used to set how the instruction behaves when the
dataloggers clock is changed:

1. If the datalogger clock is changed, the instruction behaves as if it were just

started after compile and the input to the SDMCD16 goes to the default.

20