74 Pamux User’s Guide
READ DIGITAL POINT 9
Purpose:
Reads a digital point.
COMMAND TYPE:
Digital
PARAMETERS:
COMMAND Contains the value 9.
ADDRESS Contains the address of the Pamux brain board.
POSITION Contains the point number.
VALUE ARRAY The first element of this array contains returned data. The value will be -1 if the
point is active (on), or 0 if the point is inactive (off).
REMARKS:
The POSITION value is a point offset starting from the value in the ADDRESS parameter. The point
number in the POSITION parameter can range from 0 to 511 if the ADDRESS parameter is 0. An
error will be returned if the values in these parameters exceed the limits.
EXAMPLE:
This example reads the state of the module at position 123 and displays the status.
100 COMMAND% = 9 ‘ Read Digital Point command
110 ADDRESS% = 0 ‘ Address of brain board
120 POSITION% = 123 ‘ Position 123
130 GOSUB 1000 ‘ Call the driver
140 IF VALUE%(0) = 0 THEN PRINT "Module Is Off"
ELSE PRINT "Module Is On"
.
.
1000 CALL
Pamux(ERRCOD%,ADDRESS%,COMMAND%,POSITION%,VALUE%(0))
1010 IF ERRCOD% < 0 THEN GOTO 2000
1020 RETURN
Note: This is an example of an alternate numbering scheme for I10 points. Both ADDRESS%
and Bank (if used) are set to zero and I/O points are numbered linearly from 0 to 511.
PROGRAMING WITH THE PAMUX DRIVER