07-14-2010 10:04 AM
Hello,
I am a beginner user to LabVIEW, so perhaps I am making a silly error, but I have reached a roadblock nonetheless. To give a little background, I am using LabVIEW 7.0 and I am designing a DAQ system to monitor UV detectors that our company manufactures for calibration purposes. I am starting from the ground up by using simulated signals to get the code right. I want to collect data points from my detector at a rate of 1Hz and sum them into half-hour dosages. I plan to eventually create a subVI to moitor each detector and put them all together in one VI such that I can monitor up to 20 at a time using my NI PCI6225.
The problem that I am having is regarding the 'Elapsed Time' VI. For my test program, I want to be able to sum the simulated signal into dosages of a defined time interval. I chose 5 second intervals because it is easy to monitor for a test (it will eventually become 1800 seconds for the final VI). When I choose 5 seconds, however, I get very strange results in the data printed with the 'Write LabVIEW measurement file' VI. It apears to count the '0 second' as a second, and uses 6 second intervals rather than the 5 second intervals that I want it to use. It also has some strange behavior in that it will jump to 7 second intervals for no apparent reason (this occurs very rarely, <10% of the times that I have tried the program).
Any idea how to fix this timing issue in this subVI? Would I be better off creating the timer out of raw elements on my own? If so, how would I go about doing so, as I am still very new to this software?
I've attached the VI for inspection.
Also, I have a second question that is mostly unrelated, but I might as well ask at the same time. How do I get labview to use time stamps (HH:MM:SS) when reporting the x-axis time values rather than seconds since the start of measurement?
Thanks,
Ben
07-14-2010 10:16 AM
Here is an updated vi with timing done a different way. Have you looked at timing on your loops? You also need to add a wait inside your loop. This could be set to 10 ms. If things in your code are taking longer than 5 seconds to execute then you may need to switch they way you are producing and consuming your data and saving it.
07-14-2010 10:35 AM
@aeastet wrote:
Here is an updated vi with timing done a different way. Have you looked at timing on your loops? You also need to add a wait inside your loop. This could be set to 10 ms. If things in your code are taking longer than 5 seconds to execute then you may need to switch they way you are producing and consuming your data and saving it.
Any chance you can retro-convert that vi so I can view it using LabVIEW 7.0? If not, can you atleast post a screencap?
07-14-2010 11:42 AM
I can not go back to 7.0 so here is a screen shot.
07-14-2010 02:38 PM - edited 07-14-2010 02:39 PM
Thanks for that image. I think I added everything correctly, however there was one structure I couldn't identify from my version of labview 7.0 (shown in image below). What is this structure/loop called and do you know what menu it is located within?
With the changes I made, the time intervals display as they should. Unfortunately, however; the code I added prevents the 'summation' VI from working. I added another indicator which reveals that the summation VI is reporting the same value as the data that is passed into it.
Ideally what I want is for the summation VI to add together all 5 data points from the 5 second interval, then reset to 0, then add the next five, reset to 0...etc. Do I need do add the structure that I couldn't identify?
Thanks,
07-14-2010 03:16 PM
First of all it looks like you add the code correctly. Second the code you added should have no effect on the summation VI. Check to make sure that all of the lines are going to the right place. Use the light bulb to check to see if everything is working the way you expect. Probe everything and see where the problem is.