LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW executable is not gathering data

My senior design group is using a labview program that draws data from an impact hammer and accelerometer plugged into a digital ICP signal conditioner. The code works as expected when running in labview, but when we try to save the program as an executable and run it on a different computer (or the same one) it does not gather any data at all when we press run. There are 2 sub VI's that were included in the executable, 485B39 (signal conditioner code) and counts to V. What could be the reason that no data is being collected in the executable?

 

Daniel_UNCC_0-1639015975092.png

 

 

0 Kudos
Message 1 of 10
(2,116 Views)

Let me see if I get your situation:

  • You write a LabVIEW program and run it in "Development Mode" (from within LabVIEW).  It works.
  • You build an Executable for this Program.
  • When you run the Executable, it doesn't work.
  • You think (reasonably!) that there may be something subtly "wrong" with your Program.
  • You want help in explaining what is wrong with your Program.
  • You do not provide the Program (meaning all of the LabVIEW code), leaving us to "guess" where the problem might be.

There is a Reasonable Next Step for you to take.  You might also provide more details on the signal conditioner, and the code associated with it.

 

Bob Schor

0 Kudos
Message 2 of 10
(2,095 Views)

When you say it's not collecting data, does it in fact connect?

 

The problem could be anything, from the hardware isn't connected to a subVI dynamically loads a VI that is not included.

 

Any error? (You'd need to handle the errors, with a dialog or indicator). 

0 Kudos
Message 3 of 10
(2,062 Views)

A partial screen shot that doesn't show all of your code.  I'm going to assume there isn't anything to the left of the picture, and nothing substantial above or below it.  To be sure, is there any other while loop outside of that screen we can't see?

 

I'm going to assume there isn't.  The issue I see is that you have an acquire button that is far to the left and will be read exactly one time when the VI starts.  It is probably false.  Even if you press it again, the code inside the loops will never see the change because the control is not read again.

 

It works in development because when the VI is not running, you can press the button, then if you press the Run button, it will read it as True.  It won't work in an executable because the program will start running immediately.

 

These are all basic LabVIEW dataflow principles I suggest that you review again.

 

Otherwise, please attach the actual VI so we can look at all of your code in the event the stuff not shown in the picture affects things.

0 Kudos
Message 4 of 10
(2,049 Views)

I have attached the main VI and sub VI's to this comment. The 485B39 recognizes the signal conditioner. The code works fine when run on the labview .vi, but I saved the labview as a .exe file (NI will not let me upload this file here) and no data is being collected when I run the program. No error is displayed on the .exe file, and when I press stop and press run again it continues to not display any data. 

 

My goal is to plug in the same equipment to a computer running the .exe file (which does not have labview installed) and get the same data I would on the .vi file. 

Download All
0 Kudos
Message 5 of 10
(2,038 Views)

I'm going to have a stab from the initial screen shot and not look at the code.
I suspect the Device ID (Read once on Main VI load before the subVI and while loop) is not set to a default value and is wrong on the target PC so you never connect so nothing happens.

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 6 of 10
(2,023 Views)

@Daniel_UNCC wrote:

, but I saved the labview as a .exe file (NI will not let me upload this file here) and no data is being collected when I run the program.


But does it connect to the device?

 

You're telling us what doesn't work. You need to tell us the first thing that doesn't work (or does work). Exactly. 

 

You have a VI before the loop, that should show different results if it connects or not. Does something show up in "485B39 Information"?

 

This is important to find your problem.

 

If it does connect, but doesn't get data, something in the loop is the problem.

 

If it doesn't connect at all, it could be a physical (cable, port, etc), driver, OS, firewall, address, or user rights problem. Or something else. There might be nothing wrong with the program.

0 Kudos
Message 7 of 10
(2,022 Views)

@Daniel_UNCC wrote:

 No error is displayed on the .exe file, and when I press stop and press run again it continues to not display any data. 


I'd expect no error to pop up, unless you've added a (simple) error handler or error indicator... This would only show errors if the error isn't cleared anywhere in the code.

0 Kudos
Message 8 of 10
(2,021 Views)

wiebe@CARYA wrote:

@Daniel_UNCC wrote:

, but I saved the labview as a .exe file (NI will not let me upload this file here) and no data is being collected when I run the program.


But does it connect to the device?

 

You're telling us what doesn't work. You need to tell us the first thing that doesn't work (or does work). Exactly. 

 

You have a VI before the loop, that should show different results if it connects or not. Does something show up in "485B39 Information"?

 

This is important to find your problem.

 

If it does connect, but doesn't get data, something in the loop is the problem.

 

If it doesn't connect at all, it could be a physical (cable, port, etc), driver, OS, firewall, address, or user rights problem. Or something else. There might be nothing wrong with the program.


@wiebe - you've missed the subtle difference between setting the value of the Device ID control value in the dev environment before clicking run and running an exe here, It might  be a cable, but it's more likely just param not set at runtime when VI launched 😉 if no information. (And device IDs change between PCs so easily.)

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 9 of 10
(2,018 Views)

@James_W wrote:

wiebe@CARYA wrote:

@Daniel_UNCC wrote:

, but I saved the labview as a .exe file (NI will not let me upload this file here) and no data is being collected when I run the program.


But does it connect to the device?

 

You're telling us what doesn't work. You need to tell us the first thing that doesn't work (or does work). Exactly. 

 

You have a VI before the loop, that should show different results if it connects or not. Does something show up in "485B39 Information"?

 

This is important to find your problem.

 

If it does connect, but doesn't get data, something in the loop is the problem.

 

If it doesn't connect at all, it could be a physical (cable, port, etc), driver, OS, firewall, address, or user rights problem. Or something else. There might be nothing wrong with the program.


@wiebe - you've missed the subtle difference between setting the value of the Device ID control value in the dev environment before clicking run and running an exe here, It might  be a cable, but it's more likely just param not set at runtime when VI launched 😉 if no information. (And device IDs change between PCs so easily.)


No, I didn't. Your message crossed mine, yours wasn't there when I typed mine. Otherwise I would have rephrased mine.

 

I did explicitly mention the wrong address as a potential problem. Not setting the default is just a cause of using the wrong address.

0 Kudos
Message 10 of 10
(2,015 Views)