09-19-2019 01:34 PM
Hi Everybody,
I am fairly new to labview and I have a big problem that is preventing me to move forward with my research. So to make it quick, I have a power meter that i am connecting through VI and then I have created the Case Structure to manually choose the time when i want to do measurements. In this Case structure i want to take values from my power meter but also the time of the measurement. I need this Time values to create a XY graph (After couple transformation of the data from the power meter). I have prepared some code for this but when I was testing it in my lab it didn't work properly.
Can you help me or atleast give me some advice because right now i am pretty hopeless.
Best Regards
Andrzej
Below I present you screenshots of my work:
09-19-2019 02:07 PM
Use Get Date/Time In Seconds to get a timestamp.
09-19-2019 02:12 PM - edited 09-19-2019 02:15 PM
I have absolutely no idea what you're trying to do. When you say "didn't work properly" what do you mean? What is going on in those subvis with the generic icons (you should really make icons that are more meaningful)? Since you didn't include your code I can only take guesses from your picture. You're taking the output from vi3 (for lack of a better description) and reporting that value along with the time difference when you hit switch for measurement. Prior to that your output arrays will contain whatever is in the FALSE case. Depending on how you have the Switch for measurement control set the vi may continue as True or False.
Edited to add: It's really a bad idea to have autoindexing outputs on a while loop as your arrays can grow large. Every iteration of the loop will add values until you exit the loop.
09-19-2019 06:09 PM
All I see is Rube Goldberg code. Your x and y array sizes are most likely completely unrelated. Yes, autoindexing tunnels are a bad idea on while loops, but at least make them conditional.
I strongly recommended to go back to the basic tutorials.
09-20-2019 04:09 AM
It seems you're starting and stopping the measurement and try to filter out 'dead' measurements afterwards?
As Altenbach mentioned, it's a lot better to set the while loop border to conditional and simply _not_ add those values to the array when in non measurement mode. With the current solution you'll need to filter the measured array in the same loop as you filter the times as those array will end up different sizes otherwise.
/Y
09-24-2019 08:46 AM
Hi,
Thank you for the answer and the questions regarding this case.
I should have add the code earlier but I didn't had access to that at the time I was writting this post.
The subvis with the generic icons are provided by the producent of power meter and the one that is out of the loop provides connection to the device and the other one gives data from the power meter.
What i meant when i said that it doesnt work properly was that I want to get the real time of measurement that happens in Case Structure "True" case. This time have to be in miliseconds and then I want to put values from power meter on Y axis and Real time values in miliseconds on X axis. As you can see there is also some operation on the data that I gather from the power meter but It's not the case of the problem that I am struggling with.
Please find attachement with my VI (You can put random data instead of power meter values from subvis).
Best Regards
Andrzej
09-24-2019 09:22 AM
Right click on each of your output tunnels and select "Conditional". Connect your boolean control to the ? that is now on the output tunnel. You will only have data in your array when the boolean value is TRUE. If I understand correctly this is what you want.