Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic inputs and outputs with DAQPad 6507

I have a DAQPad 6507 and need to know the proper way to connect a simple toggle switch as an input. Also, for an output I need the proper method for connection of a TTL relay. I am unsure of which mode (logic high or logic low) is best for this use either. Basically, I would like to be able to see if the switch is open or closed as well as close the relay from my VI. It is the hardware side that I am not too sure of. I have looked at the drawing in the manual but it did not truly clarify what i am to do.

Thanks
Shawn
0 Kudos
Message 1 of 5
(3,743 Views)
Hello Shawn,

1) If you are going to measure whether or not the switch is open or closed, you have to make sure that the circuit that the switch is completing is carrying a TTL signal. With that said, I can think of two ways that you can measure whether or not the switch is open or closed using your DAQPad 6507.
a) If the load is connected to +5V and the switch is inbetween the load and GND, then you want to connect the digital input line inbetween the load and the switch. When the switch is open, you should read in +5V (logic high) and when the switch is closed, you should read in 0V (logic low).
b) If the load is connected to GND and the switch is inbetween the load and +5V, then you want to connect the digital input line inbetween the load and the switch. When the switch is open, you should read in GND (logic low) and when the switch is closed, you should read in +5V (logic low).

2) If you are using one of the digital lines to output a control signal to your TTL relay, than your TTL relay should have a connection for this control signal. The specifications of the relay should also tell you if the relay is N.O. (normally open), N.C. (normally closed), and what the expected behavior of the switch is when a logic high control signal is applied and when a logic low control signal is applied.

Take care,
E.Lee
Eric
DE For Life!
Message 2 of 5
(3,729 Views)
I assembled a simple setup to test this and cannot get anything conclusive from the units test panel in MAX. I connected a switch to GND and on its switched side connected an indicator which has its other lead going to to VCC and a lead to APA lead 4 from the switched side of the switch. I set the test panel to watch channel 0 for input and see line 4 go red for a few seconds and then turn off. I cannot get it to repeat without recycling power to the DAQPad. As far as output, I have normally open relays that are not truly a TTL relay but are meant to run at TTL level voltages (not sure if there is a true difference). Also, on the switch, I am not actually controlling a load in real life as this DAQ is being used as a controller in a simulator and thus just needs to see switch positions. I am guessing I will still need a load and thus, is a resistor a reasonable alternate?

Shawn
0 Kudos
Message 3 of 5
(3,726 Views)
I just restarted my machine and now the testpanel is able to respond properly. I still am wondering about output though. Essentially, I need to be able to switch a device on or off. Be it a relay or an LED if that makes me clearer.
0 Kudos
Message 4 of 5
(3,723 Views)
In most cases it is better to use the outputs of a DAQ board in 'sink mode', i.e. connect the load between +5V and the output so that the output rather sinks than delivers current. Virtually all output drivers I have seen can handle much more load current in sink mode than in source mode, i.e. the load connected between the output and GND. Also, in sink mode there will be very close to 5V across the load - in source mode the voltage level may vary. There are guaranteed levels for certain loads (usually between 2.8 and 3.5V) but actual voltage may be higher.

When connecting a device with less than 5V operating voltage in sink mode (LEDs need around 2V) you have to add a series reistor for current limiting. I have posted suitable values in the 'How to light an LED' thread.

When driving relays or solenoids you MUST connect a clamp diode in parallel with the coil. The diode must be connected in reverse direction, i.e. the cathode to +5V and the anode to the output. It will cut off the voltage spikes that occur when switching off inductive loads and may destroy your board.

Connecting a load in sink mode will invert the logical levels. I.e. the load will be activated when writing a logical 0 to the output, and will be deactivated when writing a logical 1 to the output. Connecting the load in source mode will NOT invert the levels but actual voltage levels are uncertain.

If you need more current than the output drivers of the card can handle you can add additional driver circuits.
Message 5 of 5
(3,716 Views)