LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exec system.vi

Hi Chris,

I have tried to build the system as you have but mine seems to run differentyl to how your describing.

Could you possible send me your code,

What are you trying to achive?

 

Many thanks,

Jordan Power
Applications Engineer
National Instruments
0 Kudos
Message 11 of 17
(1,222 Views)

Hi J power, I've attached my code again though it is the same as last time. My overall project is to use labview to write tcl scripts and then open NS2 to run the scripts automatically.

 For now im just trying to see if it can open cygwin from labview and that is where I get my problem. I dont know system exec.vi seems to open and close it repatedly.
0 Kudos
Message 12 of 17
(1,208 Views)

Hi, I thought I would attach the error that its giving as well. It claims that it cant locate the the file I want it to run. protocol.tcl is found in C:\cygwin\tclprojects\protocol.tcl

If I run a hello.c program then it says the same thing. I saved hello.c in C:\cygwin\hello.c same directory as cygwin.bat

0 Kudos
Message 13 of 17
(1,178 Views)

Hi Dave,

Looking further into the problem, and I am wondering if:

1)  Have you tried to run the command in the command prompt window to see how runs over there?

2) Another thought is how exactly do the commands execute in the batch file itself. Have you tried running the System Exec.vi with another batch file (something that you can create by yourself)?

Regards
Jordan Power
Applications Engineer
National Instruments
0 Kudos
Message 14 of 17
(1,154 Views)
I run cygwin from the compiler if thats what you mean. Its just with system exec that i get the problem.
0 Kudos
Message 15 of 17
(1,128 Views)

Hi Dave,

So you get the desired results when the comand is ran in the comand prompt, so the files are working as you would like them to.

Did you manage to look at the script of the batch file and understand what steps it is taking?

 

As I have been searching for your soultion a came across some other forum posts performing slightly similar applications, have you tried doing a different command or function to see if it working properly?

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=154928&query.id=41887#M154928

Maybe check the hyperlink within the posts: 

 

Here is the main dirctory for all of the Cygwin related posts:

http://forums.ni.com/ni/search?submitted=true&q=cygwin

 

Regards

Jordan Power
Applications Engineer
National Instruments
0 Kudos
Message 16 of 17
(1,099 Views)

Hi Dave,

I have been looking at the problem again and I have got the cygwin bash shell to open and stay open (see attachment).

This worked because I deleted the speech marks that surround the file path they were what I found to cause my command prompt to close rapidly.

 

Now you want to open and edit a script, the only way I can think of achieving this it to write to a txt file in LabVIEW (fully writing all the commands you need to execute) and then read the txt file into cygwin, letting it run through.

I think the other thing is that LabVIEW and cygwin run on separate threads within your processor so they will possible work in parallel rather that a series sequence, buy this I mean that once LabVIEW executes the cygwin command LabVIEW wont hand over the total control of the processor to cygwin and wait till its finished, it will run and then carry on doing what it is doing independently, and if that is only one item of code then this is another cause for the system to shutdown so quickly.

 

Again hope this helps.

Regards

Jordan Power
Applications Engineer
National Instruments
0 Kudos
Message 17 of 17
(1,078 Views)