Repository navigation
Arrays of Structures #458
Unanswered
dakotahorstman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am attempting to receive data change notifications of an array of structures. I've successfully implemented this using some nifty interpretation of the incoming data, but I was wondering if there was a native way to do this with a function or implementation via the library? I took a look at the docs and while I saw the
TowerEventexample under the connections page, I found documentation of this rather lacking.Here's my code:
And example output:
[0] OrderedDict({'bFirstBool': True, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [1] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [2] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [3] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [4] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [5] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [6] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 1}) [7] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [8] OrderedDict({'bFirstBool': True, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [9] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [10] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [11] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [12] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [13] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [14] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0}) [15] OrderedDict({'bFirstBool': False, 'nSecondInt': 0, 'fFirstReal': 0.0, 'eFirstEnum': 0})(Also, yes, the
eFirstEnumis an enum in TC3. Seems to work just fine!)If there isn't a native solution, I thought I'd provide this anyway to maybe kick start a PR. I'd love to myself, but I do not know enough about the library or ADS protocol in general to ensure proper implementation.
Thank you!
All reactions