LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output timing mismatch problem

I am still very new to programming with LabVIEW, and infact programing in any languege at all (as an engineer this is only a part time role of mine) and yesterday I noticed a bug with one of my programs. I am attaching photos and descriptions of my code below. Non the less I have two programs. The first is called "Continious Pulse Firing" it takes a series of pulses that I write up and it fires them off at the correct time. It then writes these pulses to a shared global variable "Waveform" which you can see in the image as well as I send it up to the DAQ assistant for output.

 

The second program which I have commonly used it or variations of it as a replacement for the DAQ assistant on many programs I have written. This tool takes the input from the global variable waveform and plays it out. I have also included a screen shot of the front panel from this program.

 

Next suspecting that something was wrong the other day when looking at it in a scope, I went and connected the outputs from the 2 separate programs and overlaid them on a plot over oneanother. I modified some code from one of the sample programs that is included with LabVIEW to create this tool.  (It looks like this site is only allowing 3 pictures so I will try to include them in a reply to this post,) but the end result is that I am playing out at approximately 6 times the rate I should be. Now this has me wondering where am I going wrong in my program.

0 Kudos
Message 1 of 3
(1,919 Views)

Here's the photo of my probed signal. The white wave was generated with the Daq assitant while the red wave was generated by my code with the help of the global variable. The white plot is what the signal should be giving me while the red plot is wrong.

 

Any ideas where I am going wrong?

0 Kudos
Message 2 of 3
(1,918 Views)

Hi,

I suggest you to use probe tools in both VI’s so you can see if they are getting the correct value. Also, I believe that the mismatch might be occurring because you’re using shared global variables. Since this variable is within the while loop, this is not updating fast enough before another iteration occurs.

 

 

Regards,

Carmen Chan

Applications Engineering

National Instruments

0 Kudos
Message 3 of 3
(1,843 Views)