Hi all,
Thank you all for your help and particulary "Photovoltaic"
I downloaded Etherway from the omron Website and I'm now able to communicate with this PLC.
For those who are interested, here is the procedure to read and write data
1) Send a connection request
This request should only be sent once after connecting the "socket".
Never renew this request until the "socket" has been disconnected.
Keep the server node that is returned as well as the client node. These two values will be used subsequently in all exchanges.
Frame to send (always the same)
46,49,4E,53 : HEADER (FINS)
00,00,00,0C : Length(12)
00,00,00,00 : Command (0)
00,00,00,00 : Error code (0)
00,00,00,00 : Client node Add (0=auto)
Response
46,49,4E,53 : ‘FINS’
00,00,00,10 : Length(16)
00,00,00,01 : Command (1)
00,00,00,00 : Error code (0)
00,00,00,FB : Client node (251)
00,00,00,0F : Server node (15)
--> Keep Client node et Server node.
2) Reading and writing memory area
First frame to send
46,49,4E,53 : ‘FINS’
00,00,00,1A : Length = 8 for the header + 18 for the following frame, depends of the cases a), b) or c)
00,00,00,02 : Command (2)
00,00,00,00 : Error code (0)
--> Do not wait for a reply to this message - This message must be sent in a separate frame.
Second frame to send
80,00,02,00 : ICF + RSV + GCT + DNA
0F : DA1-FINS node address of Ethernet unit (Server node=15)
00 : DA2-Destination machine address (0=PLC Main unit-CPU)
00 : SNA-Source FINS network address (0)
FB : SA1-FINS node address on the PC side (Client node=251)
00 : SA2-Source FINS network address
01 : SID-any data from the source process identifier
Then add one of the following specific frames :
a) To read a WORD in the area D at address 10 for 10 words, add :
01,01 : MRC,SRC-FINS command code 0101: Read memory areas
82 : Memory area code=Variable type: DM (Dxxxxx)
00,0A,00 : Read start address on 3 bytes (10)
00,10 : count
b) Or to read the BIT 10 at address CIO 2781 (0ADD) for 1 bit
01,01 : MRC,SRC-FINS command code 0101: Read memory areas
30 : Memory area
0A,DD,0A : Read start address + bit 10 (0A)
00,01 : count
c) Or to write n bits, add
01,02 : MRC,SRC-FINS command code 0102: Write memory areas
00 : memory area code (00=CIO)
00,64 : Start address (ex: 100)
00 : Start bit number
00,03 : Number of words to write
00,01,01 : Data to write