Download  Print this page

Mitsubishi Electric FX5 User Manual Page 77

Melsec iq-f series, ethernet communication.
Hide thumbs

Advertisement

■Sample program
<<Connection No.1 open processing (Active)>>
M1000
SD10680.0
SD10681.0
M100
M101
M101
<<Data send processing>>
M3000
SD10680.0
M300
M301
M301
<<Data receive processing>>
SD10680.0 SD10682.0
M500
M500
M501
M501
<<Connection No.1 close processing>>
SD10680.0 SD10681.0
M4000
SD10680.0
M4004
M4001
M200
M201
M201
■Precautions for Active open communication
Configure an interlock circuit using the Open completion signal (SD10680.n) and Open request signal (SD10681.n) in the
program.
The following chart shows on/off timings of the Open completion signal and Open request signal.
Open completion signal (SD10680.n)
Open request signal (SD10681.n)
SP.SOCOPEN
SP.SOCSND
"U0"
SP.SOCRCV
"U0"
SP.SOCCLOSE "U0"
<<When cut from the CPU module>>
ON
OFF
ON
OFF
SOCOPEN instruction
....
<<When disconnected by the target device>>
....
Set execution type/completion type to 0
MOVP
H0
D100
"U0"
K1
D100
M100
Execute connection 1 open
Normal completion indication
SET
M1002
Error completion indication
SET
M1003
Set length of the data to be sent
MOVP
K6
D300
MOVP
H3412 D301
Set the data to be sent
MOVP
H7856 D302
MOVP
H0BC9A D303
Sending data to connection 1
K1
D3000
D300
M300
Normal completion indication
SET
M3002
Error completion indication
SET
M3003
Receiving data
K1
D5000
D500
M500
SET
M5002
Normal completion indication
Error completion indication
SET
M5003
PLS
M4001
Processing for disconnection from target device
K1
D200
M200
Close Connection 1
Set the closing flag
SET
M4004
Normal completion indication
SET
M4002
SET
M4003
Error completion indication
Reset the closing flag
RST
M4004
END
TCP disconnection completed upon the response from the target device
TCP disconnection request from the CPU module
SOCCLOSE instruction
TCP disconnection request from the target device
TCP disconnection completed upon the response from the CPU module
SOCCLOSE instruction
7 SOCKET COMMUNICATION FUNCTION
7.1 Communication Using TCP
7
75

Advertisement

Table of Contents

Comments to this Manuals

Symbols: 0
Latest comments: