From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I Create a Single Delayed Output Pulse (Analog Voltage) From An Input Reference Trigger (Analog Voltage)?

Solved!
Go to solution

Hi I am working with a combustion chamber and using a DAQ system (with NI SCB-68 hardware) to read the pressure within the cylinder (as analog voltage). I am trying to output a delayed, 1-millisecond, pulse at 5 volts once the pressure within the cylinder has risen above 5 bar (which corresponds to an analog voltage of 0.25 V). I also want to record 30 ms of samples before the trigger and 220 ms of samples after the trigger. The following image visually shows what I'm talking about.Pulse Diagram.JPG

I have created a LabVIEW VI (which is attached) but I keep running into 2 problems:

  1. When I run it with Finite Samples after a period of time I get Error-200281which I don't entirely understand.
  2. Using the "Elapsed Time" Express VI to keep time for the pulse I cannot get a resolution of 1 millisecond, so the pulse is not generated when I set the window between 0.003 and 0.004 seconds for the pulse to be high (i.e. the resolution of "Elapsed Time" seems to be too coarse).

I am a beginner at LabVIEW so sorry if my questions are trivial or if my VI makes no sense but I have been stuck on this for more than a week. Any help would be greatly appreciated!

 

Thank you,

Morgen

0 Kudos
Message 1 of 7
(3,722 Views)

Here's an explanation of the error code -200281:

 

http://digital.ni.com/public.nsf/allkb/3E9EBBEEFA2505388625713D006AEA4D

 

As far as getting a 1ms pulse inside that While Loop, I'm betting that is takes mroe than 1ms to iterate. The Elapsed Time VI can handle a 1ms increment, but you've got a lot going on in the While Loop, the Write to Measurement File VI is opening, writing, and closing the file each iteration.

Message 2 of 7
(3,673 Views)

Thank you so much for your help! The explanation of the error code is extremely helpful and that makes sense why I am unable to get the 1ms pulse. Do you have any suggestions on how I mght be able to produce the pulse without using such a complicated While Loop? I really appreciate your help.

 

Thank you,

Morgen

0 Kudos
Message 3 of 7
(3,664 Views)

What device are you using for your AO?

Message 4 of 7
(3,649 Views)

I'm using an NI PCI-6259 DAQ card with an SCB-68 interface block. Once again, thank you so much for your help. I really appreciate your input.

 

Mrogen

0 Kudos
Message 5 of 7
(3,643 Views)
Solution
Accepted by topic author Morgen

This is not a good way to trigger a pulse.Block Diagram with Annotation.jpg
Use a DAQmx trigger to send the pulse when your acquired signal rises above 250mV like you specified.

 

See this for DAQmx Triggering:

http://www.ni.com/white-paper/2835/en/#toc4

Message 6 of 7
(3,623 Views)

Thank you so much for the link! This is extremely helpful. I knew my VI was really inefficient but I wasn't sure how to clean it up. Also you were right before about the loop taking  too long to iterate. Even after I moved the "Write to Measurement" outside the loop it was still taking more than 17 ms to iterate.

 

Thank you,

Morgen

0 Kudos
Message 7 of 7
(3,615 Views)