06-19-2023 06:54 AM
Hello All,
I`m trying to send pulse signals from my CompactRIO cRIO-9049 to the drivers of my stepper motors using the NI9401 module.
I`ve attached some code that first moves all axis until the limits switches register low on the 9375 module and in the second frame of the sequence I want to be able to move all axis with different frequencies a different number of pulses (more or less synchronized by the inner sequence). I`ve looped this sequence to check if it runs consistently.
The problem is that this code runs perfectly fine half of the time, but sometimes one or two motors stop working from one iteration to the next.
I think this behavior doesn`t occur when I put all my counter outputs in one task, but then I can`t send a different number of samples to each motor.
Can someone please explain to me why this code only works sometimes and what I can do to fix this problem.
Thank you in advance for the answers!
06-21-2023 10:07 AM
Hi,
"The problem is that this code runs perfectly fine half of the time, but sometimes one or two motors stop working from one iteration to the next."
Are there any error codes in your program? Usually if there is no signal output, the LabVIEW program should be throwing an error.
Also, I don't know if this applies to CompactRIO, but I know that for CompactDAQ there are only 4 onboard counters. See here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7eESAS&l=en-US
For the 1st part of your program, you're using CO continuous, which is using 1 counter per task (so total 3 counters.) However, when you move into 2nd part of program, you're using CO finite, which according to the article is using 2 counters per task (so total 6 counters needed, but there is only 4 available.)
Just a guess, I'm not 100% sure about this. But it's best to debug from error code if you have one.
BR
John
Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source NI hardware? Try NI Trading Post