Using Socket Services with CMND(490)

Section 6-8

Continued from previous page.

 

 

000002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

@RSET

 

 

 

 

 

 

 

000102

 

 

 

 

 

 

 

@SET

 

 

 

 

 

 

 

000202

000002

000202

 

A20200

 

 

 

 

 

 

 

 

 

CMND(490)

 

 

 

 

 

 

 

D02000

 

 

 

 

 

 

 

D03000

 

 

 

 

 

 

 

D00020

 

 

 

 

 

 

 

RSET

 

 

 

 

 

 

 

000202

000002

000202

 

A20200

150902

150914

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

000102

 

 

 

 

 

 

<>(305)

 

 

 

 

 

 

 

D03010

 

 

 

 

 

 

 

#0000

 

 

 

 

 

 

 

A21900

 

000002

000202

 

A20200

150902

 

 

 

 

 

 

 

 

 

RSET

 

 

 

 

 

 

 

000002

000003

 

 

 

 

 

 

 

 

 

 

 

 

 

 

@RSET

 

 

 

 

 

 

 

000103

 

150913

 

 

 

 

 

 

 

 

 

 

=(300)

@SET

 

 

 

 

 

 

D30001

000203

000003

000203

A20200

&100

 

 

 

 

 

 

 

 

 

 

CMND(490)

 

 

 

 

 

 

 

D04000

 

 

 

 

 

 

 

D04010

 

 

 

 

 

 

 

D00030

 

 

 

 

 

 

 

RSET

 

 

 

 

 

 

 

000203

000003

000203

A20200

150901

150914

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

000103

 

 

 

 

 

 

<>(305)

 

 

 

 

 

 

 

D04020

 

 

 

 

 

 

 

#0000

 

 

 

 

 

 

 

A21900

 

000003

000203

 

A20200

150901

 

 

 

 

 

 

 

 

 

RSET

 

 

 

 

 

 

 

000003

 

 

 

 

 

 

 

END(001)

TCP Send

When the TCP Send Bit (CIO 000002) turns ON, the TCP Send Error Flag (CIO 000102) is turned OFF and the TCP Sending Flag (CIO 000202) is turned ON to initialize processing.

When the TCP Sending Flag (CIO 000202) turns ON, the status of the Port Enabled Flag (A20200) is checked to be sure it is ON and a TCP SEND REQUEST com- mand is sent using CMND(490).

D02000: First command word

D03000: First response word

D00020: First control data word

The TCP Sending Flag (CIO 000202) is also turned OFF.

If the Port Enabled Flag (A20200) turns ON and the Sending Flag (CIO 150902) turns OFF while the TCP Sending Flag (CIO 000202) is OFF, checks are made and if any of the following are true, the TCP Send Error Flag (CIO 000102) is turned ON.

The Results Storage Error Flag (CIO 150914) is ON.

The contents of the Response Storage Area set in the command code (D03010) is not 0000 Hex (normal end).

The Network Communications Error Flag (A21900) is ON.

After the execution results have been checked, the TCP Send Bit (CIO 000002) is turned OFF.

TCP Receive

When the TCP Receive Bit (CIO 000003) turns ON, the TCP Receive Error Flag (CIO 000103) is turned OFF. The contents of the reception buffer, and the status of the TCP Data Received/Requested Flag (CIO 150913), and the Number of Bytes Received at TCP Socket (D30001) are checked. If the data is stored in the buffer, the TCP Receiving Flag (CIO 000203) turns ON.

When the TCP Receiving Flag (CIO 000203) turns ON, the status of the Port Enabled Flag (A20200) is checked to be sure it is ON and a TCP RECEIVE REQUEST command is sent using CMND(490).

D04000: First command word

D04010: First response word

D00030: First control data word

The TCP Receiving Flag (CIO 000203) is also turned OFF.

If the Port Enabled Flag (A20200) turns ON and the Re- ceiving Flag (CIO 150901) turns OFF while the TCP Re- ceiving Flag (CIO 000203) is OFF, checks are made and if any of the following are true, the TCP Receive Error Flag (CIO 000103) is turned ON.

The Results Storage Error Flag (CIO 150914) is ON.

The contents of the Response Storage Area set in the command code (D04020) is not 0000 Hex (normal end).

The Network Communications Error Flag (A21900) is ON.

After the execution results have been checked, the TCP Receive Bit (CIO 000003) is turned OFF.

Note When using the above programming example, change the bit and word addresses as necessary to avoid using the same areas used by other parts of the user program or the CPU Bus Unit.

148

Page 172
Image 172
Omron CJ1W-ETN21 operation manual 148