05-13-2014 10:03 AM - edited 05-13-2014 10:03 AM
Hello.
I want to simulate a timer interrupt. For this purpose I have two parallel while loops.
The first one has an event structure.
The second one has an "Elapsed Time" vi.
I am feeding the "Time has elapsed" output of the "Elapsed Time' vi in the events that trigger the event structure but it does not seem to work.
Please see the attached vi.
Any suggestions?
Thank you very much.
Vasilis.
Solved! Go to Solution.
05-13-2014 10:50 AM
Hello Vakost,
The easiest way to do a timer you can interupt is to build a FGV. You can also use a producer / consumer loop with queues.
BR
Vincent
05-14-2014 12:51 AM
Hello.
So, the reason that this vi is not working is because the Time has elapsed is not a global variable and it cannot feed the event structure?
I don't exactly understand, I am confused :(.
Thanks,
Vasileios.
05-14-2014 01:12 AM - edited 05-14-2014 01:12 AM
03-28-2017 12:53 PM
Hi,
Where can I found the "Create Timer Interrupt VI" on the Labview palette?
http://zone.ni.com/reference/en-XX/help/373925B-01/myrioreference/myrioref_create_timer_irq/#Input1
Thanks
Hamid
03-28-2017 01:03 PM
03-28-2017 01:06 PM
Thank you GerdW,
If I can call a VI by PC timer interrupt then it should be very accurate timming. I've already used the PC timer interrupt in the C programing to do a task every 1ms, but I'm not sure that VI can do that? Also, I couldn't find the "Create Timer Interrupt VI" on the Labview palette. I installed the Rio toolkit too. It's on the help file, but once I click on the find it on the palette then it pops up an error.
03-28-2017 01:15 PM - edited 03-28-2017 01:16 PM
Hi Hamid,
If I can call a VI by PC timer interrupt then it should be very accurate timming. I've already used the PC timer interrupt in the C programing to do a task every 1ms, but I'm not sure that VI can do that?
Generic answer: Use a timed while loop…
Detailed answer: on a Windows PC the OS/taskmanager is determining, which program will currently run and for how long it will run. You will not get an accurate 1ms execution order in your VI. Use a simple while loop with a 1ms wait in it…
Also, I couldn't find the "Create Timer Interrupt VI" on the Labview palette. I installed the Rio toolkit too. It's on the help file, but once I click on the find it on the palette then it pops up an error.
Some functions are filtered according to the target they can run on.
Examples:
- On FPGA many functions from standard palettes are missing.
- You can use Watchdog functions on RIO targets, but not on Windows PC.
I guess this InterruptTimer is also very platform-specific and only available on your myRIO.
Btw. WHICH error do you get?
03-29-2017 06:11 AM
Thank you GerdW, I got it.
04-18-2017 12:12 PM
I could make my GUI to be almost real-time. It's sending the messages every 20ms and very rarely every 21 ms. This webpage could help me:
https://www.winemantech.com/blog/the-ui-thread-roo
Also, I used a "Timed Loop" instead of while loop for sending the periodic message to the interface( with setting of high priority and 1kHz absolutetime and dt=0.0002 or 0 )
Also, calling the dlls should be set on "Run in any thread"