LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6501 output high

Solved!
Go to solution

Hello,

 

Does any have a sample code for the NI USB-6501? I need to set 24 DO to High/Low in my code.

The sample codes under Help>Find Example>Hardware input and out>... are not working. I need to control these IO independently.

 

Thanks!

0 Kudos
Message 1 of 8
(4,434 Views)

Hi tian,

 

I never had any problems with example code "not running".

 

What's your problem?

Why can't you set DOs independently?

Which example VIs are you referring to?

What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,430 Views)

@tian66 wrote:

Hello,

 

Does any have a sample code for the NI USB-6501? I need to set 24 DO to High/Low in my code.

The sample codes under Help>Find Example>Hardware input and out>... are not working. I need to control these IO independently.

 

Thanks!


 

Have you made sure that the NI-DAQmx drivers are installed properly? (http://joule.ni.com/nidu/cds/view/p/id/2337/lang/en) You should be able to search for examples by hardware. For me, NI USB-6501 did not show up on the list, but if the drivers are good, you should be able to find examples.

 

[See: http://forums.ni.com/t5/LabVIEW/A-simple-example-for-LabVIEW-to-write-to-USB-6501-outputs/td-p/15667... ]

0 Kudos
Message 3 of 8
(4,429 Views)

Hello,

 

From the NI MAX, it shows the driver I installed. 

The driver might not be installed properly. Do you know how to check it?

 

Thanks!

0 Kudos
Message 4 of 8
(4,423 Views)

Hello GerdW,

 

I need to find an example that can set each output to high/low.

 

I have installed the USB-6501 driver(9.7.0f0) and I can use the Test Panels in the MAX. It works very well.

But when I go the Help>Find Example> Hardware Input and Output>Digital Output>example, it seems no sample code to do the fuction I am expecting. Besides, those code cannot even regonize the device.

 

Thanks! 

0 Kudos
Message 5 of 8
(4,421 Views)
Solution
Accepted by topic author tian66

@tian66 wrote:

 

I have installed the USB-6501 driver(9.7.0f0) and I can use the Test Panels in the MAX. It works very well.

But when I go the Help>Find Example> Hardware Input and Output>Digital Output>example, it seems no sample code to do the fuction I am expecting. Besides, those code cannot even regonize the device.


Have you tried searching by device? Help > Find Examples… > Find Hardware (lower left corner) should give you examples specific to the NI USB-6501.

0 Kudos
Message 6 of 8
(4,417 Views)

Got it!

It is a good example to modify. Thank you!

Right now it is using an array of switch.

Do you know how do I seperate the array of switches since I need to set the output individually in a loop with other functions? (e.g set DO1 DO3 DO5... to high one by one)

 

 

0 Kudos
Message 7 of 8
(4,399 Views)

@tian66 wrote:

Got it!

It is a good example to modify. Thank you!

Right now it is using an array of switch.

Do you know how do I seperate the array of switches since I need to set the output individually in a loop with other functions? (e.g set DO1 DO3 DO5... to high one by one)

 

 


You can index an array of switches just like you would any array. I've attached a sample VI showing how to replace the value of one switch (assuming array of booleans).

 

Usually, arrays can help keep the block diagram neater. Also, it's a good way to set all of the switches to some pre-defined value. (Say you need to set them all false or all true.)

 

If you're going to change them methodically, you can use the loop index to also index the array, if that's what you want.

0 Kudos
Message 8 of 8
(4,393 Views)