From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does GPCTR_Watch(,,ND_AVAILABLE_POINTS,) increment the read mark?

Hi,

If I use GPCTR_Watch(,,ND_AVAILABLE_POINTS,) to determine when a certain number of points are available before reading a buffer, the subsequent GPCTR_Read_Buffer(,,ND_READ_MARK,,,,,) call returns a timeOut error.

If I use GPCTR_Watch(,,ND_READ_MARK,) and GPCTR_Watch(,,ND_WRITE_MARK,) and subtract the two to determine the number of available points, I have no problem with the subsequent call to GPCTR_Read_Buffer(,,ND_READ_MARK,,,,,).

Does this mean that GPCTR_Watch(,,ND_AVAILABLE_POINTS,) actually increments the read mark? If so, is this as NI intend or is it a bug.

I am using NI-DAQ 6.9.3 and CVI 6.0.

Regards

Jamie Fraser
0 Kudos
Message 1 of 3
(2,706 Views)
Hi Jamie:

I modified the \samples\daq\Ctr\TIOcircularBufEventCount.c to include the GPCTR_Watch(,,ND_AVAILABLE_POINTS,) line just before the GPCTR_Watch(,,ND_READ_MARK,) statement, but could not get it to hang or time out.

Have you tried running the GPCTR_Watch in the function panel by itself and see if it runs there?

Also FYI, in CVI 7.0 the ND_AVAILABLE_POINTS option for GPCTR_Watch has been reserved.

Please let me know if you can run the GPCTR_Watch in the function pannel by itself. Also try modifying the TIOcircularBufEventCount.c to see if you can reproduce the behavior.


Regards,
Bharat Sandhu
Applications Engineer
National Instruments
Penny
0 Kudos
Message 2 of 3
(2,706 Views)
Hi Bharat,

I have run the example you mention, and if I don't suppy any pulses (just click the StdIO window) I get the -10800 TimeOut error that I mentioned before.

What I was trying to so in my application was to test for pulses using GPCTR_Watch(,,ND_AVAILABLE_POINTS,) then call GPCTR_Read_Buffer(,,ND_READ_MARK,) with a timeout defined as zero so the function returns immediately is not enough data points are available. However, if you have tested for the number of available points using GPCTR_Watch(,,ND_AVAILABLE_POINTS,), you would expect to then be able to retrieve them using GPCTR_Read_Buffer(,,ND_READ_MARK,).

However, as I said in my first post, this cannot be done as the GPCTR_Watch(,,ND_AVAILABLE_POINTS,) call seems to have advanced the re
ad mark. I would not class that call as a read, same as I would not class GPCTR_Watch(,,ND_READ_MARK,) as a read, just a check on status.

Look forward to your comments.

Regards

Jamie

PS. Could you explain what you mean by ND_AVAILABLE_POITS having been reserved in CVI 7.0
0 Kudos
Message 3 of 3
(2,706 Views)