10-17-2012 05:35 AM - edited 10-17-2012 05:38 AM
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.
10-17-2012 06:06 AM - edited 10-17-2012 06:07 AM
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...
10-17-2012 06:59 AM
@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?
10-17-2012 07:24 AM
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...
10-17-2012 07:46 AM
@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?
10-17-2012 07:51 AM - edited 10-17-2012 07:52 AM
10-17-2012 08:33 AM
@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.
10-17-2012 08:57 AM
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!
-Why did you choose a llb instead of a project? Use a project. No, really just use a project.
10-17-2012 09:02 AM
@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!
-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.