07-08-2014 01:12 PM
Hey guys,
So I have this program that generates pulse signals using NI-SCOPE, and I had originally done it so that each time the user presses an OK button they will perform certain calculations to generate a value which is stored into an array. My mentor now wants me to make it so that it continuously generates the pulse signals (not just one signal) and adds the values to an array. I need to use the N Samples setting on NI SCOPE so the signal looks as it does in the code below, although if someone has a way to change that, that would be good too.
So basically, how do I perform continuous calculations on pulse signals generated automatically over time? The user should only have to run the program, and the computer does everything else.
Thanks!
Solved! Go to Solution.
07-09-2014 11:25 AM
You need to migrate to a Producer/Consumer structure. In the Producer loop acquire the data contimuously and pass it to the Consumer loop. In the consumer loop, analyze the data and store the data as needed.
A variation on the theme that I would recommend is that rather than using a queue to pass the data, use a user-defined event. The reason for this change is that your present code (which is essentially what will end up in the consumer loop) is event driven so passing the data to the loop via an event will allow it to fit in with the current UI structure.
Oh, yes, one more thing: Get Rid Of The Express VIs. It's time to take off the training wheels...
Mike...
07-09-2014 12:21 PM
For those who want some more background...http://forums.ni.com/t5/LabVIEW/Store-calculated-values-in-an-array/td-p/2913226
07-10-2014 12:22 PM - edited 07-10-2014 12:22 PM
I attempted to adapt my code to the Producer/Consumer structure, and through it I began to develop a basic understanding of the structure and algorithm. However, I am still a bit weak on some parts and this is the best I could come up with. Could you provide any advice/tips on how to go about debugging this?
07-11-2014 04:37 PM
Hi Punsach,
Have you seen this document below? It is a good introduction for Producer/Consumer architecture.
http://www.ni.com/white-paper/3023/en/
Also, as far as debugging your code, please reference the below document.
Debugging tools in NI LabVIEW
http://www.ni.com/gettingstarted/labviewbasics/debug.htm