-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AdsNotificationHeader has nTimeStamp & nNotification backwards #12
Comments
This changes the ordering of nTimeStamp and nNofiication fields for the AdsNotificationHeader. See [Beckhoff/ADS Beckhoff#12](Beckhoff#12) This now conforms to both the [TwinCAT 2 documentation](http://infosys.beckhoff.de/english.php?content=../content/1033/tcadsdll2/html/tcadsdll_strucadsnotificationheader.htm&id=21585) and the [TwinCAT 3 documentation](http://infosys.beckhoff.de/english.php?content=../content/1033/tc3_adsdll2/html/tcadsdll_strucadsnotificationheader.htm&id=16945)
Our TcAdsDll.dll for Windows OSs differs to our OpenSource AdsLib to provide a wider range of architecture support. Please use the structure information of our AdsLib. |
OK. But how does that change the structure order of the binary data coming over the wire? In my experiment, talking to a CX9020, accessing the nTimeStamp using your unmodified structure ordering, shows it never changing. If I flip it around, it actually changed and is decoded as an actual timestamp. Therefore, the order of the two fields in this specific structure is wrong and needs to be flipped around. Or are you saying, that it doesn't matter? How does producing a library that can be used on Linux as well as Windows magically change the binary protocol? |
Check if you use the AdsLib with the related header and NOT the TcAdsDll. |
I am using the related header file from this project on a Linux machine accessing a CX9020. The CX9020 was programmed using the stock TwinCAT 3 development environment. So I am assuming that the stock TwinCAT 3 is using the TcAdsDll on the PLC itself while I am using this library on the Linux side. Thus the difference in the binary protocol structure mismatch on the wire. |
I think we have a misunderstanding here. The AdsNotificationHeader is never send on the wire. It is only used to share data between your application and the AdsLib. Please check that you rebuild your application and the AdsLib with the same version of the header and if the issue still persists, give us more details on your specific setup. |
This might be the phenomenon reported by tdjordan with issue #12
In AdsDef.h at line 287,
nTimeStamp and hNotification are in the wrong order.
My reference for this is from these two places.
The text was updated successfully, but these errors were encountered: