LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically setting shared variable intial value

I would like to use an array of doubles stored in a shared variable to store some scaling constants. I want to automate the calculation of the scaling constants and I need the values to be retained between closing and re-opening the vi/project. I believe the "Initial Value" field on the shared variable is the way to do this. I am aware that there are other, more brute-force methods such other than writing the values to a file and manually reading and initilaizing the variable on program launch, but it would be nice if I didn't have to jump through so many hoops.

 

When I calcualte the proper scale factor, how can I programmatically set the intial value field?

 

My goal is to change the current value of the particualar vairable and make sure it keeps this value if the vi (and the associated shared variable library) is completely unloaded from memory and then later re-opened, deployed and run. 

 

Thanks!

Philip
CLD
0 Kudos
Message 1 of 5
(2,766 Views)

Is this using programmatic access (with a refnum) as opposed to a shared variable node? Where do you see the "Initial Value" field?

0 Kudos
Message 2 of 5
(2,742 Views)

I guess it's only for DSC, I didn't realize that, but here's the doc: Initializing Shared Variable Values (DSC Module)

 

 

Philip
CLD
0 Kudos
Message 3 of 5
(2,735 Views)

Yes to set any properties on a shared variable, I realize that I will have to use the refnum.

Philip
CLD
0 Kudos
Message 4 of 5
(2,733 Views)

In that case, perhaps someone with DSC experience can help. I've never used it.

0 Kudos
Message 5 of 5
(2,718 Views)