Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-USB 6501

A switch between +5 and P1.6 and a resistor between P1.6 and Gnd will look like Fig A below. That is not correct. All you really need to do is like what is shown in Fig B.

Message Edited by Dennis Knutson on 09-21-2007 08:21 AM

0 Kudos
Message 11 of 21
(1,774 Views)

I did that change in the circuit too. But I keep getting the error

"Measurements: Task cannot contain a channel with the specified channel type, because the task already contains channels with a different channel type.

Create one task for each channel type."

All I did was to combine the read and write tasks.

 

0 Kudos
Message 12 of 21
(1,766 Views)
Try connecting it to a different DIO port.

Don't combine the DI and DO tasks in one daq assistent instance.

First try ad see if you can read the state of the switch without trying to do anything with the LED.
Then try to toggle the LEd without doing anything to the switch.
If you succeed try to combine to two.

André

Message Edited by andre.buurman@carya on 09-21-2007 04:46 PM

Regards,
André (CLA, CLED)
0 Kudos
Message 13 of 21
(1,765 Views)
I'm already working with two ports now. The iput switch is on port 1 and the output LED on port 2
0 Kudos
Message 14 of 21
(1,761 Views)
Post your code. I would really help to see what you've written. You can't have an input and an output in the same task.
0 Kudos
Message 15 of 21
(1,755 Views)
I don't even think this code is accurate, but still.
0 Kudos
Message 16 of 21
(1,752 Views)

No, as I said, you can't mix inputs and outputs in a task. Try the modified versions below.

Note that I can't test it without the hardware. The current output of the 6501 is pretty small so you may have a problem driving the external LED.

0 Kudos
Message 17 of 21
(1,749 Views)
This one actually worked well. Thank you.But could you tell me what do you mean when you say you can't mix inputs and outputs in a task?
0 Kudos
Message 18 of 21
(1,746 Views)
A task is a data acquisition operation. It may be one or more channels but the basic operation must be the same. You can have an analog input task where each channel could have different gain settings or scales, but they all have to be analog inputs. You can create a single task with multiple digital input but if you want to also do a digital output, the digital output has to associated with a different task. That is why you were getting the error. You created a task with a digital input and then wired that task to a digital output Create Channel.
0 Kudos
Message 19 of 21
(1,741 Views)

To this same VI, could you tell me how to add a delay. I want the VI to work in a fashion that, when I push the on-off switch, the LED should remain off for 5 secs and then when then comes back on again. In case of pushing the button repetitively, I would like the LED to turn on for 5 secs then go off for 5 secs.

i tried adding the time delay VI to it, but I could only see the LED going off for 5 secs (when it went off). But it did not turn off immediately when the button was pressed.  I tried this by putting the tiime delay vi in the while loop.

0 Kudos
Message 20 of 21
(1,720 Views)