MITSUBISHI ELECTRIC T-60 User Manual

Page 99

Advertising
background image

Syntax:

CALL PLCINIT(id,cmd)

Comments:

id

specifies the address of the PLC that you wish to initialize. For the

FA-1J and FA-2J series PLC, this number will always be 1.

cmd

specifies the type of PLC protocol that you are initiating :

1 - FA-1J on com port 1

2 - FA-2J on com port 1

3 - FA-1J on com port 2

4 - FA-2J on com port 2

Examples:

10 CALL PLCINIT(1,1)

Establishes communication with the Idec FA-1J on communications port 1.

10 CALL PLCINIT(1,4)
Establishes communication with the Idec FA-2J on communications port 4.

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,# ofregisters/bits,variable/array)

Comments:

id

specifies the address of the IDEC - always use 1.

cmd

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

Available Commands

for the read operation possibilities:

address - describes where in memory the value is to be read from

count -

number of bits to be read ( when using command of size WORD this

will be a 1 )

variable/number -

this is the variable or number that is to be written in

memory in the case of a the variable that will store the value being read

Examples
CALL PLCREAD( 1, 9, 400, 13, a%)

Starting at address 400 in the internal relays of the Idec, this command will
instruct the PLC to read the first 13 bits and store the result into a%.

PLC Interface Commands PLC Specific Information

91

Advertising