Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

X series PCIe-6351 encoder reset

Hi,

 

I am working on the X series PCIe-6351 encoder input by using an example gpctex4.cpp from X series DDK. It seems counting fine. However, it doesn't reset the counter even it is setup as follow:

 

counter->Gi_Mode_Register.setGi_Loading_On_Gate(nC​ounter::kReloadOnStopGate, &status);

counter->Gi_Mode_Register.setGi_Trigger_Mode_For_E​dge_Gate(nCounter::kGateLoads, &status);

and

counter->Gi_Counting_Mode_Register.setGi_Index_Mod​e(indexMode, &status);  //indexMode = nCounter::kIndexModeSet;

 

Can anyone tell me what is wrong? Do I miss something?

 

Thanks,

Larry

 

0 Kudos
Message 1 of 3
(7,732 Views)

Hello,

 

What are you doing to reset the counter after you make these changes to the example?  For instance are you connecting a 5V signal to the Z input (PFI2)?

 

With your changes, connecting 5V to the Z input results in the encoder seeing a 0 degree rotation change....which is a reset.

 

Thanks,

Steven T.

0 Kudos
Message 2 of 3
(7,705 Views)

LarryL wrote:

I am working on the X series PCIe-6351 encoder input by using an example gpctex4.cpp from X series DDK. It seems counting fine. However, it doesn't reset the counter even it is setup as follow:

 

counter->Gi_Mode_Register.setGi_Loading_On_Gate(nC​ounter::kReloadOnStopGate, &status);
counter->Gi_Mode_Register.setGi_Trigger_Mode_For_E​dge_Gate(nCounter::kGateLoads, &status);
counter->Gi_Counting_Mode_Register.setGi_Index_Mod​e(indexMode, &status);  // indexMode = nCounter::kIndexModeSet;

 

Can anyone tell me what is wrong? Do I miss something?

 


Just closing the loop in case others search and find this post later. Larry shared his resolution in another thread:

 

X series PCIe-6351 encoder reset

http://forums.ni.com/t5/Counter-Timer/X-series-PCIe-6351-encoder-reset/m-p/1996057#M10458

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 3 of 3
(7,698 Views)