04-03-2009 04:38 PM - edited 04-03-2009 04:41 PM
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
Solved! Go to Solution.
04-04-2009 07:05 PM
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.
04-04-2009 07:31 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-06-2009 01:29 PM
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!