LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform multiple measurements and displaying graphs/indicators without repeating the same code for every input (dozens inputs)?

Solved!
Go to solution

I have to repeat the same measurements and display them in the front panel (fft graphs and other indicators).

Do I need to repeat the same code for every channel/input? I already have too many channels and every time I change a measurement (and the code) for one input/channel, I have to repeat the changes to all the other inputs.

Thanks

Message Edited by mjochinsen on 04-03-2009 04:41 PM
0 Kudos
Message 1 of 4
(2,677 Views)
Solution
Accepted by topic author mjochinsen

I may be missing something, but it sounds like you'd do well to learn about using SubVIs to reuse code.  Just select the repeated block of code, click Edit, Create SubVI and you'll have a reusable block to apply to each input (and Bob will be your uncle).  Now, any time you need to change your measurement you can change the SubVI and every place you use it will benefit.

 

I'd also like to suggest that you clean up the Block Diagram and Connector Pane that are generated because they're sure to be ugly.  If you're really ambitious, you can try the SubVI Fixer on LAVA.

 

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 4
(2,642 Views)
I'd like to point out that if you have an array of dozens of measurements, and an array of dozens of scale factors, and another array of dozens of offsets, then you can multiply the measurements X the scale factors in one operation, and add the offsets in another, and you have dozens of values for display.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 4
(2,639 Views)

Yes, I think I did not provide enough details.

 

I wanted the images of the controls to create a report.

 

I solved the problem by creating a subVI (as suggested) and a vector of scaling factor as input (also suggested).

This subVI output is a cluster containing all the measurements, front panel saved image path, errors, etc...

I was stuck at the front panel image. But is easy by using Create»Invoke Node»Get Image, then the Write JPEG File VI to save the image in the JPEG format.

 

Thank you gentlemen!

0 Kudos
Message 4 of 4
(2,597 Views)