NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop stuck in LabVIEW when VI called by TestStand only

Solved!
Go to solution

LabVIEW 8.5, TestStand 4.0, Windows XP-SP3

 

The issue I’m facing is a different behavior of a LabVIEW VI whether it is called independently (in the LabVIEW environment: normal behavior) or from TestStand (unexpected behavior).

In the same VI, I've wired in parallel, so they can execute in parallel:

  • a call through “System Exec”, to a program which prompts for a user's answer. The case I’m concerned is when the answer will never come...
  • a while loop, managing a timeout which finally kills the program above when it waits infinitely for a user's answer

Just to be more precise for those who’d try reproducing the issue (but you might just have a look at the enclosed VI): in my case the program is the command line WinSCP.com. WinSCP prompts when it wants you to accept the host’s private key which is not in its cache. Don’t be afraid if you’re not used to WinSCP, the concern here is LabVIEW + TestStand.

 

What happens when we’re stuck in the “System Exec”:

  • under LabVIEW: it works fine, as expected; while stuck in the “System Exec”, the while loop executes in parallel
  • when the same VI is called in a TestStand sequence step (ActiveX automation server to the LVdevelopment system), it does not run the while loop (we're stuck in both System Exec and inside the loop). The only way to release everything is to manually kill the program called by the System Exec through Windows Task Manager.

 

For information, all tasks: TestStand (SeqEdit), LabVIEW and program (WinSCP) show 0% CPU and their memory usage is stable.

 

Have you an explanation for this unexpected / different behavior of the VI, only because it is called from TestStand?

 

Enclosed is the VI.

If you actually want running it, you might have WinSCP installed and a valid session to an accessible host (adapt path to WinSCP and session name), and do not put the host key in the cache!

Note: you won't see the same issue with other programs or commands called by System Exec (e.g. netsh, ftp...) even if they await a user's prompt.

 

Thanks for your help!

0 Kudos
Message 1 of 3
(3,651 Views)
Solution
Accepted by topic author jjd

Have you tried changing the Preferred Execution System of the VI from 'same as caller' to 'other1'.

Regards
Ray Farmer
Message 2 of 3
(3,647 Views)

Hi Ray,

 

Yes, great!

Now I tried with Preferred Execution System = “other1” and the while loop isn’t stuck anymore => that’s the solution.

 

If you have time, could you send me a short explanation why?

 

I didn't worry about Preferred Execution System values before, I think I’ll have to search more information about this.

 

Thanks again,

0 Kudos
Message 3 of 3
(3,642 Views)