LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using system execute twice in one vi the path doesnt change the second time

Hi,

 

Vi is attached, i use the system exec vi twice in the same vi at different times though and i have two different path controls wired to each one.  It appears when i get to the second use of the system exec it still returns to the first path that it was executed with. Any clues why?



-Matt
0 Kudos
Message 1 of 8
(2,785 Views)

here is the attached vi



-Matt
0 Kudos
Message 2 of 8
(2,783 Views)

Is there a reason that once you append the quotes to the string, you send append it to the command string twice?

0 Kudos
Message 3 of 8
(2,776 Views)

That was a code i found online that seemed to do the trick, but looking at it now that could be problematic correct?  Is there a reason to do that? it works to start my batch file, but that could be why it returns to that directory.  ill try without the double append



-Matt
0 Kudos
Message 4 of 8
(2,773 Views)

When i changed the append, the exec vi actually errored out. I assume that after the system exec runs that it is stuck in that working directory, now there is a workign directory assignment on the vi, but if i wire to it, it actually doesnt even run....



-Matt
0 Kudos
Message 5 of 8
(2,758 Views)

I would try putting a probe or an indicator on the final string that you send to the System exec function, once assembled.  Then copy that to a CMD window and try to run it there and see what happens.  

 

Try both with and without the double wiring of the quoted path.

0 Kudos
Message 6 of 8
(2,744 Views)

I actually did that already and the command it is sending is wrong.  When it runs the second time no matter what command i send it, it still sends the first command as i can see from the command prompt.  It uses the path from the first vi. Even if i go to run it in the same exculsive vi it will run the first command that i send to it.  Im really at a loss here.



-Matt
0 Kudos
Message 7 of 8
(2,740 Views)

You know.  I did something crazy here and i actually just put both of the files in the same folder Smiley Very Happy I dont fully understand the system exec function, but for now it gets it done.  It has to be something about the working directory id think.

 



-Matt
0 Kudos
Message 8 of 8
(2,733 Views)