Publication 1766-RM001A-EN-P - October 2008
496
Socket Interface Using CIP Generic Messaging
Configure the MSG with these values:
•
Timeout : Specify the timeout in milliseconds.
•
DestAddr Length : The length of the destination address.
CIP Generic Msg Parameter
Description
Channel
1 (Integral)
Communication Command
CIP Generic
Service
Custom
Service Code
4C (hexadecimal)
Class
342 (hexadecimal)
Instance
0 Use a relay ladder instruction to move the returned
instance number from a CreateSocket service into the
MGx:y.TFN element of a MSG instruction.
Attribute
0
Data Table Address (Send)
Specify N file
Size in Bytes (Send)
8 + n (number of characters in the destination address)
bytes
Data Table Address (Receive)
Not used. The MSG instruction does not return any
data.
Size in Bytes (Receive)
0 bytes
Extended Routing Info File(RIX)
Specify RIX file
To Address in MultiHop tab
127.0.0.1
Considerations :
In some cases, the OpenConnection service can return before the timeout period without
creating a TCP connection. For example, if the destination device is running, but is not listening
for connections on the specified port number, OpenConnection returns with an error before the
timeout period.
For UDP, if you use OpenConnection, you do not have to specify the IP address and port number
each time you send data. If you do not specify an IP address and port number, you can only
receive data from the previously specified IP address and port number in the OpenConnection
service.
For UDP, if you do not use OpenConnection, you must specify the destination address each time
you call the Write service to send data. When you call the Read service, in addition to the data,
you receive the address of the sender. You can then use the address of the sender to send a
response via the Write service.
N file for sending contains: 8 bytes + n bytes
Nx:0, Nx:1
Nx:2
Nx:3
Nx:4…
Timeout
(4 bytes)
DestAddr
Length
(2 bytes)
DestAddr
Reserved
(2 bytes)
DestAddr
Data
(n bytes, max 64 bytes)
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive