Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69326

Generating and stopping a pulse in a while loop while aquiring data

$
0
0

Hello everyone,

 

I still have a lot of questions, since I'm fairly new to LabView.

So my main goal is to generate a pulse, once a certain level from an analog input is reached. Yes I was able to accomplish that.

I'm doing that with a NI PCIe-6353 with a BNC-2120.

In general I'll list my main steps:

1. Acquiring data through analog inputs ai0-ai2

2. Saving that data into a txt file

3. While the program is saving that data, it's checking the Y value of the ai0 input.

4. If that value goes below a specified value, it is supposed to start a pulse

5. Which I am generating through an analog output ao0, and a pulse pattern generator.

The read, write and compare with the if-structure functions are all inside a while loop. As well as the saving.

 

So far I am able to control the pulse pattern, like width, amplitude and such.

But my pulse is not starting or stopping with the if-structure. It's running continuously, if that value is reached. Even if I try to put a stop-function into the false-case.

My only problem so far is to start and stop the generated pulses.

In the image shown there is the data I want to capture, the blue graph, and the pulse I want to generate, which I'm capturing in the third graph right now to control what it is doing. So let's say my value reaches the horizontal red line at 1.75, which now is my If-value and is returned true. I would love for the pulse to be where the vertical red line is. And that at every time, the Y value reaches 1.75.

But I can't stop the pulse generation nor align the pulses where I would like them to have.

Any help would be much appreciated, because I wasn't able to find anything so far.

And if I have to rewrite my program, so be it, but please someone help?

 

Best regards

A desperate researcher

 


Viewing all articles
Browse latest Browse all 69326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>