LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with graphing data from DAQmx acquisition

Second problem, same program.Using LabWindows 8.1, Windows XP

I have a program that acquires data from a PCIe-6361 and displays it on an "o'scope" type display using a graph panel control.

The graph indicator (VSCOPE_SCREEN) is set up in the routine "VOSCOPE_Display_VOScope", which mostly sets up the various knobs and other controls.It is set up with Control Mode = "indicator,  Data Mode = "Retain", and "Smooth Update" set,

 

Most importantly, the data is graphed to the indicator in the routine "VOSCOPE_ReceiverDataHandler" at the end of the file:

DeleteGraphPlot(iHandle_VOscope,VSCOPE_SCREEN,g_iPlotHandle,VAL_DELAYED_DRAW);

g_iPlotHandle = PlotWaveform (iHandle_VOscope, VSCOPE_SCREEN, DataBuffer_p,
                                  BufferCount, VAL_DOUBLE, 1.0, 0.0, 0.0,
                                  d_Xinc, VAL_THIN_LINE,
                                  VAL_NO_POINT, VAL_SOLID, 1, VAL_RED);

RefreshGraph (iHandle_VOscope, VSCOPE_SCREEN);

 

The problem is that the graph is never drawn when VOSCOPE_ReceiverDataHandler is called unless I change one of the time axis knobs and cause a call to SetScopeTimeAxis() (via "CB_UpdateDelayMsec" or "CB_UpdateTB". Adding or subtracting the "RefreshGraph" call does nothing.

 

Thanks.

Download All
0 Kudos
Message 1 of 17
(4,458 Views)

Further on the last: SetScopeTimeAxis ends up calling "SetAxisScalingMode" to change the max and min for the horizontal axis. As this is also called when the program is initialized, I see no reason for why this should suddenly cause the graph to display data, but it does.

0 Kudos
Message 2 of 17
(4,457 Views)

Hello,

 

Does the call to RefreshGraph return an error (a negative integer)?

0 Kudos
Message 3 of 17
(4,430 Views)

Nope, returns '0'.

0 Kudos
Message 4 of 17
(4,420 Views)

Hello,

 

Would it be possible to create a simple, "software only" CVI project that demonstrates the issue?  If so, feel free to attach your workspace, project and source/header/UIR files in a ZIP.  That way I can take a look at the issue on my end.

0 Kudos
Message 5 of 17
(4,398 Views)

Sorry for taking so long. I isolated just the graphics stuff (but left the calls in, for reference), emulating the DAQmx calls. Run the VOscope_Test program and push the "Open VOscope Panel" button . The O'scope panel will display. (Move the O'scope panel, which always ends up on top of the other one) Press the "Test" button and it will generate some synthetic data and call the VOSCOPE_ReceiverDataHandler function that displays the data. Note that nothing displays until you move a knob, then the data displays.

Thanks

Paul

0 Kudos
Message 6 of 17
(4,302 Views)

Hi Paul,

 

Thanks for creating this.  What versions of which drivers would be necessary on a test machine to build and run this code?

0 Kudos
Message 7 of 17
(4,277 Views)

LabWindows/CVI 8.1.0

MAX 4.6.2

NI-DAQmx 9.1

Running on Windows XP Professional SP 3

0 Kudos
Message 8 of 17
(4,252 Views)

When the time-base knob is turned and the routine "SetScopeTimeAxis(...)" is called, it is the call to the User Interface Library routine "SetAxisScalingMode(...)" that causes the graph to show up properly. Why, and how to get it to show up before that point, I don't know yet.

0 Kudos
Message 9 of 17
(4,243 Views)

Hey Paul -

 

I took a look at your example, and have a quick question.  When the graph is first displayed, the range shown on the X-Axis is 495-505.  When the knob is turned (resulting in the call to SetAxisScalingMode), the range resets to 6-16.  Looking at the code, it appears you are beginning the plot at an x value of 0, with an x-increment of .2, and you are plotting 1024 values.  This would mean the valid x range for viewing data would only be from 0 to ~205.  It's difficult to verify this because the code you posted is too incomplete to build, but is it possible that before you turn the knob you're just viewing an x range that lies outside the data?

 

If this is not the case, is there any way you could post the complete code so that I can build and debug the program with you?  If you'd rather not post the code to the forum, you can always place it on our write only ftp site ( ftp://ftp.ni.com/incoming ).

 

NickB

National Instruments

0 Kudos
Message 10 of 17
(4,213 Views)