04-02-2007 02:34 PM
04-02-2007 04:55 PM
04-03-2007 11:29 AM
Thanks for your reply. I didn't know about Timed Sequences.
Alright, I am getting closer but it is still not working correctly. I have it set up now to have the laser on for 10ms and then off for 10ms. I'm reading the VDC output from the DAQ with a digital oscilloscope. With the current settings, I am reading "On" for 10ms and "Off" for about 17ms.
Do you know why it would be doing this? I tried subtracting the "Frame Duration" values to account for them, but that didn't work. Any ideas?
Michael J Fidler
04-03-2007 11:36 AM
Michael:
Another option you may want to look at is use the onboard counter/timers to generate a pulse train with deterministic timing (precise frequencies and on/off times)
You could take the TTL compatible (0-5V) output and use a buffer or optoisolator to scale it up to a 0-10V level pulse. There are a lot of examples in LabVIEW help about generating pulse trains.
04-03-2007 12:38 PM
Michael,
My suggestion would be to either use a counter, as mentioned earlier in the post, or to create a waveform of one period (on and off of your pulse) which you will write to the buffer before you start generation. You can then do a continuous write, and this signal will repeat until you stop. This knowledgebase helps explain digital regeneration.
I would also suggest looking at some of the examples which ship with LabVIEW. These can be founder under ‘Help >> Find Examples…>> Hardware Input and Output >> DAQmx >> Digital Generation’
04-03-2007 02:32 PM
Alright, I'm an Aerospace Engineer and not Electrical, so keep in mind that this is all new to me.
AnalogKid, if I were to use your method does that mean I would need another circuit board to scale the digital output signal to the 0-10VDC signal? Is that what a buffer or optoisolator does?
David, I think you linked from an internal website and it doesn't work for me, but I assume you meant to link to the following site:
http://digital.ni.com/public.nsf/allkb/7e2b7cfa5f440ab68625706200567ee3
I modified this VI slightly so that I could directly manipulate the Duty Cycle. I also changed it to go from 0-10VDC instead of -5-+5VDC square wave. While this outputs a square wave to the waveform graph, it doesn't exactly output a square wave from the DAQ. If you look at the photo I attached of the oscilloscope, you will notice that it takes about 1.5 ms to ramp the voltage from 0 to 10VDC. Is this a limitation of the DAQ that I am using?
Thanks again for everyone's help.
Michael Fidler
04-04-2007 05:07 PM
Michael,
I ran your code, but was unable to reproduce the problem you are seeing. I measured the signal in two fashions’. I brought the signal back into the card (LabVIEW_Square Wave.JPG) and into a benchtop scope (Benchtop scope_Square Wave.jpg).
I would like to ask that you run the attached code twice. The first time, please run it with the analog input as ‘Dev1/_ao0_vs_aognd’. This take the analog output and compares it with the cards AO ground, therefore eliminating the need for external connections and simply doing internal routing. The second time, please run it with the analog input as “Dev1/ai1”, and wire your AO channel to an AI channel. These tests are to ensure that there is not a stray capacitance in your scope, the probe, etc. Let me know the results (pictures are always great)
04-20-2007 04:16 PM
04-23-2007 05:28 PM
Michael,
What’s going on is that the ‘first call.vi’ is only called once, and so the second time you start the generation, the DAQmx Start.vi is not called, and the error you are seeing is thrown. I have posted below your VI with a few minor changes.
I made the inner case structure enter the ‘DAQmx Start’ state any time the while loop has its first iteration (an iteration of ‘0’ (zero indexed)). This will force the DAQmx Start vi to run more than once if you stop and start your generation. I also put a DAQmx write just before your DAQmx clear to implement the idea of outputting 0v before the generation stops. Since we are doing this after the inner while loop stops, we can take it away from the false case of the outer case statement.
Good luck with the project!
04-27-2007 01:58 PM