01-30-2018 05:30 PM - last edited on 01-31-2018 12:15 PM by Kristi_Martinez
I am using a set of 6 Anaheim Automation DPN10601's to control 6 different stepper motors. When running my experiments, I feed the command to move X steps, pause then command the motor to move X steps again. It will work N times, but on the N+1 time, it will turn a random amount, sometimes 10 or more times what it should have. I attached my code for reference.
I will note that my box tells me I have a "Range Error," but when I send the exact same commands via direct talk using Tera Term, I do not get an error light.
I am going crazy trying to fix this!
01-31-2018 01:16 AM - edited 01-31-2018 01:24 AM
Hi WildCat,
I am going crazy trying to fix this!
I can understand that after noticing all those race conditions in your subVIs, especially in the DPD75601_original.vi!
Get rid of those race conditions and use more wire instead of local variables and "value" property nodes!
(This seems to apply to all your VIs: way too much locals and sequence structures!)
Edit: found more problems like
- initializing a serial port in parallel with a serial port write function. (Just another kind of race condition…)
- setting up DAQmx tasks without clearing them
- comparing floats for equality (like "== 0.1")
General suggestion for such problems: it helps to implement a debug logging algorithm! You could write all commands send over the COM port to a text file (with a timestamp) to check for malformed commands…