LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

make current values default in dll

Hello,

 

I build a dll in LV7.1. There is a function (.VI), where I have to open a reference of another VI, modify its default values on somel controls, then somehow save and close the reference.

 

This means, that if I use another function of my dll, which function needs those modified values, the new values are used. Is there any way to do it?

 

I tried to use the invoke node "Set Control Value" on a static VI reference of the VI.  The changes are made on the controls, but the lifetime of my changes ends, if the dll is unloaded. Then I have to do the changes again.

 

I know, that a dll cannot be saved through a function of it, with new values. But what is the solution? Globals in the dll?

 

regards

Mitulatbati

0 Kudos
Message 1 of 4
(2,690 Views)

Mitulatbati,

 

what do you think of using an ini- or cfg-file?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,673 Views)

Hi Norbert,

 

good idea! the problem is, that I call the function with the modified control values every 100ms. This would mean to access the hard disk 10 times a second. It´s not so healthy for the hard drive. I think I rather try to keep the Vi in the memory.

 

regards

Mitulatbati 

0 Kudos
Message 3 of 4
(2,668 Views)

Well, the idea would be to read/write the file only once.... So you would create an FGV/AE to read the settings at the call of the first function of the dll, keep the values until the last call will use the FGV/AE to write the settings back to file.

This change could possibly require a certain "setup" and "shutdown" routine in your dll which must be called from outside when using the dll. And it for certain creates issues if the dll is used without proper usage of those functions.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(2,658 Views)