From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution speed of a Micronix function

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

0 Kudos
Message 1 of 3
(2,093 Views)

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!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,075 Views)

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

0 Kudos
Message 3 of 3
(2,064 Views)