From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Keyence for Angular Measurements

First off, I'm by no means a veteran of LabVIEW. I've had it for about a month now.
 
Anyway, I'm working on a VI to process the output of a Keyence laser measurement tool.
The laser will be targeted perpendicularly at a point n-millimeters from the axis of an oscillating motor.
The VI should measure Frequency, peak-to-peak amplitude, evaluate amplitude against a limit, represent all this on a graph, and other various small tasks as needed. All based on a DAQ reading of the laser output.
 
I have already made some progress on it but I do not know how well it will perform on other, possibly slower, machines. Also, I already figured out that a node really slows down my execution by several times, and I'm wondering what other things could be done to optimize the speed of the whole loop.
 
If anybody is willing, could you tell me how it performs on other machines? I am looking to keep the loop execution under 2 mS total, but I want to be able to do that while adding another laser. Your feedback is appreciated, but there is not a time crunch. Thanks! 🙂
____
Ryan R.
R&D
0 Kudos
Message 1 of 4
(2,258 Views)
Well don't all stand up at once! 🙂
 
Seriously, no feedback or constructive criticism?
____
Ryan R.
R&D
0 Kudos
Message 2 of 4
(2,235 Views)

Hi morgol,

There are a couple of things you might want to consider if would like to further optimize your code. For example, depending on which version of LabVIEW you have, you may want to use the VI Profiler to see which VIs are taking up most of your resources. And depending on your available toolkits, you might also want to check out the VI Analyzer toolkit. Other considerations are to take advantage of LabVIEW's multicore capability and parallelize your code. From what I have seen, overall, your code seems pretty solid. The only part that I would perhaps change is how you build your Limit Array. I'm not sure how often you will be changing these limits, but it seems pretty redundant to have to recompute them at every iteration.

Using the Profile Performance and Memory Window

VI Analyzer Toolkit

Optimizing VI Performance

Improving the Performance of your LabVIEW applications

Multicore Programming Fundamentals

I hope this help,

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 3 of 4
(2,228 Views)
I have LabVIEW 8.5.1 Full.
 
I was thinking the same thing on the limits, so I will probably move the code outside the main loop. Right now, it can be handy to change them on the fly for testing, but in the final application, the limit wouldn't need to be changed for days, weeks, or maybe more. That shaves off about 10 µS each iteration, IIRC.
 
Thanks for the feedback! 🙂
____
Ryan R.
R&D
0 Kudos
Message 4 of 4
(2,221 Views)