Hello alexey_3269,
If you want to read a quadrature encoder start with gpctex1.cpp and follow the thread.
I give you my code:
BEGIN CODE
==========
boardGpct->G0_Mode.writeG0_Load_Source_Select(tTIO::tG0_Mode::kG0_Load_Source_SelectLoad_A);
boardGpct->G0_Load_A.writeRegister(InitialCount);
boardGpct->G0_Command.writeG0_Load(1);
boardGpct->G0_Load_B.writeRegister(0);
boardGpct->G0_Load_A.writeRegister(0);
boardGpct->G0_Input_Select.setG0_Source_Select(9); //see above for choices, PFI8=9, 100 kHZ=18
boardGpct->G0_Input_Select.setG0_Source_Polarity(1); //0=CCW, 1=CW
//If using 80 MHz timebase
boardGpct->G0_MSeries_Counting_Mode.writeG0_MSeries_Alternate_Synchronization(1);
boardGpct->G0_MSeries_Counting_Mode.setG0_MSeries_Encoder_Counting_Mode(3); //3 for X4 encoder counting
boardGpct->G0_MSeries_Counting_Mode.flush();
//Enable Input Pins
boardGpct->G0_MSeries_ABZ.setG0_A_Select(9); //PFI8=9,
boardGpct->G0_MSeries_ABZ.setG0_B_Select(21); //PFI10=21
boardGpct->G0_MSeries_ABZ.setG0_Z_Select(10); //PFI9=10
boardGpct->G0_MSeries_ABZ.flush();
boardGpct->G0_Mode.setG0_Gate_Polarity(1); //invert=1
boardGpct->G0_Mode.setG0_Output_Mode(tTIO::tG0_Mode::kG0_Output_ModePulse);
boardGpct->G0_Mode.setG0_Loading_On_Gate(tTIO::tG0_Mode::kG0_Loading_On_GateNo_Reload);
boardGpct->G0_Mode.setG0_Loading_On_TC(tTIO::tG0_Mode::kG0_Loading_On_TCRollover_On_TC);
boardGpct->G0_Mode.setG0_Gating_Mode(tTIO::tG0_Mode::kG0_Gating_ModeLevel_Gating); //kG0_Gating_ModeGating_Disabled
boardGpct->G0_Mode.setG0_Gate_On_Both_Edges(tTIO::tG0_Mode::kG0_Gate_On_Both_EdgesBoth_Edges_Disabled);
boardGpct->G0_Mode.setG0_Trigger_Mode_For_Edge_Gate(tTIO::tG0_Mode::kG0_Trigger_Mode_For_Edge_GateGate_Starts_TC_Stops);
boardGpct->G0_Mode.setG0_Stop_Mode(tTIO::tG0_Mode::kG0_Stop_ModeStop_On_Gate);
boardGpct->G0_Mode.setG0_Counting_Once(tTIO::tG0_Mode::kG0_Counting_OnceNo_HW_Disarm);
boardGpct->G0_Mode.setG0_Reload_Source_Switching(tTIO::tG0_Mode::kG0_Reload_Source_SwitchingAlternate);
boardGpct->G0_Mode.flush();
boardGpct->G0_Command.setG0_Up_Down(tTIO::tG0_Command::kG0_Up_DownHardware); //kG0_Up_DownSoftware_Down
boardGpct->G0_Command.setG0_Bank_Switch_Enable(tTIO::tG0_Command::kG0_Bank_Switch_EnableBank_X);
boardGpct->G0_Command.setG0_Bank_Switch_Mode(tTIO::tG0_Command::kG0_Bank_Switch_ModeGate);
boardGpct->G0_Command.flush();
boardGpct->Interrupt_G0_Enable.setG0_TC_Interrupt_Enable(0);
boardGpct->Interrupt_G0_Enable.setG0_Gate_Interrupt_Enable(0);
boardGpct->Interrupt_G0_Enable.flush();
I hope this code is appropriate to you.
FV1234