MITSUBISHI ELECTRIC T-60 User Manual
Page 110
variable/array
is the variable name or array name where you wish to store
the data you are writing. If you are writing only one register or bit, you may
use any variable type you wish. If you are writing multiple registers, this
variable can either be a short integer (%) array variable or a constant (like
1234). If you are writing registers or memory locations that are stored as
words and the # of registers/bits is greater than one, this will be a short
integer array (make sure you properly dimension the array prior to using it).
If you are writing the status of more than one, but less than 16 I/O bits, you
will be writing one word, and therefore will need to use a single short integer.
Remember, any time you are writing more than one register you must use a
dimensioned short integer array.
Examples:
10 CALL PLCWRITE(1,15,1,2,3)
This command writes a 1 to register 15 bits 1 and 2. Note that 3 represents
the binary “11" which is the bit pattern desired.
10 DIM newdat%(10)
20 CALL PLCWRITE(1,5,,2,newdat%(4))
This command writes the value of newdat%(4) to register 5 and newdat%(5)
to register 6 in a PLC with an id (address) = 1.
10 CALL PLCWRITE(1,100,,1,1234)
Note that you cannot write to multiple locations with the same data (i.e.
CALL PLCWRITE(1,100,,10,1234) - this will generate a “VARIABLE
REQUIRED” BASIC error). This operation must be performed by initializing
elements of a dimensioned array and writing the array in the following
fashion:
10 DIM A%(16)
20 FOR N=1 TO 16: A%(N)=1234: NEXT
30 CALL PLCWRITE(1,100,,10,
This command writes 1234 to register 100.
T-60 Operator's Manual
102