LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building an executable

Ive been trying to build an executable to run on a different computer, but I must be doing something wrong.  I have read the NI tips on this subject and I also have the Labview for Everyone book that I have been trying to solve my problem with but I just can't seem to figure it out.

 

My program works on my computer, but on the computer I am installing it on (which also has the same version of labview installed) it runs but it doesn't do anything, it just hangs up.  It does not give me any error messages and the program does not break, it just keeps running but doesn't do anything.

 

I have attached some screenshots to show how I am building the application in the project explorer.

 

One thing I notice is that my application has a bunch of sub.vis, but none of them appear in the project explorer.  I was under the impression that it adds all sub.vis automatically, but maybe I am missing something.

 

Also I am confused as to the difference between "Startup VIs" and "Always Included" shown in the image called "Application Builder."

Application Builder.jpg

Project Explorer.jpg

0 Kudos
Message 1 of 14
(2,532 Views)

Adding a VI to a project does not automatically add all subVIs. It doesn't have to. You can add the subVIs yourself if you wish, but it's strictly not necessary. I typically like to see everything in the project file, but some folks don't. Startup VIs refers to the top-level VIs in the application. Normally you'd have just one, but you can have more than one. Always included refers to VIs that you load dynamically. Since they are not directly linked to a VI, in order to make sure they get included with the application you need to put them in that list. This is all explained in the LabVIEW manual. Did you read it?

 

As for your issue, your code screenshot implies that you are talking to an instrument. Have you installed the required drivers on the target machine? If your subVIs are using VISA then you should install NI-VISA and NI-488.2. If you're using the plain GPIB functions, then you only need NI-488.2.

 

Aside: your use of local variables like that is usually a red flag. Not in the sense that local variables are bad, but it's impossible to say from just the screenshot if you have some sort of race condition. Also, it's not clear what your intention is with error handling. If an error occurs on the first iteration of the loop, that will not prevent subsequent iterations from running, since the string of VIs are controlled from a tunnel, which means each iteration only ever sees the tunnel value at the start of the loop.

Message 2 of 14
(2,519 Views)

Are you calling any subVIs dynamically? How do you control the UI of your application? Do you use event structures and allow the user to initialize everything before running (or use a configuratoin file to initialize everything) or do you use the Run button to start things? Also, based on the screen shot I would wonder about the code itself. It looks like your block diagram is massive. I also agree that seeing lots of local variables makes me wonder about race conditions?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 14
(2,516 Views)

I use a start button to start it, and there is not much more to the actual program outside of the screenshot (the program itself does work just fine on the computer I made it on, and the local variables are inside the structure and constant throughout, so they are nothing to worry about).  All the drivers that control the equipment, I programmed myself, using NI-VISA, so maybe the computer I am trying to run it on (that also has labview) doesn't have the VISA functions, I'll have to check it out.

0 Kudos
Message 4 of 14
(2,492 Views)

Ok so I looked at the other computer, it definatley has the NI-VISA functions installed, and all of my instrument drivers I programmed with the VISA functions.

 

 

0 Kudos
Message 5 of 14
(2,482 Views)

Also on error handling, should they be shift registers instead?

0 Kudos
Message 6 of 14
(2,480 Views)

@LarsUlrich wrote:

Ok so I looked at the other computer, it definatley has the NI-VISA functions installed, and all of my instrument drivers I programmed with the VISA functions.


Then without seeing the rest of the code, you will need to do somet troubleshooting of your own. We do not have crystal balls to tell you what the problem is. For example, have you verified the GPIB address? Have you verified that your local variable (which you say is being used as a constant) has a value? What is driving that inner case? Is it a state machine? If so, have you verified that you are going through your states?

 


Also on error handling, should they be shift registers instead?

If you want the code to not execute subsequent iterations, then yes.

0 Kudos
Message 7 of 14
(2,463 Views)

GPIB missing.jpg

 

So I think I have stumbled across the cause of the problem (though I am still unsure of the solution).

In the Measurement and Automation explorer I can see and communicate with my intruments, however when the program runs and the user needs to input GPIB information into the front panel, the devices are missing.  The tech who this program was written for and who was running it was manually typing in the addresses, and labview must not be seeing the devices. 

 

As I said, the VISA functions are installed and those are what the drivers use, and the devices do appear and I can communicate with them using measurement and automation explorer.  (And clicking the "refresh" option shown does not fix the problem.)

0 Kudos
Message 8 of 14
(2,452 Views)

Then you might want to think about storing this information in a file so the user doesn't have to know or enter the device address.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 14
(2,442 Views)

I could do that, but that is not a solution, the devices still don't work.

The tech was manually entering GPIB info, but that doesn't mean that the computer recognized anything as being at that address.

When labview recognizes there is an instrument at a specific gpib address, that address should show up in those pull down menus, the problem is not that they don't show up, but that labview doesn't recognize the devices for some reason.

0 Kudos
Message 10 of 14
(2,437 Views)