LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a slight dilemma...

Ok, so I am having major issues. I have spent several hours attempting this, seemingly simple problem...
This is what I am trying to do:

I am trying to create a program that receives a square wave synch input at 40khz. From here, I am trying to detect the beginnning of the positive flat portion of the square wave. From here, I need a for loop that recognizes the beginning of the positive flat portion, then outputs a short pulse at this point.

However, there is a trick.... I need the first output pulse to be right at the beginning, then the second output pulse to be output at about 1/4 of the way through the positive portion of the square wave, then the third to be about 1/2 way through... and so on and so on.

Any help would be great. I know there is something that I missing big time. Because I really should be able to do this in about 10 minutes.

Message Edited by snowman13 on 01-05-2007 09:17 PM

0 Kudos
Message 1 of 37
(4,965 Views)
PS - I am trying to create a song that responds to certain voltage impulses... Such as by lights or something else...
0 Kudos
Message 2 of 37
(4,933 Views)

Hi Snowman,

Could you provide a timing diagram defining the output pulses realative to the sync?

We do much better with pictures! Smiley Very Happy

What kind of hardware are you using?

Ben

Message Edited by Ben on 01-06-2007 11:48 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 37
(4,926 Views)
Of course! Here is a really rough sketch of what I am trying to accomplish. Any ideas or suggestions would be great!
0 Kudos
Message 4 of 37
(4,909 Views)
PS -

I am using a PCI slot DAQ and just then standard TI switch board interface card to talk to the DAQ for the inputs and outputs.

Message Edited by snowman13 on 01-07-2007 12:50 AM

0 Kudos
Message 5 of 37
(4,893 Views)

Hi snowman,

      Your project seems to require a triggered output, either Analog, or Digital (DO or Counter).  If your board is capable of a waveform output (Analog or Digital) you might be able to use a triggered waveform output.  Not all DO/AO boards are capable of waveform output, but many of the cheaper boards still include Counters - exactly which board are you using?

Note: your original posts suggests using a loop to monitor the analog input to catch rising-edges.  This could work with a much slower input frequency, but at 40KHz input-signal, LabVIEW won't be able to execute fast enough to keep-up!

Cheers. Smiley Happy

Message Edited by tbd on 01-07-2007 01:29 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 6 of 37
(4,886 Views)
Yes, my board is capable of waveform output. I managed to get a hold of the DAQ as a loaner and free of charge! I got a hold of my regional NI rep, and showed him it... His reponse was, "Whoever lended that to you is crazy!" So I am assuming it is one of the higher model boards. Someone also suggested to me, a sort of infinite PLL. Is that plausible at 40khz?
0 Kudos
Message 7 of 37
(4,824 Views)

Hi Snowman,

      I don't know how to apply a Phase-Locked-Loop to this!  A very simple solution might be to wire your 40KHz signal to a Counter Gate input, and use the "Generate Retriggerable Pulse (DAQ-STC).vi" to generate an output pulse of desired delay/duration for every rising-edge of the input (see HELP\Find Examples.)  But you'll need DAQ-STC Counters for that and...

... we still don't know what DAQ board we're working withSmiley Surprised Try using "Get DAQ Device Information.VI" (\NI Measurements\Data Acquisition\Config & Cal) with Info.Type = "Device Name", or pull the board and look at it! Smiley Happy

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 8 of 37
(4,780 Views)
Ha, I am sorry. Got side tracked... Its a PCI-6259.Smiley Happy
0 Kudos
Message 9 of 37
(4,753 Views)

Hi Snowman,

      There are two good DAQmx/M-series synchronization articles here and here.  I think your input/output signal synchronization might be implimented simply.  See the attached VI which creates a timing-defined pulse with Analog trigger source (your 40KHz signal.)  I don't have any hardware to test this with, but it's very similar to the "Gen Dig Pulse-Retriggerable.vi" from the DAQmx examples. Smiley Happy (examples are good...)

I didn't find/see any examples of how to use the on-board PLL which seems to be used (exclusively?) by internal processes for synchronizing internal and external timebases - if you come across instructions for exploiting the PLL, please post back!

Cheers.

Message Edited by tbd on 01-09-2007 01:40 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 10 of 37
(4,721 Views)