Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a digital input to send a digital output?

Hi, everybody --

 

We're in the middle of some troubleshooting, here, and I'd like to use a digital input on our 6602 board as a trigger to send a digital output from the same board. Might not sound too swift, but it makes sense for what we're trying to do.

 

We have a four of photodetectors hooked up to monitor four separate lasers. When a laser is interrupted, its detector sends a TTL signal to the 6602 card, whose timers then enter the picture.  All four of them are pretty much identical, so I'll just use the first one as an example.

 

When the first detector sees the interruption, it sends its TTL signal to the 6602 board via P0.29. I can see that fine at the computer, but I want to use that signal to trigger a digital output on, say, P0.3. I've tried a mess of things, using quasi-related examples I've found here, online, and with the Example Finder, but no luck. I keep getting cryptic errors ("Requested value is not a supported value for this property," [error -200077, among others]) that are leading me to believe that the 6602 won't support what I'm trying to do.

 

We also have a 6259 board in the computer, if that might help.

 

Thanks a million!

Mark

Message 1 of 6
(4,255 Views)

Mark,

 

Are these PCI or PXI cards?

 

See the attached example and let me know if you have any questions.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,245 Views)

Hi, Greg --

 

Thanks for the reply!  (And for taking whatever interest in my flailing around!)

 

These are PCI boards; we have another computer with PXI boards in them, but that's a separate, dedicated system.  Is there a functional difference between them when it comes to this sort of thing?

 

I tried the VI that you sent after adding an indicator for the number of samples written (so I could see if anything was happening).  I tried running it and sending the source (PFI 29) high via the laser detector, but no joy.  When I ended the VI with the STOP button, I got Error -200077 again.

 

Mark

0 Kudos
Message 3 of 6
(4,241 Views)

Mark,

 

Could you send me a screen shot of the front panel of the VI I provided.  I want to see how exactly you have the channels configured.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,220 Views)

Hi, Greg --

 

Yup.  It's attached.  When I try to run it, I get the dreaded error -200077.  It tells me that I requested Sample Clock for the SampTimingType property and that I can request On Demand.  On Demand, however, isn't available.

 

I'm also taking the liberty of attaching a different VI that I've been trying to get working to do pretty much the same thing.  I'm trying to use the counter's detemination of the two-edge separation to trigger an event structure that would write to P0.3 on the 6602 board, but I'm not having anything good happening.  (The two-edge separation task is how we use the detectors to determine our projectile speeds.)  I'm unsure as to whether I can use the signal from the counter to register for the event, and if I can, I'm not sure which of the signal types to use.  The fact that I've tried them all (except for the sample clock) is leading me to believe that this approach isn't possible.  I get the distinct feeling that using an event structure to do this is like using a howitzer as a doorbell, but I'm not having much luck otherwise.

 

Thanks again!

 

Mark

0 Kudos
Message 5 of 6
(4,216 Views)

The 6602 doesn't support clocked digital i/o.  Your 6259 *does*, but doesn't have a dedicated timing system for dio so you'd need to make a clock.

 

All that said, I'd recommend using a 6602 counter to do this job rather than either board's DIO.  Set it up for single pulse generation (don't use DAQmx Timing.vi in the config chain, which turns it into a pulse train task).  There are properties to make it be re-triggerable.  If you need a simple state change at the counter output rather than a pulse, you might get by just configuring for an *extremely* long high time.

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 6
(4,180 Views)