
APPENDIX B. CONTROL PORT SERIAL I/O INSTRUCTION 15
B-13
Example: 100 samples are averaged by the
barometer connected to the CR23X via hook-up
#1.
ET = 0.1 * 100 + 0.9
ET = 10.9 seconds
Time out = 10.9/0.01
Time out = 1090
In general, the above equations overestimate
the execution time. When execution speed is
critical, the minimum time out delay must be
determined through trial and error.
B.7.1.4 BAROMETER PROGRAM
The following example program assumes the
barometer is jumpered for TTL output and the
average of one measurement. The following
considerations are accounted for in the
program.
• To preserve the barometer measurement
resolution, barometer data must be output
to the CR23X Final Storage in High
Resolution (OUTPUT PROCESSING
INSTRUCTION 78).
• A communication failure shows up as a
partial value or -99999. It is generally
desirable to exclude this value from any
processing and log the incidence of failure.
A failure may be detected by comparing it to
expected limits. A bad value may be
excluded from processing by temporarily
setting the Intermediate Processing Disable
flag (flag 9). To log a failure the reading
could be output immediately with the time of
occurrence.
01: P15 Control Port Serial I/O
01: 1 Repetitions
02: 31 Configuration code ASCII;TTL
03: 1 CTS/Delay before send
04: 15 C1RTS/DTR , C5 TXD/RXD
05: 0 Output start location
06: 0 Number of locations to send
07: 13 Input termination character 13 = CR
08: 20 Max characters to receive
09: 200 Delay for CTS/input Wait 1 sec for Input
10: 1 First input location
11: 1 Multiplier barometer jumpered
12: 0 Offset for millibar output
02: P89 If X<=>F START: Limit testing
01: 1 X Loc AIR, mb
02: 3 >= If reading is > 1300 mb
03: 1300 F
04: 11 Set high Flag 1 then set Flag 1 high
03: P89 If X<=>F
01: 1 X Loc AIR, mb
02: 4 < If reading is < 800 mb
03: 800 F
04: 11 Set high Flag 1 then set Flag 1
04: P91 If Flag/Port If Flag 1 is set,
01: 11 Do if flag 1 is high
02: 30 Then Do do the following.
05: P86 Do Output time of failure
01: 10 Set high Flag 0 (output)
Komentáře k této Příručce