DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB-6501 Digital Output problem

Solved!
Go to solution

Hi,

 

I'm using DASYLab v.11 and I'm working on an interface with NI USB-6501 where I am trying to put a digital High on four ports.

With the module "NI-DAQmx - Digital Input" I manage to read digital inputs from the "NI USB-6501".

It's only the "NI-DAQmx - Digital Output" I can't get to work.

 

By using NI's "NI MAX" I easily can emmit my four LEDs by switching my ports High/Low.

But not with DASYLab. When using DASYLab the voltage on the ports stays unchanged.

 

Now I have a Switch module, generating 5/0, connected directly to the Digital Output module, which is assigned to my four output ports for my task.

I also tried having a Relay module in between with no success. I also tried to use 1.5 as high instead of 5 with no success.

 

I use the option "Bus(0/5 supply) for the "Digital Output" module.

 

From "NI MAX" I configured the ports as "active drive".

 

 

Any suggestion of what I could be missing?

 

Thanks

Martin

0 Kudos
Message 1 of 4
(6,765 Views)
Solution
Accepted by topic author M_Kallin

Hmm, four ports, or four lines?

A port consists of eight lines. Each line can control one LED (ON/OFF ~ 0/5V).

 

If you have created a dig-out task to control one port, sending 5V to this port will not set every line of that port to "high".

You need to put out 255 to set each line of one port to high (bitwise: 128+64+32+16+8+4+2+1 <- eight bits/lines).

 

Or, you can create a dig-out tasks to control four lines of one specific port.

The DAQmx DigOut module get's four channels.

Each of the modul's channels will feed one line of the device/task.

Four switches will then turn the LEDs on, or off.

 

Make sure, that the "bitposition" matches the correct line number (see attached image).

 

M.Sc. Holger Wons | measX GmbH&Co. KG, Mönchengladbach, Germany | DASYLab, DIAdem, LabView --- Support, Projects, Training | Platinum NI Alliance Partner | www.measx.com
0 Kudos
Message 2 of 4
(6,753 Views)

Yes of course 4 lines. 🙂

 

It seems like it's the "bitposition" that tricked me. Never got the point of that.

 

So with other words. For line of ".../port2/line4", the "bitposition" should be 8?

And still have 0/5 as control input?

 

Can't try it before the end of next week...

 

Thanks alot for the reply.

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

I tried it today and it worked! 😄

 

To emmit Led on line of ".../port1/line7" I wrote 7 for the bitposition.

 

Simple as that!

Thanks

0 Kudos
Message 4 of 4
(6,700 Views)