01-25-2021 04:46 PM - edited 01-25-2021 04:57 PM
Hi Application Engineers,
I built a SubVi that takes N consecutive points of running data in sequence, namely Get sequence VI. There is a 2D array that contains X and Y data points. I wanted to get sequences of X and Y separately by calling the Get sequence VI using X and Y value separately in parallel in a loop, however, I got mixed data of X and Y from using either X or Y data.
Then I saved the same SubVi with different names, Get sequence A and Get sequence B, then call Get sequence A using X data and call Get sequence B using Y data, both calls worked properly.
The main VI is Two Calls for the same SubVi
I want to know how to make the Get sequence VI independent to different calls?
I use LabView 2015.
Regards,
Gu
Solved! Go to Solution.
01-25-2021 06:28 PM - edited 01-25-2021 06:40 PM
If each subVI instance should be an independent clone, make it reentrant.
(VI properties...execution...preallocated clone reentrant execution)
(Btw, it is really annoying if all VIs are maximized to the screen. How can you get any work done?)
What is the logic behind creating these huge mostly redundant data structures.? Seems quite pointless. What are you actually trying to do with all this?
01-25-2021 06:55 PM
Hi Altenbach,
Thank you for your prompt reply. I got it.
Could you please let me know the rule of execution priority setting? I read through NI web about the priority setting, but confused between main VI and SubVI. There are a few SubVis in a main VI. I like to make the computer to run the main VI without other apps interruption or make the computer dedicated for running tests efficiently. Should I set all SubVis and the main Vi the time critical (the highest priority)?
Regards,
Gu
01-25-2021 07:16 PM
Hi Altenbach,
Yes, the sample code does not have any meaning, however, it is related to my another post,
How to detect peaks on a curve
https://forums.ni.com/t5/LabVIEW/How-to-detect-peaks-on-a-curve/m-p/4114980#M1186896
The point-by-point peak detector VI outputs a "True" when a peak is found. I realize that it stops at the center of each peak rather than at the end of each full peak. I found it by change the for loop to a conditional loop and set the loop to stop when the first peak is found. The problem is that the ramp pattern VI can not work properly. The ramp includes the first half peak rather than its base.
To solve the problem, I used the N points running sequence for iteration to pass the peak center and covers a whole peak for the subsequent ramp pattern Vi to work properly, and then go back to get the center point (or the peak position).
Regards,
Gu
01-25-2021 07:37 PM - edited 01-25-2021 07:39 PM
@edmonton wrote:
Should I set all SubVis and the main Vi the time critical (the highest priority)?
NO!!!! Don't overthink this. Leave all priority settings at normal. LabVIEW is fully capable to perfectly manage multitasking for you.
(time critical priority is actually very dangerous because things like the user interface will get deprioritized, meaning that your program will react very sluggishly to user interactions and things won't update in time)