From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm working with ComponentWorks and V

isual Basic. When I try to plot a graph(on a VisualBasic Active X page using CWGraph) with the data that has been acquired from a datasoket server, I get a run-time error 5 that says "array dimension mismatch". Does anybody have a solution to this problem?
0 Kudos
Message 1 of 2
(3,047 Views)
isual Basic. When I try to plot a graph(on a VisualBasic Active X page using CWGraph) with the data that has been acquired from a datasoket server, I get a run-time error 5 that says "array dimension mismatch". Does anybody have a solution to this problem?You must make sure that if you store the data array in the event handler you set up for OnDataUpdated into a new array, that it is the same size as the array parameter to the handler "Data". Also you should use the attributes found in the CWDatasocket.Data member to see how the data is formatted on the socket and make sure your array matches.

What else you might try if you have ComponentWorks 3.0 is try binding your CWGraph object through its property page to the url of your socket on the server. This way you can avoid any programming mishaps altogether. If you want you can still have access to the socket updating events directly through the graph control's own CWbindings object. This keeps you from having to use the CWDatasocket control altogether. Use VB's object bro
wser to look at all of the members of the control, and also look over the ComponentWorks online help for more information.

So to summarize, make sure that you are not trying to put the data into an invalid array, and also try out the cool binding features if you have them.

Jason Foster
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,047 Views)