06-09-2010 06:12 AM
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
06-09-2010 07:31 AM
Mitulatbati,
what do you think of using an ini- or cfg-file?
Norbert
06-09-2010 07:41 AM
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
06-09-2010 08:00 AM
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