Output-control functions, Outputstate(adapter, adapterchannel, state), Logic operators and functions – PASCO CI-6462 Relay User Manual
Page 4

®
R e l a y
O u t p u t - c o n tr o l F u n c t i o n s
4
Output-control Functions
Note: The examples in the remainder of this Instruction Manual are presented as they would
appear in DataStudio, though most of them are applicable to the GLX used in standalone mode.
For more information on defining calculations on the GLX, see the GLX Users’ Guide.
outputstate(Adapter, AdapterChannel, state)
Let’s take a closer look the definition that you typed into the calculator for the exam-
ple on page 2 or 3:
The text to the left of the equal sign is the name of the calculation; you can type any-
thing you want there. The important part of the calculation, on the right side, is the
outputstate function and its three arguments enclosed in parentheses and separated by
commas.
The first argument, Adapter, identifies the digital adapter to be controlled. In DataStu-
dio, the first adapter that you connect is number 1, the second is number 2, etc.; if you
have only one adapter, it is always number 1 regardless of where it is plugged in. On
the GLX in standalone mode, the number of the adapter is the number of the port that
it is plugged into (1, 2, 3, or 4).
The second argument, AdapterChannel, identifies the channel of the digital adapter
that the Relay is plugged into. In the example above, it is equal to 1. If you had
plugged the Relay into channel 2 of the adapter, you would set the argument equal to
2.
Tip: You can use two relays connected to the same digital adapter, and more if you have multiple
adapters. For each relay, create one calculation that includes the outputstate function and
uniquely addresses it using the Adapter and AdapterChannel arguments.
The third argument, state, is what actually controls the Relay. When state
= 0, the
Relay is “normal”. When state
≠ 0 (i.e. when the argument equals anything other than
zero), the Relay is activated. To say it another way: the Relay is activated only when
state is true.
The state argument is usually a logical expression made up of one or more of the
operators and functions described below.
Logic Operators and Functions
A logic function has two possible values: 0 and 1. A logic operator (
< or >) is used to
build an expression that can have a value of 0 or 1.
Less Than and Greater Than
If an expression such as a
< b is true, then it
equals 1. If the expression is false, then it equals 0.
inrange(min, max, x)
This function has three arguments: the first two, min and
max, define the upper and lower limit of a range, and the third, x, is an input value to
Relay State = outputstate(1, 1, T>30)
name
Adapter
AdapterChannel
State
outputstate function