UDP Receive: RECV instruction is used, ▬[ A RECV B ]▬
A: H3100 (fixed) | B: Result status |
A+1: UDP receive command (H0033) | B+1: Error code |
A+2: Socket number (1 to 12) |
|
A+3: Sender IP address (note 1) |
|
A+4: Ditto
A+5: Sender Port number
A+6: Receive data word size (1 to 1000)
A+7: Destination data table register type (note 2)
A+8: Destination data table register starting address
A+9: Timeout setting (0.1s units, see note 3)
Note 1: If sender IP address is 192.0.0.5 (HC0.0.0.5), set as follows. A+3 = H0005
A+4 = HC000
For broadcast receiving, set 0.0.0.0.
Note 2:
RW register = 3
D register = 4
Note 3: If A+9 = 0, there is no timeout.
Sample program
12544 = H3100
51 = H0033 Socket number = 2
Sender IP address = 192.0.0.5
Receive word size = 100
Destination data table is D2000 and after, no timeout setting
Page 7