Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Control only updates NV after another control is pressed

I have a Measurement Studio windows app in VB. The app has two controls, each is tied to a different network variable of type double.  One control updates the appropriate network variable as expected.  The onther updates locally (the value of the control changes) but the NV is not update until focus is taken off the control and put someplace else.    I have looked into all the focus settings I could find. All the properties on the controls are identical. Any ideas why the controls are behaving differently?
0 Kudos
Message 1 of 4
(3,027 Views)
Hi Steve,

How are you connecting these controls to the network variables?  Are you connecting them using the NetworkVariableDataSource to connect the controls to a network variable?  Or, are you writing a new value to the network variable on a Value Changed event for each control?  Which types of controls are you using?
0 Kudos
Message 2 of 4
(2,999 Views)
FYI - all this is being done in VB.

Originally I had the control (an NI NumericEdit control) connected via a NetworkVariableDataSource.   In this case, it was operating as I originally described.   However, I have since changed things.  Now I read the NV on form_load and set the initail vaule of the control.  I am using the ValueChanged event to detect when the user changes the value in the control and I update the NV on this event.  The NV type being read/written is a Double as listed in VarManager). This is working.  I am confused as to why it didn't work the way I originally had things - the control tied to a NV data source,

Once I got this to work, I attepmted to use this same solution on another control (NI SwitchArray).  The switch array is writing to an array length 8, of Boolean (VarManager lists this as a custom type.) The switch array NV changes values when the appropriate switch is moved and I can see the NV updating in VarManager.  This is all happening via the ValueChanged event.  This is good.  However, I can not get this control to reflect the initial state of the NV.  I have similar code to what I'm using for the NumericEdit control in form_load. The switch (and NV) on start up always start at 0 (an array of all zeros).  For example if I leave the NV in the state 11110000, the next time the app starts the NV is 00000000 (and the swithces do reflect this, so the switches and the NV are in sync).   If I watch VarManager as the application starts, I can see the NV get set to zero before the application appears on the screen, so something is setting it to zero but I don't know what.  I have no control over this NV if I try to use NVDataSource.  One thing I noticed, VarManager is reporting a WriteBufferOverflow for this NV.  Is it not reporting that for the NumericEdit NV I mentioned above, for that NV it is reporting Good.
0 Kudos
Message 3 of 4
(2,989 Views)
Hi Steve,

I haven't been able to duplicate this behavior.  Do you have a simple example that you can post that demonstrates this behavior?
0 Kudos
Message 4 of 4
(2,975 Views)