From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout of system exec vi

I'm using the system_exec vi to to send commands to the unix shell. There is the possibility that the shell command may idle for a long time, and i'd like to abort the subvi that calls system_exec (i.e. return to the main calling vi with a timeout error) if the time exceeds a certain value. How can i do this?
0 Kudos
Message 1 of 4
(3,770 Views)
XopWat,
I've just kinda brain stormed something that may help out. Have your system_exec.vi in parallel with a while loop that is keeping time. If a certain time is met, then a timeout has occured and then execute a second system_exec.vi that shuts down the unix shell. Now I'm no unix guru by any means, but I believe there is a command called "killall" that can shut down whatever was going on in your shell. Post to let us know if that helps!
 
Best Regards,
 
Chris C
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,746 Views)


@Chris_C. wrote:
XopWat,
I've just kinda brain stormed something that may help out. Have your system_exec.vi in parallel with a while loop that is keeping time. If a certain time is met, then a timeout has occured and then execute a second system_exec.vi that shuts down the unix shell. Now I'm no unix guru by any means, but I believe there is a command called "killall" that can shut down whatever was going on in your shell. Post to let us know if that helps!
 
Best Regards,
 
Chris C
Applications Engineering
National Instruments




Thanks for the advice, but this doesn't seem to work. The problem is, the whole vi hangs waiting for the first system_exec to complete. But, thanks for the idea.
0 Kudos
Message 3 of 4
(3,738 Views)
XopWat,
I'm sorry my suggestion didn't seem to work out. I did however find another discussion forum that I think could definitely help out titled "Is it possible to time out the 'System Exec.vi'? ". Check it out and let us know what you think.
 
Best Regards,
 
Chris C
Applications engineering
National Instruments
0 Kudos
Message 4 of 4
(3,726 Views)