03-02-2020 02:05 PM
Hi,
I'm using a Micronix PPS-20 piezomotor with digital encoder as a delay stage in an interferometer. I'm working to actively stabilize this interferometer by observing the phase shift on a CCD camera and sending this phase shift to a PID control loop linked to the motor. The code is written in LabVIEW 2011 and the functions used to move the motor are ones already written by Micronix and are too advanced for my level of experience.
The problem I am encountering is that the Move rel mMc.vi function is executing at a slower rate than I would like. I am looking to have my total code (phase analysis & PID included) run with an execution time of approximately 20-40ms. There are time delays, i.e. "wait milliseconds" within the function however even when modifying these, I am still only able to obtain an execution time of approximately 250ms.
Is there any way that this function could be sped up? I know for a fact that the main time lag in my main code is caused by this function since when it is disabled, the the main code can reach execution times along the lines of 30 ms.
I have attached below the VI's required to look at the run the Move rel mMc.vi.
Thank you in advance for any help or instructions that you can provide,
Philippe Burden
03-02-2020 02:26 PM - edited 03-02-2020 02:26 PM
Hi Phil,
@PhilBurden wrote:
Is there any way that this function could be sped up? I know for a fact that the main time lag in my main code is caused by this function since when it is disabled, the the main code can reach execution times along the lines of 30 ms.
I have attached below the VI's required to look at the run the Move rel mMc.vi.
The most time consuming part should be those VISARead/Write functions: your device needs some time to process commands and to send answer messages. I don't think you can improve speed a lot (after very short inspection)…
You should clean up the whole thing, lots of old code and stacked sequences, combined with overuse of local variables…
(There even is a project file missing and no indication of the main VI!)
03-02-2020 02:43 PM
Thank you for your input and rapid response. It is not my original VI, but I will definitely clean up jumbled and unnecessary code. As for the project file and main VI, I didn't think it was necessary to include the main VI since i didn't think it would be relevant. Did you want me to attach it?
Project file? I don't have a project file, I think. I am relatively new to LV.
Thanks again,
Phil