ADS symbol group and offset don't match ADS info

1k views Asked by At

I'm trying to access data from a PLC input variable through an ADS Client using the variable's IndexGroup and IndexOffset. I used the SymbolLoaderFactory to get access to the symbol. With the symbol, I can use an ADS client to read it's data. But, I would like to read it's data through it's IndexGroup and IndexOffset. When I use the symbol's IndexGroup and IndexOffset, I cannot get the expected data. The IndexGroup and IndexOffset (and port) do not match what I see for the variable in TwinCAT. Why do they not match? How can I get the correct IndexGroup and IndexOffset so I can read the data correctly?

Additional Details: I created a PLC variable called MAIN.Input1. The ADS Info defined in TwinCAT is Port: 350, IGrp: 0x8502000, IOffs: 0x8005DFEA, Len: 1

Using the SymbolLoaderFactory (with client on port 851), the MAIN.Input1 symbol says it has an IndexGroup and IndexOffset of IGrp: 0x0000F020, IOffs: 0x0005DFEA

1

There are 1 answers

0
duchai On

You can try to declare a variable like this: nValueToRead AT %MW0 : UINT; and go instance -> Data Area and check for the index offset

If that is not what you want, you can check on this: https://www.plccoder.com/communicating-between-beckhoff-controllers-part-2-ads/ I hope this will help