Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

CWGraph Problems in VB.Net?

We are trying Measurement Studio with VB.Net. It seems to work fine except for 1 condition we have found.

The CWGraph works well until you leave it alone for a few minutes. Then it seems that part of the object gets corrupted. It almost appears that part of the control is getting overwritten. The time span might indicate that the garbage collector is involved.

When I look at the problem in the debugger it states

"error: cannot obtain value"

and the .Net error handling states:

System.Reflection.TargetException: Object does not match target type

Anybody hear of anything like this?

Here is what the CWGraph control looks like when it is corrupted:

- AxCWGraph1 {AxCWUIControlsLib.AxCWGraph} AxCWUIControlsLib.AxCWGraph
+ System.Windows.Forms.AxHost {AxCWUIControlsLib.AxCWGraph} System.Windows.Forms.AxHost
+ ocx {System.__ComObject} CWUIControlsLib._DCWGraph
+ eventMulticaster {AxCWUIControlsLib.AxCWGraphEventMulticaster} AxCWUIControlsLib.AxCWGraphEventMulticaster
+ cookie {System.Windows.Forms.AxHost.ConnectionPointCookie} System.Windows.Forms.AxHost.ConnectionPointCookie
CWBindingStatusUpdated Nothing AxCWUIControlsLib._DCWGraphEvents_CWBindingStatusUpdatedEventHandler
CWBindingDataUpdated Nothing AxCWUIControlsLib._DCWGraphEvents_CWBindingDataUpdatedEventHandler
ReadyStateChange Nothing System.EventHandler
AnnotationMouseDown Nothing AxCWUIControlsLib._DCWGraphEvents_AnnotationMouseDownEventHandler
AnnotationMouseUp Nothing AxCWUIControlsLib._DCWGraphEvents_AnnotationMouseUpEventHandler
AnnotationMouseMove Nothing AxCWUIControlsLib._DCWGraphEvents_AnnotationMouseMoveEventHandler
AnnotationChange Nothing AxCWUIControlsLib._DCWGraphEvents_AnnotationChangeEventHandler
PlotAreaMouseUp Nothing AxCWUIControlsLib._DCWGraphEvents_PlotAreaMouseUpEventHandler
+ PlotAreaMouseMove {AxCWUIControlsLib._DCWGraphEvents_PlotAreaMouseMoveEventHandler} AxCWUIControlsLib._DCWGraphEvents_PlotAreaMouseMoveEventHandler
PlotAreaMouseDown Nothing AxCWUIControlsLib._DCWGraphEvents_PlotAreaMouseDownEventHandler
PlotMouseUp Nothing AxCWUIControlsLib._DCWGraphEvents_PlotMouseUpEventHandler
PlotMouseMove Nothing AxCWUIControlsLib._DCWGraphEvents_PlotMouseMoveEventHandler
PlotMouseDown Nothing AxCWUIControlsLib._DCWGraphEvents_PlotMouseDownEventHandler
CursorMouseDown Nothing AxCWUIControlsLib._DCWGraphEvents_CursorMouseDownEventHandler
CursorMouseUp Nothing AxCWUIControlsLib._DCWGraphEvents_CursorMouseUpEventHandler
CursorMouseMove Nothing AxCWUIControlsLib._DCWGraphEvents_CursorMouseMoveEventHandler
+ CursorChange {AxCWUIControlsLib._DCWGraphEvents_CursorChangeEventHandler} AxCWUIControlsLib._DCWGraphEvents_CursorChangeEventHandler
KeyUpEvent Nothing AxCWUIControlsLib._DCWGraphEvents_KeyUpEventHandler
KeyPressEvent Nothing AxCWUIControlsLib._DCWGraphEvents_KeyPressEventHandler
KeyDownEvent Nothing AxCWUIControlsLib._DCWGraphEvents_KeyDownEventHandler
+ MouseDownEvent {AxCWUIControlsLib._DCWGraphEvents_MouseDownEventHandler} AxCWUIControlsLib._DCWGraphEvents_MouseDownEventHandler
+ MouseUpEvent {AxCWUIControlsLib._DCWGraphEvents_MouseUpEventHandler} AxCWUIControlsLib._DCWGraphEvents_MouseUpEventHandler
+ MouseMoveEvent {AxCWUIControlsLib._DCWGraphEvents_MouseMoveEventHandler} AxCWUIControlsLib._DCWGraphEvents_MouseMoveEventHandler
DblClick Nothing System.EventHandler
+ ClickEvent {System.EventHandler} System.EventHandler
Enabled error: cannot obtain value Boolean
PlotAreaColor error: cannot obtain value System.Drawing.Color
PlotAreaImage error: cannot obtain value CWUIControlsLib.CWPictureDisp
TrackMode error: cannot obtain value CWUIControlsLib.CWGraphTrackModes
Font error: cannot obtain value System.Drawing.Font
PlotTemplate error: cannot obtain value CWUIControlsLib.CWPlot
ChartStyle error: cannot obtain value CWUIControlsLib.CWChartStyles
ChartLength error: cannot obtain value Integer
GraphFrameImage error: cannot obtain value CWUIControlsLib.CWPictureDisp
GraphFrameColor error: cannot obtain value System.Drawing.Color
ImmediateUpdates error: cannot obtain value Boolean
Caption error: cannot obtain value String
BackColor error: cannot obtain value System.Drawing.Color
ReadyState error: cannot obtain value Integer
Windowless error: cannot obtain value Boolean
CaptionColor error: cannot obtain value System.Drawing.Color
KeyboardMode error: cannot obtain value CWUIControlsLib.CWKeyboardModes
DefaultxInc error: cannot obtain value Double
DefaultxFirst error: cannot obtain value Double
DefaultPlotPerRow error: cannot obtain value Boolean
YDataAppend error: cannot obtain value Object
XYDataAppend error: cannot obtain value Object
YData error: cannot obtain value Object
XYData error: cannot obtain value Object
GraphFrameStyle error: cannot obtain value CWUIControlsLib.CWGraphFrameStyles
AnnotationTemplate error: cannot obtain value CWUIControlsLib.CWAnnotation
Plots error: cannot obtain value CWUIControlsLib.CWPlots
Axes error: cannot obtain value CWUIControlsLib.CWAxes
Cursors error: cannot obtain value CWUIControlsLib.CWCursors
CWBindings error: cannot obtain value CWUIControlsLib.CWBindings
Annotations error: cannot obtain value CWUIControlsLib.CWAnnotations
TraceType Actual Agilent.LWD.Ag86038x.UserInterface.ucODAGraph.TraceType
0 Kudos
Message 1 of 5
(9,168 Views)
I might be wrong, but I think component works uses
the mfc42.dll and vb.net uses mfc70.dll


Curt
0 Kudos
Message 2 of 5
(9,168 Views)
Therefore, your surmising that the CWGraph is incompatible with VB.Net.

Correct?

Has National Instruments released any information with regard to VB.Net?
0 Kudos
Message 3 of 5
(9,167 Views)
The graph control does use mfc42.dll, but there is no relationship between VB.NET and mfc70.dll.

Could you please provide more information about what you're doing in your application? For example, is the graph left alone for a few minutes or is data periodically getting charted/plotted to the graph? Are you handling any of the graph's events? Are you using bindings, and if so, what properties are you binding to? What other settings have you set on the graph? Can you reproduce this in a smaller application and if so, what are the minimum steps that it takes to create a project that reproduces this problem?

- Elton
0 Kudos
Message 4 of 5
(9,167 Views)
Found the problem.

It was a problem on how we were implementing threads and event handling in VB.Net(use invoke instead of raise event!). CWgraph is working perfectly now.

Thanks.
0 Kudos
Message 5 of 5
(9,168 Views)