Author Topic: OMRON FINS protocol question  (Read 1326 times)

Ecoli-557

  • Newbie
  • *
  • Posts: 25
    • View Profile
OMRON FINS protocol question
« on: May 21, 2018, 02:52:02 PM »
Hello All-
I have been trying to understand the exchange between AHMI and an Omron PLC.
I am using the 'y' beta version (Thanks Archie) but do not yet fully understand the packet structure and perhaps someone out there could help me in learning this.
Below is an abbreviated log file between a PC and an Omron unit runninf AHMI FINS serial communication:
 

               Unit#- HDR - Resp - ICF - RSV - GCT - DNA – DA1 – DA2 - SNA – SA1 – SA2 - SID - Command Code, Text                                                FCS - Terminator
            @   X X   F A    X     8 0   0 0   0 2   X X   X X   X X   0 0   0 0   0 0   X X       X X    ,  xxx-xxx                                             X X     * CR         
              (How is this packet broken down?  Where is SA2 and SID?  Where is a FC command?)
SEND TNS=1, 64 48 48  70 65  48   56 48  48 48 48 50 48 48 48 48 48 48 48 48 48 48 ? ?   ? ?     70 67 48 49 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49     48 65  42 13
            @   0  0  F A    0     8 0   0 0   0 2   0 0   0 0   0 0   0 0   0 0                 F  C  0  1  0  1  0  1  B  0  0  0  0  0  0  0  0  0  0  1      0  A   *  CR

RCVD TNS=1, 64 48 48 70 65 48 48 67 48 48 48 48 50 48 48 48 48 70 67 48 48 48 48 48 48 48 49 48 49 48 49 48 48 48 48 48 48 48 50 51 48 42 13

SEND TNS=2, 64 48 48  70 65  48   56 48 48 48 48 50 48 48 48 48 48 48 48 48 48 48  ? ?   ? ?     70 67 48 50 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49     48 57 42 13
            @   0  0  F A    0    8 0   0 0   0 2   0 0   0 0   0 0   0 0   0 0                  F  C  0  2  0  1  0  1  B  0  0  0  0  0  0  0  0  0  0  1      0  9  *  CR

RCVD TNS=2, 64 48 48 70 65 48 48 67 48 48 48 48 50 48 48 48 48 70 67 48 48 48 48 48 48 48 50 48 49 48 49 48 48 48 48 48 48 48 50 51 51 42 13

SEND TNS=3, 64 48 48  70 65  48   56 48 48 48 48 50 48 48 48 48 48 48 48 48 48 48  ? ?   ? ?     70 67 48 51 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49     48 56  42 13
            @  0  0   F A    0    8 0   0 0   0 2   0 0   0 0   0 0   0 0   0 0                  F  C  0  3  0  1  0  1  B  0  0  0  0  0  0  0  0  0  0  1      0  8   *  CR

RCVD TNS=3, 64 48 48 70 65 48 48 67 48 48 48 48 50 48 48 48 48 70 67 48 48 48 48 48 48 48 51 48 49 48 49 48 48 48 48 48 48 48 50 51 50 42 13

SEND TNS=4, 64 48 48  70 65  48   56 48 48 48 48 50   48 48   48 48   48 48  48 48   48 48   70 67 48 52 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49     48 70   42 13

RCVD TNS=4, 64 48 48 70 65 48 48 67 48 48 48 48 50 48 48 48 48 70 67 48 48 48 48 48 48 48 52 48 49 48 49 48 48 48 48 48 48 48 50 51 53 42 13

SEND TNS=5, 64 48 48 70 65  48    56 48 48 48 48 50 48 48 48 48 48 48 48 48 48 48  ? ?   ? ?     70 67 48 53 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49     48 69 42 13
            @  0  0  F A    0     8 0   0 0   0 2   0 0   0 0   0 0   0 0   0 0                  F  C  0  5  0  1  0  1  B  0  0  0  0  0  0  0  0  0  0  1      0  E  *  CR

RCVD TNS=5, 64 48 48 70 65 48 48 67 48 48 48 48 50 48 48 48 48 70 67 48 48 48 48 48 48 48 53 48 49 48 49 48 48 48 48 48 48 48 50 51 52 42 13
             

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: OMRON FINS protocol question
« Reply #1 on: May 21, 2018, 04:50:13 PM »

Ecoli-557

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: OMRON FINS protocol question
« Reply #2 on: May 21, 2018, 07:06:29 PM »
Yes, more than once.  However, I re-read it and think I know where I am confusing myself; the SA2 from AHMI is hex 70.  The SID coming from AHMI is hex 67.  I was getting confused according to many manuals, SA2 should either be 00 or 10-1F and not 70.
Which makes the command  '01-01' which is a memory area read.
The whole packet:
64 48 48 70 65 48 56 48 48 48 48 50 48 48 48 48 48 48 48 48 48 48 70 67 48 49 48 49 48 49 66 48 48 48 48 48 48 48 48 48 48 49 48 65 42 13

Now what I am getting tripped up in (Besides wondering why they mix decimal and hex) is the following:
SA2  SID  Cmmd Code (4b)  Mem Area   1st read addr   # of Elements    what are these used for?     FCS      Termination
70     67     48 49 48 49         48 49           66 48 48      48 48 48 48        48 48 48 48 49              48 65      42 13
70     67     0  1   0   1           0   1             B  0   0        0  0  0  0            0   0   0   0  1                   0  A        *  CR

I think I get the 1st part of this, don't really know what memory area is referenced by 01, nor where 1st read address is indicated by B00, I can see number of elements but why is it 0?
THEN, what are the left over bytes (00001) used for?
Where am I getting my packet structure screwed up?  It makes sense that I am cutting this up wrong cuz the '0001' just before the FCS should be the # of elements to read.......
I have read several of the programming manuals and this bit-twiddling and mix of dec-hex-ascii is a bit confusing....... 
I really am trying here....       

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: OMRON FINS protocol question
« Reply #3 on: May 21, 2018, 08:23:11 PM »
I think you are shifted in your interpretation because according to table 5-2-2 , B0 represents the CIO memory area

Ecoli-557

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: OMRON FINS protocol question
« Reply #4 on: May 21, 2018, 10:12:10 PM »
Dang!
If I am off by 1 byte, do I shift everything left 1 byte?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: OMRON FINS protocol question
« Reply #5 on: May 21, 2018, 10:46:12 PM »
Did you account for the Response Wait Time Byte that comes after "FA" as shown in 3-5-3

Ecoli-557

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: OMRON FINS protocol question
« Reply #6 on: May 21, 2018, 10:57:33 PM »
Archie, yes, thanks.  That would have shifted bytes to the right.  I need to find out where I have 1 byte too many which shifts to the right.
Its like I have added a byte too many in my packet map.....

Ecoli-557

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: OMRON FINS protocol question
« Reply #7 on: May 22, 2018, 11:47:12 AM »
OK, I am making progress, and again thanks Archie for taking time out of what must be an immense task to even read what I am trying to understand while you have everything else to do...... Really, thanks.
My current non-comprehension is in the decoding of the 'text' area in the FINS command.  See below:

   Pre   Unit#   HDR   Resp   ICF   RSV   GCT   DNA   DA1   DA2   SNA   SA1   SA2   SID   FINS cmmd    Text   FCS   Term
   @   XX   FA   X   80   00   02   XX   XX   XX   00   00   00   XX   XXXX      XX   * CR
Packet Data   48   48 48   70 65   48   56 48   48 48   48 50   48 48   48 48   48 48    48 48   48 48   70 67   48 49   48 49 48 49   66 48 48 48 48 48 48 48 48 48 48 49   48 65   42 13
Decoded   @   00   FA   0   80   00   02   00   00   00   00   00   FC   01   0101   66 48 | 48 48 48 48 48 48 48 48 48 49   0A   * CR
                                                B0 |  00 00 00 00 00 00 | 00 00 00 01      
                                                CIO area, 6 bytes for something, 2nd bit in the word      
                                                      


I see where I need to use words for the CIO area, but I don't know what to do with some of the bytes.  The low-order 4 bytes points to 0001 which is the 2nd bit (0 being used).  B0 is the CIO area and I must use word notation.  Are the 6 bytes in the middle, do these represent the 6 possible words in the Input or an Output module?
If so, THAT would make sense.
So, this packet would say 'read the 2nd bit in the 1st word of the 1st module' - yes?