06-30-2010 04:46 PM
Hi Everyone,
I've got a problem that i cannot imagine would be unique and maybe has an obvious solution that I am overlooking. Anyways, i have a class containing an array of a separate class lets call device. in the device class there is a method (vi) to do a performance test on the device. What i need to do is stress all the devices at the same time by continuously running those performance tests on them simultaneously but not more than one on each device. essentially id like to dynamically create threads running the performance test over and over on each device. I'm having trouble finding a solution in labview for this. Does anyone have any good ideas?
If there was a way to tunnel the array into a for loop and just get the method's going but then that would mean each iteration would start all at the same time which can't be done.
i attached a picture of what it would look like if i had 4 going but i would like to be able to dynamically generate each System Exec.vi running simultaneously. I hope i described this problem well enough!
thanks in advance
Brent Schenk
Solved! Go to Solution.
06-30-2010 09:48 PM
Brent-
You are still trying to enforce a text language paradigm on a data flow language paradigm.
WOW
please- I just read through your ealier posts- I REALLY LIKE most of your thought processes BUT....
A LabVIEW function will execute when its inputs are valid. (Period - not "semi-colon" - get it?)
DATA FLOW! sorry to yell but, it does make a differance.
07-01-2010 09:59 AM
Jeff,
while i appreciate some of your input i am very aware that i am using a dataflow language. I know i can dynamically get these processes running through the invoke node by passing a reference to a subvi and make sure that that VI doesnt have reentrant so that each instance of that VI gets its own memory space (Viola ive got the devices getting stressed but with no data flow and not a very good way of obtaining the data they get besides using external methods ie: writing to files). But i want to be able to do this while making sure that i use the dataflow "paradigm" as you say. As you're 'about me' states "I enjoy helping new users develop better style and deeper understanding of the LabVIEW IDE" lets figure out a better style together than what i just described.
best regards
Brent
07-01-2010 12:12 PM
@BrentSchenk wrote:
Hi Everyone,
...What i need to do is stress all the devices at the same time by continuously running those performance tests on them simultaneously but not more than one on each device. essentially id like to dynamically create threads running the performance test over and over on each device. I'm having trouble finding a solution in labview for this. Does anyone have any good ideas?...
Here is a screen shot of a VI I use to launch an instances of the a VI without blocking the main program (each call to Run CAN Loop.vi starts the CAN Loop.vi and returns). In my case, each VI handles one station on an N-station test stand and communicates with the rest of the program via queues and events. This is a bit overkill for many applications, but it works well in mine where the number of stations is determined at run-time, and each station may be controlled by a different class (also determined at run-time and configurable while the program is running!).
Mark Moss
Electrical Validation Engineer
GHSP
07-15-2010 11:11 AM
Hi Mark,
that helped me out quite a bit in getting instances of the VI to run. Do you have a way of getting the outputs of the VI through those means as well? the only method i have come up with was to modify the VI to output to a file and then open the file later on and read it in. any suggestions?
Brent
07-15-2010 12:08 PM
@BrentSchenk wrote:
Hi Mark,
that helped me out quite a bit in getting instances of the VI to run. Do you have a way of getting the outputs of the VI through those means as well? the only method i have come up with was to modify the VI to output to a file and then open the file later on and read it in. any suggestions?
Brent
If you want to retrieve the values of the dynamic VI's indicators after the dynamic VI finishes, you can use the VI's Control Value:Get method. Otherwise, you could have the dynamic VI send a user event containing the relevant data.
Mark Moss
Electrical Validation Engineer
GHSP
07-15-2010 12:53 PM
ok i see what you mean there. And I misspoke earlier. My program is running the subvi without holding up the execution of the main program. But it is NOT running separate instances of the same VI. I know this terribly breaks LabVIEWS data flow rules to do this. I dont even know if labview can do this. I'd much rather find a better solution to this problem following data flow rules.
Brent
07-15-2010 01:06 PM
i decided that the original question to this post was answered and moved the threading question to a different forum thread. the link is below
http://forums.ni.com/t5/LabVIEW/dynamically-creating-threads/td-p/1183623
07-15-2010 01:41 PM
Been there done that!
See your other thread for my reply.
Ben