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.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

square pulse generated with NI PCI 6723

Solved!
Go to solution

Hello,

 

I have generated a biphasic square pulse in Labview using a standard square wave generator and stopping the vi from running after generating one full period of the periodic square wave. The only problem I'm having is that once I stop my code, so once the square pulse has been generated, the analog output of the NI board stays at the same voltage as the latest sample of the generated square pulse. Instead I'd like the voltage to go back to zero.

This is the same phenomenon you can observe when using Measurement & Automation when you generate an analog output and then you manually stop it, if you take a look with an oscilloscope at the output voltage it stays at the level you stopped the analog signal at.

 

I have attached an image of a square pulse with 1V amplitude and 1250 Hz frequency showing that the voltage level doesn't go back to zero. If I try to add even one more sample to the above curve, the voltage instantaneously bumps up to 1 , leaving me with the same problem.

Any thoughts?

 

thanks,

Alessandro

0 Kudos
Message 1 of 7
(7,102 Views)

Hello Alessandro,

 

Reading your question, there is a hardware reason that the output pins remain at the last state, the AO pins latch the last value loaded, to get the value to go back to 0 you would physically have to write out a value of 0 to port. You can do this either by adding a 0 to the end of the array of values that you are writing out, or you could do a case structure with one case have your signal generator amplitude set to 1 and  another case with the signal generator set to an amplitude of 0. Point is there are a few ways you could implement this but you need to physically write a 0 out to the port when using AO.

 

Is there a reason you are not using a counter to generate a pulse train? If you are unfamiliar with this process an example of generating a varying frequency pulse train can be found here

https://decibel.ni.com/content/docs/DOC-3751

 

Hope this helps.

BeauH
Applications Engineer
National Instruments
Message 2 of 7
(7,082 Views)

Thank you so much for your reply.

 

I have attached a picture of my VI, what do you think the best way to send a zero value to the output pin is?

I have tried to concatenate another task to the one shown in the picture, using error out, to write a zero value. Unfotunately this solution seemed to take too much execution time. Using the oscilloscope I saw that the time required to the output voltage to go back to zero was too long.

 

 

thanks,
Alessandro

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

Hello Alealias,

 

Try out the attached VI.

Screen shot 2011-11-07 at 4.19.10 PM.png

Regards,
Dan King

Message 4 of 7
(7,071 Views)

I'm sorry but I can't open this VI. I'm running Labview 10.

0 Kudos
Message 5 of 7
(7,067 Views)
Solution
Accepted by Alealias

This should work.

Regards,
Dan King

Message 6 of 7
(7,065 Views)

It works perfectly... This is exactly what I needed.

Thank you so much, I appreciated your help.

 

Alessandro

0 Kudos
Message 7 of 7
(7,059 Views)