Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

GPCTR_Watch porting problem

Hello?

 

My device is PCI-6025E and GPCTR_Watch function can't be ported to DAQmx clearly as long as I know.

The last parameter of this function is entity value which ranges from 0 to 224 - 1 in E series.

 

We used this third parameter to count up DMI samples that is feeding PFI3 pin. But there seems no way to count this DMI with any DAQmx code. How can I count this up just like MAX test panel does? The MAX test panel counts from 0 to 224 - 1.

 

Thanks, 

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 1 of 6
(4,897 Views)

Hello Anarkie,

It looks like you're looking to perform a count edges task. There is an excellent group of examples in the NI Example Finder that shows how to perform these types of tasks in NI-DAQmx. It would be best to start with the Count Digital Events VI.

Example Finder.jpg

Let me know if you have any questions about any of these examples.

Regards,
Dan King

0 Kudos
Message 2 of 6
(4,887 Views)

Ah...I'm looking for Visual C++ solution not VI...

 

Thanks anyway.

 

 

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 3 of 6
(4,885 Views)
Hello Anarkie,

You can find DAQmx ANSI C examples for the same type of function by going to Start»All Programs»National Instruments»NI-DAQ»Text-Based Code Support»DAQmx ANSI C Examples and then navigating to Counter\Count Digital Events\Cnt Dig Events. This should be what you are looking for to run in a Visual C++ application.

Regards,
Dan King

0 Kudos
Message 4 of 6
(4,883 Views)

Hello?

I know there is a function called DAQmxErrChk (DAQmxReadCounterScalarU32(taskHandle,10.0,&data,NULL)); in that folder.

 

But I really wonder the data parameter of DAQmxReadCounterScalarU32 is equivalent to the third parameter of GPCTR_Watch function.

 

Thanks,Robot wink

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 5 of 6
(4,880 Views)
Hello Anarkie,

The GPCTR_Watch function is defined as follows (from the Traditional NI-DAQ (Legacy)™ C Function Reference Help, Version 7.x😞

"status = GPCTR_Watch (deviceNumber, gpctrNum, entityID, entityValue)"

The third parameter, entityID, is described as the "identification of the feature you want to monitor". The correct correlation of the &data parameter would be the fourth parameter of the Traditional NI-DAQ function, entityValue.

Regards,
Dan King

0 Kudos
Message 6 of 6
(4,860 Views)