Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create Multiple threads programmatically on CompactRIO RT Controller?

I'm guessing you're calling a non-reentrant VI inside your subvi.  You might have 20 parallel instances but they're all sharing a task.  To get Setpoint out of the VI server launched VIs, I'd use a functional global.  You're already writing an index to each instance, use that to index a write to a FGV array.  Maybe have a 2nd array of booleans in the FGV so you know when each instance has finished.  Have you tried the reentrant preallocation option?


--Using LV8.2, 8.6, 2009, 2012--
0 Kudos
Message 11 of 13
(2,149 Views)

Thanks for reply. Yes I have reentrant subvi in that subvi (both reentrant). You can think there is a 1ms wait function inside the second reentrant SubVI. And I want to run all SubVIs parallel so all will last 1ms.

In my last message I already mention that:

"So probably I should set the outputs in the subVI with the index number to a global variable.

But loop rate is problem here. When I dynamicaly load the SubVI, it increases my loop time compared to the left code."

 

Sorry maybe I couldn't explain it. But main problem is that I can't get the same loop rate when dynamically loading SubVI in for loop. Putting 20 SubVIs has better results. If there is no way to do it with same loop rate, I will go on my code with 20 SubVIs.

Thanks

0 Kudos
Message 12 of 13
(2,145 Views)

Hello, 

The tread is a bit old, i just wonder if you manager to solved your issue.

Best Regards

0 Kudos
Message 13 of 13
(497 Views)