LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Akiel

Should be option when using system exec for labview to continue running in background while external application running

Status: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.

At present when an external call is made via system exec.vi you have 2 options wait on completion true or false. If set to true labview suspends until the external app finishes, if set to false labview carries on but can not wait on an output from the external application. There should be a possibility of getting the output from the system exec.vi when when wait on completion set to false.

 

To give a real world example. I have a large test program that basically monitors a comms bus (udb in this case), and reacts to requests received on it. It also monitors the health and goes into a fault state if nothing received for over 100ms. WHen I call my external application (connects to wlan and gets some data and returns it to labview) labview pauses while this happens, this in turn forces a timeout error. If i set wait until completion false then i dont get the data from the external app. I have implemented a work round (use a temp file which is monitored from labview and set wait on completion to false). Would be much simpler if a method could be implemented in labview itself

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
6 Comments
crossrulz
Knight of NI

How can you get data that isn't available?  That's why you don't get those outputs when you don't wait.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Akiel
Active Participant

you can wait until it is available tho, as per normal vi execution. The issue i have is with labview suspending while we wait for the data or carrying on regardless, surely labview can carry on doing what it needs to do while we wait for an application to complete.

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
SteenSchmidt
Trusted Enthusiast

Could be implemented like the Start Asynchronous Call and Wait On Asynchronous Call prims. Kudos from me, even though System Exec is an unwieldy beast that in all cases require a fully awake programmer to not create a bughole with (I especially think about parallelism and thread apartments here).

 

It would also be nice if System Exec could be made to run in a sandbox as suggested for DLLs here.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
PNR
Member
Member

Well a behaviour like Start Async. and Wait On Async. is a great idea. However the problem described above can be solved using a parallel loop (one for the monitoring task, one for other stuff). Waiting for the asynchronous call would also cause a wait in the application...

SteenSchmidt
Trusted Enthusiast

A parallel loop for System Exec would work, and that is what we do today. But there are a few serious drawbacks with this approach, for instance:

 

1) It's a one-shot solution; you can't wait a bit, then go do someting else, then wait some more, go do something else, wait some more, etc. You either wait the full (unknown) amount of time or you don't wait at all.

2) Waiting within the System Exec ties up a whole thread apartment.

3) It's not possible per se to quit a waiting System Exec. I seem to recall that some way to abort a running System Exec exists, but a time out input or equivalent API would be much better.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.