NI Home > Community > NI Discussion Forums

Signal Generators

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Alealias
Posts: 9
0 Kudos
Accepted Solution

square pulse generated with NI PCI 6723

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

Member
Beau_H
Posts: 70

Re: square pulse generated with NI PCI 6723

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
Member
Alealias
Posts: 9
0 Kudos

Re: square pulse generated with NI PCI 6723

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

Active Participant
Dan_K
Posts: 256

Re: square pulse generated with NI PCI 6723

Hello Alealias,

 

Try out the attached VI.

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

Regards,
Dan King

Member
Alealias
Posts: 9
0 Kudos

Re: square pulse generated with NI PCI 6723

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

Active Participant
Dan_K
Posts: 256

Re: square pulse generated with NI PCI 6723

This should work.

Regards,
Dan King

Member
Alealias
Posts: 9
0 Kudos

Re: square pulse generated with NI PCI 6723

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

Thank you so much, I appreciated your help.

 

Alessandro