LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Load defaults from file with event structure in vi

Hi All,

I've been trying to figure out how to do this but have not quite got there. Taken a look at lots of posts but can't quite find the answer to the question that i've got.

I've got a vi for controling 4 PCI cards making calls to some DLL's. I've got quite a number of controls on the FP and i use an event structure to update the values on calls to the DLL. On startup, one of the first calls that i make is initalise and that sets the cards up. I then want to load my own set of default values from a file to initalise the cards to my particular set up. While the software is running the user may change the values and wish to save a file with the new default values, or he may wish to load a different file of default values (depending on the test that he is running). I've got the Control Values:Get All [variant] and the Control Values:Set [Variant] working to save all the controls values to a file and read that file in and set all the controls values. So far so good. Problem is i'm using an Event Stucture and it doesn't register that the values have changed. I could complish this by using Value(signaling) but the data from the Control Values:Get All is variant data and the Value(signaling) needs the same data type as the control. What do i do?

One thing i have thought about is to write all the values from the file to all the conrols and then have a read Value and a write Value (signaling) to trigger the events. Problem is i don't want to set this up for every control (it'll take me ages). Can i do it programitically? Is there a better way to do it?

Thanks,

Phil
0 Kudos
Message 1 of 3
(2,479 Views)
Without seeing your code, I would suggest looking into user events.  If you create a user event that calls the DLL for the new values, then you generate that user event when you load a file.
0 Kudos
Message 2 of 3
(2,475 Views)
You could create a boolean control/indicator and signal that value when you've updated the values on the FP.

Name it something like "update FP". The event case for that boolean will have the code to update the necessary parts of the FP.

André
Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 3
(2,462 Views)