FINS(Factory Intelligent Network Services) is a protocol used by Omron plcs. This protocol allows the plc to communicate with other plcs, external devices, and PCs.
Most commonly, this protocol is used to communicate over Ethernet. In that case, we can use FINS/UDP or FINS/TCP. Basically, if we're using Ethernet to talk directly to other plcs on the same segment we'd want to use FINS/UDP. Otherwise, FINS/TCP offers better communications quality and should be used. (That's a generalized view...) The protocol can also be used over their HostLink protocol. When used
in this way, however, we are usually directly connected via our pc.
When FINS is used over Ethernet we can have up to 254 devices and our message length is limited to 2012 bytes... although that can be a large message.
When using FINS via HostLink we can have up to 1 device connected via rs-232 or up to 32 devices via rs-422. In this case our maximum message size is held back to 542 bytes.
FINS works by using a command/response type system. In other words, we send a command and wait for a response. Simple theory... right? Well we can also send commands such that a reply is not needed. Or we can send a broadcast message to all devices connected. So, it's flexible.
How do we know which device should get the message when a bunch are connected? Simple, we give each one an address. Then we send the command to that address and the other devices will ignore it. (If we send to the address FF we are broadcasting a message to all connected devices)
So, how do we talk to the plcs then? Well if we're using Ethernet we simply bury the message into the TCP or UDP message. And if we're using HostLink we bury the message in there. Confusing? Then look a this:
For FINS/TCP the packet of data flowing would look like-
IP-TCP-FINS/TCP Header-FINS message-FCS
We took a standard TCP packet(ie message) and put the FINS data into the section that requires data. Simple.
The same would be true for UDP or HostLink. We replace the data
section with the FINS data.
What do the actual messages look like? Let's see the Ethernet commands first...
For the commands we use the format: header-command code-message The header contains:
ICF-RSV-GCT-DNA-DA1-DA2-SNA-SA1-SA2-SID
ICF - Information Control Field - This field describes if we are expecting a response, what type of data, and if we're using a 'gateway'.
in this way, however, we are usually directly connected via our pc.
When FINS is used over Ethernet we can have up to 254 devices and our message length is limited to 2012 bytes... although that can be a large message.
When using FINS via HostLink we can have up to 1 device connected via rs-232 or up to 32 devices via rs-422. In this case our maximum message size is held back to 542 bytes.
FINS works by using a command/response type system. In other words, we send a command and wait for a response. Simple theory... right? Well we can also send commands such that a reply is not needed. Or we can send a broadcast message to all devices connected. So, it's flexible.
How do we know which device should get the message when a bunch are connected? Simple, we give each one an address. Then we send the command to that address and the other devices will ignore it. (If we send to the address FF we are broadcasting a message to all connected devices)
So, how do we talk to the plcs then? Well if we're using Ethernet we simply bury the message into the TCP or UDP message. And if we're using HostLink we bury the message in there. Confusing? Then look a this:
For FINS/TCP the packet of data flowing would look like-
IP-TCP-FINS/TCP Header-FINS message-FCS
We took a standard TCP packet(ie message) and put the FINS data into the section that requires data. Simple.
The same would be true for UDP or HostLink. We replace the data
section with the FINS data.
What do the actual messages look like? Let's see the Ethernet commands first...
For the commands we use the format: header-command code-message The header contains:
ICF-RSV-GCT-DNA-DA1-DA2-SNA-SA1-SA2-SID
ICF - Information Control Field - This field describes if we are expecting a response, what type of data, and if we're using a 'gateway'.
RSV - Reserved - This is always 00
GCT - Gateway count - This is the maximum number of gateways allowed.
DNA - Destination Network Address
DA1 - Destination device Address
DA2 - Destination unit Address
SNA - Source Network Address
SA1 - Source device Address
SA2 - Source unit Address
SID - Service ID - This is the identity of the process it came from in
a large configuration. Make it any hex number from 00-FF.
When using HostLink the commands look slightly different. Not really different but we need to use certain specific values in certain places. The format is the same but...
We start the header with FA.
ICF - Always 80
RSV - Always 00
GCT - Always 02
DNA - 00-7F hexadecimal number which corresponds to address from 0-127
DA1 - 01-3E hexadecimal node number
DA2 - 00 would indicate it's the CPU
SNA - Always 00
SA1 - Always 00
SA2 - Always set to FC
SID - Used as a counter when data is resent. Usually should be set to
00 initially.
Well that's a very rough (and I do mean rough) overview of what happens with FINS. It is most commonly used over Ethernet to help the plcs communicate across the network. If you're using Ethernet and Omron devices you should really know the basics of the above to further understand what's going on 'under the surface'.
No comments:
Post a Comment