LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get blink speed into a .exe?

Hi,
 
Problem (applies to LabVIEW 6.1 and LabVIEW 7.x at least):
 
(1) I develop some code. Top-level VI has a blink speed of 250 msec (set in, I believe, Options-->VI properties: at any rate, a global setting).
 
(2) I use Application Builder to build an executable. I run the resulting .exe file and my LEDs blink at a different rate than I set: not 250 msec but the default 1 second.
 
(3) Assuming the resulting .exe is "myapp.exe":I can set BlinkSpeed=250 in relevant .ini files (I forget which--either LabVIEW.ini or myapp.ini, or both), and the problem is solved.
 
But I want to build an application to distribute on a CD, with an installer, and I don't want to force the end user to edit some .ini file. I and a cohort have had no success so far. Can anybody else help?
 
Thanks a bunch,
 
::Marty
0 Kudos
Message 1 of 11
(3,705 Views)
Include the ini file for your tested executable as part of the installer.  As a support file.  This is very common for setting a variety of things.

Paul
Message 2 of 11
(3,698 Views)
Re Pana-Man's suggestion to include the .ini file as an installer support file: Almost sure we tried that one without success (LV 7.0). But I'll verify and report further.
 
Thanks very much for the feedback, P-M.
 
::Marty
0 Kudos
Message 3 of 11
(3,680 Views)

Update: With LV 6.1, I included LabVIEW.ini with blink speed 250ms, as a support file in Application Builder. No effect--the built application had blink speed of 1 sec.

So, any help with this will be appreciated.

Thanks,

::Marty

0 Kudos
Message 4 of 11
(3,640 Views)

You can't just include the LabVIEW.ini file.

The ini file has the same name as the application (for example, foo.exe will have foo.ini). If the ini file isn't found when you first run the EXE, it will be created. Once it's created, you need to put the line about the blinking speed under the [foo] section, which isn't created by default. So, to make this work, you will need to create your ini file (foo.ini), inside it create a [foo] section and inside that place the line about the speed.


___________________
Try to take over the world!
Message 5 of 11
(3,634 Views)
Tst said >

You can't just include the LabVIEW.ini file.

The ini file has the same name as the application (for example, foo.exe will have foo.ini). If the ini file isn't found when you first run the EXE, it will be created. Once it's created, you need to put the line about the blinking speed under the [foo] section, which isn't created by default. So, to make this work, you will need to create your ini file (foo.ini), inside it create a [foo] section and inside that place the line about the speed.

***

OK, so if I want to build an application called foo.exe that has my desired blink speed, I create foo.ini, add a [foo] section where the blinkSpeed/whatever key has value 250, then include foo.ini as a support file when I build?

I'll try that. I seem to remember trying similar tricks, but I may have omitted the above. In the past I've been able to modify some combination of foo.ini and LabVIEW.ini, post hoc, so that foo.exe behaves properly. But the main thing is that I want an installer to capture all those details. I don't want to do anything post hoc, manually--just want the .exe to install automatically and run correctly, first time every time.

Thanks,

::Marty 

0 Kudos
Message 6 of 11
(3,619 Views)
Well, I don't remember having any experience with automatically installing INI files myself, but you described the process correctly. If the INI file will end up in its proper location it should work.

___________________
Try to take over the world!
0 Kudos
Message 7 of 11
(3,616 Views)
I added the script:

blinkFG=001E4B00
colorUserItem="3D Object=BCBCBC;Control Background=FAFAFA;Indicator Background=D2D2D2;3D Active Object=969696;Text=000000;LED On=64FF00;LED Off=1E4B00;Thermometer Fill=FF0000;Slide Fill=0041DC;Slide Housing=6D6D83;Tank Fill=0041DC;Tank Housing=A9B3CB;Classic Object=B3B3B3;Classic Slide Thumb=3399FF"
blinkSpeed=250

to the .ini file of the executable as tst described and it worked.  I am bothered that any blinking indicators will have the same rate of 250 ms.  NI should update the properties of front panel objects like LEDs to include the blink speed.

Regards
0 Kudos
Message 8 of 11
(3,271 Views)

You can do this yourself if you do something along the lines of the example posted here. Note that this was just an example, not something meant to be used as released code. If you do modify and use it, be sure to include the VIT in the build.

Another option (if you have 8.x) is to use an XControl.


___________________
Try to take over the world!
0 Kudos
Message 9 of 11
(3,252 Views)

Two years later.

Tst's original suggestion did work.

I agree with LabBard that blink speed should be a property dynamically settable via the LV diagram. It seems like overkill to jump through the hoop of making an XControl to enable an LED to blink at the non-standard rate. Anyway, the blinkSpeed for the XControl would still not be settable dynamically in that case, would it, but could just be set once for the XControl, just like for a main application? Only time I've made an XControl is in Advanced Architectures class, months ago.

Finally, in my opinion, 1 sec is a bad choice for a standard rate, should be less--I like 1/4 sec, but I might be able to live with 1/2 sec or something else.

Thanks for feedback,

--Marty

0 Kudos
Message 10 of 11
(3,221 Views)