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.
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.
05-29-2015 01:35 PM
Currently trying to close a serial port and then use a system exec vi to open a batch file that will download over the same serial port that ive closed. In my code i close the serial port with a close visa session and then go directly to my attached vi. I see the command prompt flash but download doesnt begin, im fairly certain this is because labview still has control of the port. Should i put more than a 1 second delay between the close visa and run system exec? Any advice would be appreciated?
05-29-2015 01:42 PM
The VISA session won't really be released until the top level vi goes idle. But try this...Go to Tool Options Enviorment and check "Automatacly Close VISA sessions" That should do the trick
05-29-2015 01:47 PM
Hmm,
Tried that and still got nothing. I didnt know that the top level vi has to close. This may put a damper in my plans here.
05-29-2015 01:51 PM
So since that didnt work would i typically have to release the port, and close the top level vi? In doing that how would i then programatically open the batch file and then continue onward with the rest of the code?
05-29-2015 02:10 PM
Why can't you just do the download process in LabVIEW? You just need to know the commands to send and read the data.
05-29-2015 02:14 PM
By that you mean avoid the batch file and simply send the files via labview? I didnt write these files nor the batch file, all i know is that the batch file runs about 4 different files in order and then i have it exiting.
05-29-2015 02:30 PM
Heres another question actually which may be part of the issue. I have two file that i will be closing the port and loading to and then reopening and then closing again. Now ealier in my code i open these batch files, read and sort and actually make sure they are set to the correct port (vi attached). Now it appears that when i run the system exec that the command prompt is actually in the wrong directory, Its odd because it goes to the wrong directory and is then looking for a file from the other directory. When you close the file using the close file vi, does it save that file? Also, what applicaiton does it use to open the txt file?