Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CNiUInt16Vector problem

I am new to Measurement Studio, and am trying to get a Graph into my dialog. I got hte control on the dialog tool bar, and onto the dialog, went and added a control variable with the Class Wiizard... now I want to plot some data, and I get errors during compiles from the following:
 
 unsigned char *buf;
...
 buf = new unsigned char[xfer_len];
...
for(...
 len = m_xem->ReadFromPipeOut(0xb1, pkt_len, buf+(pkt_len*i));
...
 m_CNiGraphCtrl1.PlotY( (CNiUInt16Vector)buf);
0 Kudos
Message 1 of 3
(3,349 Views)

Forgive my tab followed by spaces....

To continue:

I get the following compile warning:

C:\PROJECTS\QUADRASPEC\QUADRASPECBETA\SOFTWARE\QUADTEST\QuadTest\UsbPipe.cpp(984) : warning C4800: 'unsigned char *' : forcing value to bool 'true' or 'false' (performance warning)
 
and it looks like it scaled the graph to 65535y by 0x.
 
this is a full scale sawtooth when I print hte numeric data...
 
Help!!!
 
Bill
0 Kudos
Message 2 of 3
(3,348 Views)

Bill,

Is there a particular reason you made your buffer (i.e. unsigned char *buf) an array of characters instead of using the CNiUInt16Vector data type directly?  It seems that the error is being caused by the casting of your buffer into the CNiUInt16Vector data type.  Could you use the Vector type directly?

Also, a great place to start learning about Measurement Studio and graphing is the great examples that come with the product.  You can find them in the following directory:

<Measurement Studio>\VC\Examples\Ui\Graph

You can run these examples and see graphing in action.  Furthermore, you can use them as the foundation of your own application.

Regards,

Santiago D

0 Kudos
Message 3 of 3
(3,333 Views)