02-04-2022 03:59 PM
Hello NI community,
We have an application that requires pulse generation at very specific position.
First of all, I am using NI USB-6341 OEM, an Optical linear encoder system RGH24X30A00A (Signal period is 4um, Resolution is 1 um) and a Camera receiving the triggers ( I can't disclose manufacturer/model number)
disProf : Physical distance between triggers.
startPosition : Physical position where the trigger pulse train must begin.
nProf : Number of trigger contained in the pulse train.
The goal is this :
from currentPos, the machine travels to startPosition where the Finite pulse train begins.
from startPosition, every disProf distance should have a trigger generated.
There is nProf amount of disProf
I am using DAQmx C functions this way :
errCode = DAQmxCreateCOPulseChanTicks(m_3DTriggerTask,
TRIGGER_3D_COUNTER,
"",
ENCODER_Y_PIN_A,
DAQmx_Val_Low,
disToStartCnt,
highPulses,
lowPulses);
if (DAQmxFailed(errCode))
Log << err << CURRENT_FUNCTION << " Can't create 3D trigger output channel. Error " << errCode << endl;
errCode = DAQmxCfgImplicitTiming(m_3DTriggerTask, DAQmx_Val_FiniteSamps, nProfHw);
if (DAQmxFailed(errCode))
Log << err << CURRENT_FUNCTION << " Can't set continuous mode for clock. Error " << errCode << endl;
Now to the issue ;
the DAQmxCreateCOPulseChanTicks methods uses one phase of the encoder as tickbase input (ENCODER_Y_PIN_A), there's a lot of noise in our environnment on a single phase of the encoder and that makes the NI board behave not like we expected.
I am looking for DAQmx C functions that could take in the counter associated with the encoder decoding as input for generation of trigger pulse.
Thank you for your help.