LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

working multiple tasks and executable vi

Hi,

 

I have been working a code for a long time and it is getting closer to the end, but I have some doubts about building a standalone application. In the system, there are temperature and amperage measurement devices. I prepared the vi but I am not sure that they work properly due to the absence of required hardware for now. My doubts are about the vi:

 

1. Could I optimize the vi for running faster?

2. Could I make this vi executable to run it in a PC without Labview. (I installed the DAQmx 9.04 in the PC without Labview. It contains MAX, Signal Express, etc.)

3. One of the subvıs includes read text from spreadsheet function so there are 2 text files in the program. How could I embed these into the executable version instead of showing the path of text files at each run of the vi?

4. When I exit labview and reopen the vi, sometimes, the vi could not find devices (I mean simulated ones). But, after opening MAX, it finds them. When I prepare an executable of this vi, can executable vi find devices automatically or do I need to add some code to find devices automatically?

 

Thanks in advance.

Egemen
0 Kudos
Message 1 of 9
(3,078 Views)

Hi newbieeng,

 

1) Without looking at your VI: Most code can be optimized to run faster. But that doesn't mean "nicer"/"more descriptive"/"better in general". You have to define some goals 🙂

2) When you create an executable you should also create an installer when installing that exe on other PCs...

3) Put these files into your project. Then include these files as required in the AppBuilder. They will be stored in a "data" subfolder of your exe (by default).

4) There are DAQmx functions to scan for all available devices. Use them...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,064 Views)

@GerdW wrote:

Hi newbieeng,

 

1) Without looking at your VI: Most code can be optimized to run faster. But that doesn't mean "nicer"/"more descriptive"/"better in general". You have to define some goals 🙂

2) When you create an executable you should also create an installer when installing that exe on other PCs...

3) Put these files into your project. Then include these files as required in the AppBuilder. They will be stored in a "data" subfolder of your exe (by default).

4) There are DAQmx functions to scan for all available devices. Use them...


Thank you GerdW.

2. Do you mean run time engine with installer? I installed NI Run Time Engine 2009 in to the PC without labview.
3. I know how to store text files in AppBuilder, but while doing this how could the executable vi find these text documents PATHs automatically? 

Egemen
0 Kudos
Message 3 of 9
(3,054 Views)

Hi Newbieeng,

 

2) When creating an installer in the AppBuilder you include all needed runtime engines for your executable. No need to copy them on their own...

3) As I already wrote those files will be placed by default in the "data" subfolder of the executable. So your exe only has to get it's own path and append "data" as subfolder to find the files...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,043 Views)

@GerdW wrote:

Hi Newbieeng,

 

2) When creating an installer in the AppBuilder you include all needed runtime engines for your executable. No need to copy them on their own...

3) As I already wrote those files will be placed by default in the "data" subfolder of the executable. So your exe only has to get it's own path and append "data" as subfolder to find the files...


Hi GerdW,

I thought that I was not able to express what I wanted to say clearly. I attached a printscreen to make it clear. I wish I had done it. Actually, I do not worry about embedding text files into the executable, I worry about that whether the executable vi find them or not?

Egemen
0 Kudos
Message 5 of 9
(3,034 Views)

Hi newbieeng,

 

using hard-coded paths is a no-go! Never do that again!

 

- Use relative paths for your files!

- Use error checking for FileOpen functions!

- Use FileDialog, when your exe can't find it's data files!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,028 Views)

@GerdW wrote:

Hi newbieeng,

 

using hard-coded paths is a no-go! Never do that again!

 

- Use relative paths for your files!

- Use error checking for FileOpen functions!

- Use FileDialog, when your exe can't find it's data files!


Thank you very much GerdW.

Egemen
0 Kudos
Message 7 of 9
(3,024 Views)

Looking at your code.  Well, the BDs are password protected so there is no easy way for us to tell you how to optomize the code.  The benefit of course is that no-one is likely to see your mistakes!Smiley Very Happy

 

-Why did you choose a llb instead of a project?  Use a project.  No, really just use a project.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(3,017 Views)

@JÞB wrote:

Looking at your code.  Well, the BDs are password protected so there is no easy way for us to tell you how to optomize the code.  The benefit of course is that no-one is likely to see your mistakes!Smiley Very Happy

 

-Why did you choose a llb instead of a project?  Use a project.  No, really just use a project.


Sorry for that. It is 4987.

Egemen
0 Kudos
Message 9 of 9
(3,012 Views)