Operator`s manual
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
8-5
13: P End Table 1
* A Mode 10 Memory Allocation
01: 35 Input Locations
02: 64 Intermediate Locations
8.4 SUB 1 MINUTE OUTPUT INTERVAL
SYNCHED TO REAL TIME
Instruction 92 has 1 minute resolution. If
processed output is required on an interval less
than 1 minute, Instructions 18 and 89 can be
used to set the Output Flag on a shorter
interval.
Instruction 18 takes time (tenths of seconds into
minute, minutes into day, or hours into year),
performs a modulo divide by a user specified
value and loads it into an input location.
When the modulo divisor divides evenly into the
interval, one gets a counter in an input location
that goes to 0 on a periodic interval. In this
example, tenths of seconds into the minute is
modulo divided by 300. The counter counts up
to 295 then goes to 0 (i.e., every 30 seconds;
tenths of seconds into minute has a resolution
of 0.1 seconds.)
Instruction 89 is used to set the Output Flag
when the tenths of seconds counter is less than
5 (the execution interval, 0.5 seconds). With
this short program the Output Flag could be set
when the seconds counter equaled 0. However,
if Instruction 18 followed a series of instructions
that took longer than 0.1 seconds to execute or
was in Table 2, executed at the same interval as
an extensive Table 1, the time at which
Instruction 18 was executed might be 0.1
seconds or more beyond the modulo divisor.
The value output would not equal 0. Setting the
Output Flag when the seconds counter is less
than the execution interval avoids this problem.
Using Instruction 18 keeps the output interval
synchronized with real time. If a counter
incremented within the program was used to
determine when to set the Output Flag, output
would depend on the number of times the table
was executed. The actual time of output would
depend on when the program was actually
compiled and started running. If the table
overran its execution interval (Section 1.1.1), the
output interval would not be the count multiplied
by the execution interval, but some longer
interval.
In this example a temperature (type E
thermocouple) is measured every 0.5 seconds
and the average output every 30 seconds.
Input Location Assignments:
1:TEMP DEG C
10:30 SEC 0
* 1 Table 1 Programs
01: .5 Sec. Execution Interval
01: P18 Time
01: 0 Tenths of seconds into
minute (maximum 600)
02: 300 Mod/by
03: 10 Loc [:30 SEC 0 ]
02: P17 Panel Temperature
01: 1 Loc [:REF TEMP ]
03: P14 Thermocouple Temp (DIFF)
01: 1 Rep
02: 11 5 mV fast Range
03: 2 IN Chan
04: 2 Type E (Chromel-Constantan)
05: 1 Ref Temp Loc REF TEMP
06: 2 Loc [:TC TEMP ]
07: 1 Mult
08: 0 Offset
04: P89 If X<=>F
01: 10 X Loc 30 SEC 0
02: 4 <
03: .5 F
04: 10 Set high Flag 0 (output)
05: P71 Average
01: 1 Rep
02: 2 Loc TC TEMP
06: P End Table 1
8.5 SDM-A04 ANALOG OUTPUT
MULTIPLEXER TO STRIP CHART
This example illustrates the use of the SDM-A04
4 Channel Analog Output Multiplexer to output 4
analog voltages to strip chart.