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: 

complications with serial communication

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?



-Matt
0 Kudos
Message 1 of 7
(2,744 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(2,736 Views)

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.



-Matt
0 Kudos
Message 3 of 7
(2,730 Views)

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?



-Matt
0 Kudos
Message 4 of 7
(2,727 Views)

Why can't you just do the download process in LabVIEW?  You just need to know the commands to send and read the data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,709 Views)

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.



-Matt
0 Kudos
Message 6 of 7
(2,701 Views)

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?



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