How to retrieve tag values in a Read Complete event callback?
See original GitHub issueWhen using the Async Read Complete event callback. What is the best way to get the value returned?
With the code below, the object being passed is of type NativeTagWrapper and doesn’t seem to expose a value attribute. TagEventArgs is only returning “Ok” for status.
var testTag = new Tag<DintPlcMapper, int>
{
Gateway = plc.IPAddress,
Path = plc.Path,
PlcType = PlcType.ControlLogix,
Protocol = Protocol.ab_eip,
Name = "testDINT"
};
testTag.ReadCompleted += TestTag_ReadCompleted;
testTag.InitializeAsync();
testTag.ReadAsync();
await Task.Delay(10000);
void TestTag_ReadCompleted(object? sender, TagEventArgs e) { Console.WriteLine($Read Completed"); }
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
How to get returned values from my listener's callback ES6 ...
1. var results = softwaresSearch. · 1. The maxwell function will be called when the user releases a key while typing into the...
Read more >Returning data from a Reg Event Callback to the calling VI
I'm not too familiar with event callbacks but I believe you can do this by passing a queue/user event reference into the 'User...
Read more >R: XML Event/Callback element-wise Parser
This reads and processes the contents of an XML file or string by invoking user-level functions associated with different components of the XML...
Read more >EventTarget: addEventListener() method - Web APIs | MDN
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered ...
Read more >JavaScript Callback Functions – What are Callbacks in JS ...
So here we select the button first with its id, and then we add an event listener with the addEventListener method. It takes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@timyhac , I tested this change, and it works as expected. Thanks again for your help!
Wow, thank you @timyhac ! I’ll give this a try later today.