4:11 pm
February 10, 2018
Hello,
I have ported some Arduino libraries to LabVIEW, but i have still some problems. One example: I create a timer-instance (my Arduino library) in the mainVI. Later i want to read out the timer value inside a subVI, so i need to refer to the timer instance that i previously created in the mainVI. In that situation the arduino compiler reports me that i want to call methods of an instance (inside the SubVI) that do not exist. If i put the code from the subVI into my mainVI everything works fine. What is the best way to handle this problem, because i don‘t want to put all the code inside my mainVI for reasons of clarity?
Another question:
I want to use an interrupt handling library in LabVIEW. Some functions of this library needs a callback-function as argument. How can i use this library in LabVIEW?
Thanks for your help and i am sorry for my bad english.
Manuel
5:39 am
March 12, 2015
Without seeing your library it is tough to see what you are trying to do but what you generally need to do is create your timer object dynamically in something like an Initialize VI which you pass in and index. That index is used in your subVIs to reference the index of the timer object. You would need to create a global variable which holds a pointer to the object. I believe the Servo addon referenced here may be exactly what you are trying to do. Take a look at it.
https://www.geverywhere.com/for.....-instance/
As far as interrupts, they are already natively supported in the Compiler. There is a timer interrupt and GPIO interrupt example that show how to implement callbacks. Take a look at the included examples under "Interrupts".
10:06 am
February 10, 2018
Hi, thank you. I had to use a global variable, to refer on my instance inside the sub-vi, now it works.
Another question, i have a function like that, it needs a callback-function as input.
How can i connect the callback-function to an callback-vi (onButtonChange)?
How do i have to create the Arduino Library Wrapper in LabVIEW?
Thanks, Manuel!
button.setCallback(onButtonChange);
22
1 Guest(s)