06-21-2023 10:30 AM - edited 06-21-2023 10:37 AM
Hi,
I am using LabView 2023 Q1 to create a motor control and start data acquisition. I am using a ThorLabs KDC101 Motor Controller and a simulated data acquisition tool through NIMAX (a USB 6361 - BNC). The general idea is: the motor will move by a set step size, the motor will stop due to a preset delay, during this delay data will be acquired and written to a file, and the cycle repeats until the end position is reached. After the end position is reached, I want to average the data values in each row of the file and obtain one vector.
I have achieved the motor movement, but the time delay I have step up between steps keeps returning an error (Thorlabs.MotionControl.DeviceManagerCLI.MoveTimeoutException. I am also struggling on how to write the data I am simulating to a file.
Solved! Go to Solution.
06-21-2023 10:39 AM
If you could post the VI or VIs you have made so far we could give much better advice. If you do, it's best to use File»Save for Previous Version to save it as 2020 or earlier since a lot of us don't use the most recent version.
I have used Thorlabs before and the error you are mentioning usually happens because the motor move doesn't complete before the timeout you set. The default timeout is pretty generous so if you get this error it's often because you have done an exceptionally slow and/or long distance move, or because you lowered the timeout value quite a lot.
06-21-2023 10:50 AM
Thank you for your reply. I attached a zip file with my project and VI. Do you have a recommendation for how long I should set the time out?
06-21-2023 07:26 PM
50 ms is definitely too short of a time...
I usually use a fairly generous timeout, something like taking the time I expect each motor move to take, then adding 5 seconds. Generally Thorlabs will get very close to position pretty close to the expected time if you take the acceleration, deceleration, speed, and distance to move into account, but it seems like sometimes there's a bit of time at the end where it does a fine adjustment to get to the exact position, so you want to be pretty generous to give it time to correct the last few microns that it's off-position before it declares itself done moving.
06-22-2023 03:51 PM
Thank you very much! Follow-up question: I am attempting to save my simulated data to an excel file.
Currently, all simulated data is saving in one column, no matter how many iterations of measurements are taken (for example, if I set the motor step size to 1 and end position to 4, there will be 5 iterations). I would like my data to save to an excel file with iteration amount of rows and number of samples amount of columns.
I'm only using one channel, so if I try to use an array, I am unsure how to change it since my data is 1D.
06-23-2023
07:48 PM
- last edited on
11-07-2024
03:39 PM
by
Content Cleaner
You could try wiring the waveform output to the edge of your while loop, right click the output tunnel to change it to "indexing", and then wire the 1D array of waveforms you get to this VI: