LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI works Execuable does not work

Hello Together,

 

I know I just miss a tiny detail, but I don't find it, so here's the Problem:

 

I created a rather big VI with many SubVI's,

I programmed and tested this on the PC, which will finally control the whole device

I control the I/O's with the PCIe6323 Card and the Serial Communication with PCIe-8430/8

The VI itself works perfectly.

 

now, in the final stage I wand to create an executable, so the final user just see the GUI (and cannot modify anyhow the program)

 

I Created an Project out of the Main V, with automatic selection of all dependencies

(I've should've done this from the beginning, I know):

WWolf78_0-1644593522748.png

 

after creating and building the Executable the program works until Serial / I/O Communication.

then the program crashes and the I/O's and the Serial com does not work

(additionally the workaround with an installer does not word, the installer does not create any executable, it just copy the main VI)

 

I'm wondering why, as the exe runs on the same PC so the runtime engine shouldn't be the problem?

what am I missing?

 

thanks for the help!

 

0 Kudos
Message 1 of 17
(1,247 Views)

An Installer is no workaround, if the .exe doesn't work, installing it won't help. It's what you create after it works on your computer. 🙂

It sounds like you have a bad VISA configuration. The Error should say something about it, unless you've forgotten to wire the errors through. Another classic mistake it file paths, if you refer to other files in your code by Path, once compiled you have a virtual folder of the .exe-name added when compiled.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 17
(1,237 Views)

@WWolf78 wrote:

Hello Together,

 

 

after creating and building the Executable the program works until Serial / I/O Communication.

then the program crashes and the I/O's and the Serial com does not work

 

 


Some of important details missing, like is the exe "crashing" on  the dev PC or a new PC. What do you mean by "crashing"?

My first guess is that there is a MAX configuration file missing from the deployment package. Or might be just a simple "COM3" doesn't exist on the new computer... IE it is actually COM4 due to Windows random COM port assignment.

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 3 of 17
(1,228 Views)

for both, initialing the I/O's and the serial I created Error handling:

 

WWolf78_0-1644596233311.png

 

 

WWolf78_1-1644596301777.png

 

for data logging I create an Logfile and an excel file, whereas I keep the file path:

 

WWolf78_2-1644596373710.png

 

 

WWolf78_3-1644596413449.png

 

any error inside those code or if not, any hints?

 

0 Kudos
Message 4 of 17
(1,225 Views)

The 3 hard coded COM ports is a "hint"
Still need to know if the exe is running on the DEV computer or on a different computer.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 5 of 17
(1,222 Views)

regarding the "Crashing" question:

 

for better placement of the gui, (as I have to handle many possibilities) I use a Tab:

WWolf78_0-1644596704749.png

after the startup, it should change pages, but in the exe it doesn't

 

additional:

for a more specific control I created an Tab, where you can see all I/O's and control some:

normal (running VI):

WWolf78_1-1644596804067.png

 

and by exe:

WWolf78_2-1644596973462.png

 

 

0 Kudos
Message 6 of 17
(1,217 Views)

it's running on one PC

0 Kudos
Message 7 of 17
(1,215 Views)

"after the startup, it should change pages, but in the exe it doesn't"

There is another hint.

Let me get some more string to pull a few more teeth with...

 

What error message are you getting?

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 8 of 17
(1,210 Views)

that's the mean one:

I don't get one

 

after your input, realized where the first error happens:

after the initialization of the serial I/O's I try to communicate with my external device:

 

WWolf78_0-1644603116826.png

 

for explanation:

if I send the other device the command "req Firmw.." I should send a reply.

 

this works with the VI but does not with the Exe:

 

(thereby I realized I missed implementing an error handler)

 

so initialization of the serial works, but communication does not work..

0 Kudos
Message 9 of 17
(1,167 Views)

Hi Wolf,

 

  • Do you think it's a good idea to initialize one DAQmx task and then duplicate that task several times by setting different channels in each duplicated reference?
  • Do you really need that array of 20+ DAQmx tasks? (From what we can see you seem to create 4 of those task arrays…)
  • Using BytesAtPort to determine the number of bytes to read is considered "non optimal" behaviour…
  • Using local variables when the terminal is unused is considered "bad style".
  • Using locals when a shift register should be used is considered "bad style".

There is so much in those images that should be improved/refactored! (And I don't start to talk about that "Denglisch" in your frontpanel or that user interface consisting of a huge tab container…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(1,161 Views)