MITSUBISHI ELECTRIC T-60 User Manual

Page 103

Advertising
background image

Syntax:

CALL PLCINIT(id,cmd)

Comments:

id

specifies the address of the FX - always use 1.

cmd

specifies the communications mode:

1 - RS422, COM1 - most common and recommended.
2 - RS422, COM2 - T-61 only
3 - RS232 COM 1 - Must use an RS232 to RS422 adapter
4 - RS232 COM 2 - Must use an RS232 to RS422 adapter

Examples:

10 CALL PLCINIT(1,1)
Establish communications with the PLC via the T-60 Series COM 1 RS422
Port.

CALL PLCREAD Statement

Purpose:

This command is used to read the value(s) in a PLC’s registers, the status of
bits, or any other accessible memory location within the PLC.

Syntax:

CALL PLCREAD(id,cmd,start address,# of
registers/bits,variable/array

)

Comments:

id

specifies the address of the FX - always use 1.

cmd

specifies the read operation you wish to perform. See the table below

for the read operation possibilities:

start address

is the starting address of the bit(s) or register(s) you are

interested in reading. Inputs and Outputs (data types X and Y) are specified
in OCTAL just like you would specify in the PLC ladder logic program. The
type specified for this parameter if a variable is to be used is an integer: %.

# of registers/bits

is the number of consecutive registers, memory locations,

or bits that you wish to read. If you wish to read one bit or register, set this
parameter to 1. If you wish to read more than one register or memory
location at a time, this number will be the number of consecutive registers or

locations you wish to read. If you are reading the status of more than one I/O
bit, this number will be the number of consecutive bits you wish to read.

variable/array

is the variable name or array name where you wish to store

the data you are reading. If you are reading only one register or bit, you may
use any variable type you wish. If you are reading multiple registers or more

PLC Interface Commands PLC Specific Information

95

Advertising