B1-5
IM 34M06H62-02E 3rd Edition : Jul.16
2015-00
B1.2 Accessing Using BASIC
Table B1.3 lists the BASIC statements that can be used to access this module from a
BASIC CPU.
Table B1.3 Available BASIC Statements
Function
Syntax
Description
Declare use of
module
Example:
ASSIGN CX04=SL
SL : Slot number
Defines the mapping between module
and slot number.
Always execute this statement before
accessing this module. Execute this
statement in the main program.
Read data from
registers
Example:
ENTER SL, n NOFORMAT; I
or
ENTER SL NOFORMAT; I(*)
SL : Slot number
n : Data position number
I : Name of input variable for
storing read data
Reads data position number n of the
module installed in slot SL and stores it
in input variable I.
If the data position number is omitted,
reads data sequentially starting from
register 1 into input array variable I(*).
Write data to
registers
Example:
OUTPUT SL, n NOFORMAT;I
or
OUTPUT SL NOFORMAT;I(*)
SL : Slot number
n : Data position number
I : Output variable name storing
data to be written
Writes output variable I to data position
number n of the module installed in slot
SL.
If the data position number is omitted,
writes output array variable I(*)
sequentially to registers, starting at data
position number 1.
Read input
relays
Example:
STATUS SL,101; P
SL : Slot number
P : Name of variable for storing
read data
Reads input relays X01 to
X16 of the module installed in slot
number SL and stores the data in
variable P.
Interrupt
detection
Example:
ON INT SL,n GOTO {Label, etc.}
ON INT SL,n GOSUB {Label, etc.}
ON INT SL,n CALL {Subprogram}
SL : Slot number
n : Terminal number
The module generates an interrupt
when it detects an OFF→ON transition
of input relay for terminal number n of
the module installed in slot number SL.
Refer to the list of relays to find out
which relays support interrupts.
Using a BASIC statement not listed in Table B1.3 may produce unexpected results.
You must observe some precautions when writing to the module. For details, see Section
B1.3, “Reading and Writing after Powering On”.