02-04-2025 09:47 PM
Dear Community,
I am experiencing an issue while using the Kinesis KCube stepper motor to control stage motion in LabVIEW.
Following the Kinesis LabVIEW guide, I successfully implemented .NET control and can operate the KCube motor.
(https://www.thorlabs.com/Software/Motion%20Control/Kinesis/Kinesis-labview.pdf)
However, when running long-duration measurements (>30 minutes), I encounter the following error:
I was able to control the Kcube motor but the Error 1172 happens when I run the long-time measurement (>30m)
It says 'Error 1172 occurred at Invoke Node Error calling method
Thorlabs.MotionControl.KCube.StepperMotorCLI
-KCubeStepper.MoveAbsolute,
(Thorlabs.MotionControl.DeviceManagerCLI.Dev
iceMovingException: Device already moving)'
I attempted to resolve the issue by introducing a 500 ms interval between successive movements to avoid conflicts. However, this modification did not resolve the problem, and the error persists.
Additionally, I observed that if I manually click "Continue" in the error message prompt, the measurement resumes temporarily. However, the same error message reappears after a short period.
I would like to understand the underlying cause of the "Device already moving" exception. Could this be due to a conflict between sequential movement commands?
Are there any recommended approaches to ensure smooth and uninterrupted operation for long-duration measurements?
Any guidance or insights would be greatly appreciated.
02-05-2025 01:08 AM
Hi salsberry,
@salsberry wrote:
I would like to understand the underlying cause of the "Device already moving" exception. Could this be due to a conflict between sequential movement commands?
Are there any recommended approaches to ensure smooth and uninterrupted operation for long-duration measurements?
Error 1172 comes from calling external code, like dotNET nodes.
And the error message tells you the reason why that external part of software failed…
So the device driver tells you that the "device is already moving". I learned from our XY stage that sometimes the device might take longer, and will also answer with errors when there are reasons why it couldn't reach the target position in specified/expected time. You need to handle such errors in your code!
In the end it boils down to RTFM…
02-05-2025 11:39 AM
The error popup you see there, along with the behavior from the "Continue" and "Stop" button, are part of an optional feature of LabVIEW toggleable per VI, called automatic error handling. You get that popup whenever you have a node generate an error but there's no wire attached to the output of the "error out".
Most developers who progress beyond the beginner stage turn this off and handle errors manually. I recommend learning how to do that.
For your actual issue, instead of just blindly moving or waiting a fixed amount, I recommend checking the "Is device busy" property, and only continuing if it's not busy.
Extremely simplified example: