LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Works fine but the built Exe does not work 100%

Hi, I wrote a VI to communicate via rs232 to query some temperature and current from a laser, and write the data to a text file. The VI works perfectly fine. everytime i run it, a new line of data beginning with the time stamp will be saved to the same file.txt. then i tried to build an exe, and try to run it, it only writes the current time stamp to the file but every other data (temp, current etc) are written blank.

 

So there's a problem with communicating with the rs232 to my device using .exe ? is there some option that i need to adjust? Since this is the first time building an exe for me.

 

i'm using version 8.0

 

thank you so much!  

0 Kudos
Message 1 of 11
(4,510 Views)
Are you running the executable on the same computer as where you developed the code? If not, do you have VISA installed on the computer running the executable? Not having it would generate errors, so my guess is that you don't have error handling. Other possibility: Are you sure you're properly setting the VISA resource name? Is this coming from a file, or is it hard-coded? If it's coming from a file, how do you ge the path to the file? Is it possible you have a symptom of this?
Message 2 of 11
(4,502 Views)

hello there,

 

For assurance, any paths of file to write to or VISA resrouce names are changed to constant. and yes, it is the same computer i'm using the exe on as my VI.  so being constants should have no problem right? 

0 Kudos
Message 3 of 11
(4,479 Views)
In theory there should be no problem. Rather than continuing to guess can you upload your code (please be sure to compress it with a zip-like utility)? It may be easier to try and pinpoint the problem.
Message 4 of 11
(4,458 Views)
atttached is the vi that i'm trying to build into exe. thank you very much for helping me!
0 Kudos
Message 5 of 11
(4,455 Views)
You could atleast wire the error wire, and show the result in an indicator. My guess is something goes wrong with the RS232 communication. Hopefully the error message will give a better understanding of the error
0 Kudos
Message 6 of 11
(4,451 Views)
darn..why didn't i think of that -_-...thanks for the hint haha..i'll try it tomorrow morning when the lab is free....
0 Kudos
Message 7 of 11
(4,440 Views)

northPIG87 wrote:
darn..why didn't i think of that -_-...thanks for the hint haha..i'll try it tomorrow morning when the lab is free....

 


smercurio_fc wrote:
... so my guess is that you don't have error handling. 

 

0 Kudos
Message 8 of 11
(4,426 Views)

Ok, i wired 10 error indicators to my read or write ....but it was no use...because my exe somehow worked this time! lol. strange.

 

but i have a new question, maybe i should post a new message..but might as well ask here: i'm using Cron.exe, a program that can execute files at desired time, to execute this laser recording vi's exe. The first time, the exe gets executed and the VI shows up and runs once and the data gets recorded...and the window stays open. The second time cron.exe tries to execute the same file, it just jumps to the vi screen but does not run it.

 

i guess it makes sense since the vi is already executed...

 

so is there a way, to make the vi close itself after being executed once?  

0 Kudos
Message 9 of 11
(4,408 Views)

Hi

 

Which com port are you using? If you start the program like that it looks like the visa will be initiated for COM1. Maybe you should let user pick com port first and after cliking OK button  initialise connection with your device?

 

Best regars

Mikolaj

0 Kudos
Message 10 of 11
(4,406 Views)