Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I send a digital waveform with a PCI-6259 or a PCI-6602 board?

Hi, everybody --

 

I'm trying to set up a LabVIEW-based system here to flash a laser that we use in photography of impact-cratering experiments.  In the past, we've used a Stanford Research DS345 programmable waveform generator, but since we have all of this newfangled NI equipment, I'd like to be able to do that by using either our  PCI-6259 or PCI-6602 board.  A simple wavetrain won't do the job, because the strobing rate has to change with time.  Also, the delay between the trigger and sending the waveform has to be very small, because our projectiles can hit their targets at speeds up to 3 km/s.  Ideally, so we can photograph the entire event, the waveform would be sent to the laser to start it flashing as soon as the projectile's detected hitting the target (with a flash detector, for instance).

 

I've looked at all of the LabVIEW examples that I can find, but every time I try to send a simple waveform as a test (just a 11001010 sequence, for instance), I get an error saying that "buffered operations aren't possible with this line" or something very close to that.  This even happens when I try running examples that supposedly are supported by the 6259 or the 6602.

 

Is there any way that I can do this with the hardware that we currently have (i.e., the 6259 or 6602 board), or will we have to get another board?  If we need another board, any recommendations would be appreciated.  Also, what exactly should we look for in the specs so we'd know that this sort of waveform I/O would be possible?

 

If it sounds like I'm pretty much clueless about this stuff, then you're a winner!  If this were Star Trek, I'd be saying, "Dammit, Jim!  I'm a scientist, not an EE!"

 

Thanks a million for your time!

 

Mark

0 Kudos
Message 1 of 11
(5,395 Views)

Hi Mark,

 

You'll probably want to use the 6259 to accomplish what you need.  The 6602 does not have the capability of HW-timed arbitrary digital waveform output, whereas the 6259 can clock out digital data at 10 MHz.

 

The catch is that the digital output lines of M Series must be timed from an "external" source (external to the task, not necessarily the board).  I think your best bet for this would be to use a finite Counter Output task from the same 6259 assuming you have both counters available.  It can be triggered by an external TTL signal on any of the PFI lines and can be set to re-arm immediately after finishing generation.

 

The LabVIEW code would look something like this (I attached it at the bottom of this post for convenience--please excuse the lack of a front panel):

 

21173i49FBFA6633973FC5

 

 

 

To summarize the code, the basic idea is that:

 

    1.  The DO Task is armed first, but won't do anything until it receives the clock from the counter output

 

    2.  The Counter Task is then armed, and is waiting for the trigger signal

 

    3.  Once the trigger comes, the CO outputs a finite number of pulses (the number of DO Samples that need to be generated).  Each pulse corresponds to one DO sample.

 

    4.  When the task is finished, the counter is re-armed.  Since the DO Task is set to Continuous and has finished generating its buffer, the "write pointer" will loop back to the first sample in the buffer.

 

    5.  On the next edge of your trigger, repeat step 3 (until the stop button is pushed).

 

 

 

If you're ever in the market for new hardware, here's an obligatory plug for our newer X Series DAQ Boards.  They offer many additional features, including a couple that would make this application easier:

 

    1.  DI and DO tasks have their own timing engine, so no need to do the counter workaround.

 

    2.  All tasks are retriggerable (not just Counters), so there would still be no need to do the counter workaround.

 

    3.  Finite Counter Tasks only use one counter on X Series (not that it would matter too much since we wouldn't be using this workaround anyway).

 

    The code might look something like this on an X Series:

 

    21175iA6946AC1236650BF

 

 

Anyway, I just wanted to point it out that we've added a few new features in the recent years that would make this application a lot more intuitive.  The hardware you have should still work perfectly, but if you're ever purchasing new Multifunction DAQ Hardware I'd strongly consider looking into X Series (they are priced about the same as M Series anyway).

 

So, that about covers it.  Let me know if you run into any issues!


P.S. Amazing use of the Star Trek reference

 

 

Best Regards,

John Passiak
Message 2 of 11
(5,382 Views)

Hi, John --

 

First of all, thanks for replying to my post so quickly!  That was great!

 

I finally got a chance to try your VI to see if it would work, but, after reconfiguring the inputs for the tasks to suit our system here, I'm still getting that *&#@! 201062 error ("Selected lines do not support buffered operations.") when I try to run it.  I'm attaching the altered version of your VI so you can see how I have the inputs configured.  I guess my main quandry at this point is whether there are buffered and unbuffered lines on the PCI-6259 board or if maybe I'm missing something that a nonignorant person would see right off the bat.

 

Our PCI-6259 board is Dev2, and we currently have a pushbutton hooked up to PFI7 to simulate the triggering signal.

 

Thanks again!

 

Mark

0 Kudos
Message 3 of 11
(5,340 Views)

Hi Mark,

 

Sorry, forgot to mention that buffered digital operations are only on port 0 of M Series Devices.

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 11
(5,337 Views)

Hi, John, and thanks again for getting back with your reply so fast!

 

I'm still having trouble getting that VI running, and I have a feeling that it has something to do with that DAQmx Trigger.  While we're working on getting a usable version of this VI going, we're using a push button to simulate the triggering pulse.  I tried doing that before in a slightly different context (but still using the DAQmx Trigger) a while back and ran into problems then, too.  I eventually ended up using a modified version of the "Gen Event for Ext Signal.vi" from the Example finder (Hardware Input and Output>DAQmx>Events), which is obviously a little more cumbersome, but it works like a charm.  Is there something inherent in a push button's output that the hardware/software combination doesn't like?  We have it hooked up to PFI 7 and the VI is looking at PFI 7 for a signal, but for some reason it looks like the DAQmx Trigger (configured as Start Digital Edge) isn't recognizing it.  There are no error messages associated with it; it just acts as though nothing happened when we push the button.

 

Maybe it's my breath or something...

 

Thanks again!

 

Mark

0 Kudos
Message 5 of 11
(5,311 Views)

What is the voltage output of the push button?

 

Anything above 2.4V should register as a high.   You could check in a test panel to see if you can read PFI7 (P1.7) as a static digital input and recognize the trigger.

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 11
(5,307 Views)

Hi, John --

 

Yeah, I forgot to mention that I've already done that.  Duh.  Both the test panel and other VIs recognize the signal from the push button when I'm not using the DAQmx Trigger.

 

Thanks --

 

Mark

0 Kudos
Message 7 of 11
(5,300 Views)

Hi Mark,

 

Which line on port 0 are you outputting the signal on?  Digital is kind of funny.  If you're writing U32 (which the example is), then the first bit of your number would correspond to line 0, the second bit with line 1, and so forth. For example:

 

[1 ... 1]  would set line 0 high

[2 ... 2]  would set line 1 high

[3 ... 3]  would set line 0 and 1 high

[4 ... 4]  would set line 2 high

[5 ... 5] would set the line 2 and 0 high

 

etc.

 

 

The driver masks out any lines that aren't included in your task.  So, if you're on p0.x, the U32 that you should write to your task to set this line high should be 2^x.

 

 

Could this be what you're seeing?  If this doesn't help could you post the code with the lines selected that you intend to be using?

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 11
(5,293 Views)

Hi, John --

 

That did it!  I guess I had a vapor lock about the U32 signal vs. what I thought was happening.  I changed the DAQmx Write input to a digital waveform, and BINGO!  It looks great on the scope.  I think we're good to go now!  Thanks a zillion for being so patient with the ignoramus here at the other end of the forum.  Not only does the VI work, but I learned tons in the process.  Hard to beat that.

 

I hope I don't have to bug you again for a while.  Thanks again!!

 

Mark

 

P.S. -- It sure is neat when this stuff works, I gotta say that...

0 Kudos
Message 9 of 11
(5,263 Views)

Hi again, John --

 

I have another question for you before this thread dies, if I may.  In your first reply, you said that the VI you attached should work as long as we had both counters on the 6259 available.  When I look at the VI, I'm only seeing references to Counter 0.  Is there something else going on in the background that grabs Counter 1, too?  The reason I ask is that we're using one of the 6259's counters in Count Edges mode in the VI that fires our gun.  If both counters are, in fact, being used, then we'll have to work on setting things up so the 6602 board will handle the gun-firing job.  Don't mind doing that, but if we don't have to, that would mean that we can spend the time trying to get other spiffy things going!

 

Thanks --

 

Mark

0 Kudos
Message 10 of 11
(5,238 Views)