LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Dereferencing timer eventData

Solved!
Go to solution

I'm trying to access a timer's time since last tick. According to this article, this can be done by using eventData2: "eventData2 is a pointer to a double that represents the time elapsed since the last EVENT_TIMER_TICK, in seconds." However, the auto-generated callback prototype has it listed as an int instead of a pointer to a double. From what I can tell, this int seems like it could represent the pointer to double, as its value looks like an address (1703072).

 

Nonetheless, I can't simply dereference it because the compiler treats it as an int. I tried to rewrite the callback prototype, but I got an error in LoadPanel, which looks to me like the rest of the code intends to treat it like an int as well. Am I understanding this correctly and is there a workaround?

0 Kudos
Message 1 of 2
(912 Views)
Solution
Accepted by topic author csulliva

This works:

 

double	et
et = *(double *)eventData2;

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(890 Views)