05-16-2012 02:05 PM - edited 05-16-2012 02:07 PM
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(nCounter::kReloadOnStopGate, &status);
counter->Gi_Mode_Register.setGi_Trigger_Mode_For_Edge_Gate(nCounter::kGateLoads, &status);
and
counter->Gi_Counting_Mode_Register.setGi_Index_Mode(indexMode, &status); //indexMode = nCounter::kIndexModeSet;
Can anyone tell me what is wrong? Do I miss something?
Thanks,
Larry
05-23-2012 04:14 PM
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.
05-24-2012 08:33 AM
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(nCounter::kReloadOnStopGate, &status); counter->Gi_Mode_Register.setGi_Trigger_Mode_For_Edge_Gate(nCounter::kGateLoads, &status); counter->Gi_Counting_Mode_Register.setGi_Index_Mode(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)