05-24-2018 01:57 PM
Hi,
I was given a vi that is used in my lab to read data from an oscilloscope and output the data as a graph. My job is to replace the oscilloscope subvi with a vi that reads data from a power meter. I have virtually no experience in Labview, so any help or guidance on how to achieve this would be appreciated. I did try the replace function to replace the oscilloscope subvi with the power meter, but the input for each is different so this did not work.
The two programs will be attatched. The main program with the oscilloscope is called "main", while the power meter subvi is called "power meter". This power meter vi is what needs to replace the oscilloscope subvi. If needed, the power meter is a Newport 841 PE USB
Thanks for the help
05-24-2018 02:53 PM
Hi WT71652,
Normally it is quite easy to call one VI from another VI, but not in your case.
For one, the Main.vi is written very unclearly with a bunch of rube-goldberg constructs, so it's not easy to understand what is going on.
For two, the power meter VI is not meant to be run as a subVI. We can tell this, because the only way to make it finish running (and thus return back to your main VI) is to push a stop button. So you have to interact with the front panel every time the SubVI is called, this is not what you want unless it is meant to be a dialog. You could remove the while loop to make it a little more SubVI friendly, but my tendency would be to start from scratch on both of these!
05-24-2018 04:31 PM
Yeah, that code is a mess and I doubt you'll get any help deciphering it.
I'll help by showing you how to make the Power Meter subVI read and return data in a useable format. One comment I have is why does the current one require an array for the measurement data? Could it just be a single double?
What you will want to do is decipher the main VI you have and call the Power Meter subVI in a loop as shown. From there do the processing you need to do.
Figure out some LabVIEW basics from freely avaible course and you should be at least as good as the original author.
05-25-2018 07:15 AM
Thanks for the help. I'm honestly not sure why the current program outputs the data as an array, I'll look into that to see if it is possible to be a single double. What you gave me is very helpful though I really appreciate it.
I'll be looking into some tutorials so I will be able to understand everything more in depth.