04-23-2025 04:36 AM
Hello,
I would like to be able to read an angular position provided by an encoder. I've tested the example provided, which reads without a clock, and it works without a problem. However, when I try with the example which requires to choose a clock, whatever my selection, the program loops to infinity (there is -1 on the timout) and no reading is made.
Here the inputs :
And the VI:
04-23-2025 04:39 AM
Hi Baptiste,
@Baptiste.Guilleux wrote:
However, when I try with the example which requires to choose a clock, whatever my selection, the program loops to infinity (there is -1 on the timout) and no reading is made.
Did you choose an actual clock signal?
(When there is no clock signal then there will be no samples…)
04-23-2025 06:17 AM - edited 04-23-2025 06:19 AM
Hi GerdW,
Thank you for your answer.
I don't think I understand what a clock is exactly.
I have selected this clock for testing cDAQ1/Segment1/ai/SampleClock.
Can NI MAX tell me which clock to use?
Best regards,
Baptiste
04-23-2025 06:18 AM
You configure the ai sample clock as the sample clock source, but did you run any AI task to generate the clock
If you didn't, refer to Performing Correlated Digital IO with an M Series Device in LabVIEW to start a dummy AI task.
04-23-2025 06:31 AM
Hi ZYOng,
Thank you for your answer.
I have selected this clock just for testing. I am using the ctr2 counter and I wanted to use the associated sample clock :
but I got the following error :
How do I know which clock should I use ?
04-23-2025 07:21 AM
I have found this solution :
It seems to work, what do you think ?
I have another question, I have 2 coder connected on my ni-9402 (ctr2 and ctr3). Is it possible to read the angular position of both coder simultanously ?