beautypg.com

94 else, 95 end, 96 activate serial data output – Campbell Scientific CR23X Micrologger User Manual

Page 194

background image

SECTION 12. PROGRAM CONTROL INSTRUCTIONS

12-6

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

4

Input location for
subsequent comparisons

EXAMPLE:

1: CASE (P93)

1:

2

Case Loc [ ValueX ]

2: If Case Location < F (P83)

1:

69.4

F

2:

3

Call Subroutine 3

;else
3: If Case Location < F (P83)

1:

72

F

2:

10

Set Output Flag High (Flag 0)

;else
4: If Case Location < F (P83)

1:

77.3

F

2:

30

Then Do

5: Z=F (P30)

1:

0.0

F

2:

0

Exponent of 10

3:

25

Z Loc [ ValueY ]

6: End (P95) ;of Then Do

7: End (P95) ;of Case Statement

*** 94 ELSE ***

FUNCTION
When Command 30 (Then/Else) is used with an
If Instruction, the Else Instruction is used to
mark the start of the instructions to execute if
the test condition is false (Figure 3.8-1). The
Else Instruction is optional; when it is omitted, a
false comparison will result in execution
branching directly to the End Instruction.
Instruction 94 has no parameters.

*** 95 END ***

FUNCTION
Instruction 95 is used to indicate the end/return
of a subroutine (Instruction 85), the end of a
loop (Instruction 87), the end of an If Then/Else
sequence (Instructions 88-92 when used with
command 30), or the end of a Case sequence
(Instruction 93). The End Instruction has no
parameters.

*** 96 ACTIVATE SERIAL DATA OUTPUT ***

FUNCTION
Instruction 96 is used to activate Storage
Module (SM192/SM716 or Card Storage
Module) or serial data (printer) output. Some
applications require the Computer RS232 port
be left on continuously for proper operation.
The Computer RS232 port can be configured to
stay on continuously in the

D

mode as

described in Section 1.8.7.

Normally Instruction 96 is placed in the program
table after all Output Instructions have been
entered and is executed each time the Table is
executed. In this situation any data sent to Final
Storage is output as soon as possible.
However, by using Program Control Instructions
to allow execution of Instruction 96 only at
certain times, the user can control when the
output device(s) are active. Instruction 96
allows a choice of serial data format and the
selection of Addressed or Pin Enabled device
for the serial print output.

A single parameter is used to select whether the
instruction is to control the "printer", Storage
Module, or Card Storage Module output, and if
the printer is selected, the format and baud rate.
The Instruction must be entered separately for
each device that is to receive output.

If both Final Storage areas are in use,
Instruction 96 will send data from the area
which is currently active. Final Storage Area 1
is active at the start of each Table. Instruction
80 can be used to change the active area. The
Area set by Instruction 80 remains active until
changed by another Instruction 80 or the Table
ends (at which time Area 1 becomes the active
Area 1). Instruction 80 can also direct output to
Input Storage, in which case Instruction 96
assumes Final Storage Area 1.

If the CR23X is already communicating on a 9-
pin serial port when Instruction 96 is executed,
the output request is put in a queue and
program execution continues. As a 9-pin serial
port becomes available, each device in the
queue will get its turn.

The request is not put in the queue if the same
device is already in the queue. The data
contained in the queue (and which determine a
unique entry) are baud rate (if applicable), and