Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the NI USB-6501 DAQ POD to Control Digital I/O

Hello,

 

I have a project I am working on where I will need to be controlling four separate DC power supplies using a series of programable electrical relays to be able to power on and off my UUT using the USB-6501 DAQ Pod.  I have the code to be able to send commands to the supplies to set, power/off the supplies, but have never used the NI DAQ Pods before (specifically the NI USB-6501 24 channel I/O Pod).  I am unfamiliar with how to also talk to the relays themselves using this pod and would appreciate some guidance and tips on how to go about setting this up.  I have been perusing through some of the manuals and examples, but none really are able to capture what I need.  Any help is appreciated!

 

Thanks!

0 Kudos
Message 1 of 10
(1,932 Views)

Regarding the instrument, 6501 is a simple USB based Digital I/O.

 

This request is similar to your question - https://forums.ni.com/t5/LabVIEW/Very-Simple-DIO-with-NI-DAQmx/td-p/160898

 

https://www.ni.com/en-us/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-ha...

 

In simple terms, you have to create a DAQmx Task containing the DIO channels you want to control, then using DAQmxWrite, set the digital states of those channels.

 

To get started quickly, you can use the soft front panel to control the DIO lines, in order to do so, go to NI MAX, right-click on the device and select Test Panels,

santo_13_0-1614285873069.png

In the Test Panel, go by the numbering, and once you configured stuff, click Start

santo_13_1-1614285963072.png

 

 

We need additional details about the relays to guide you better on hooking up with your DAQ. In simple terms, use the DIO signals to control your relay (not directly since these DIO lines can't source a lot of current and fixed voltage).

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 10
(1,905 Views)

Thank you for your reply!

 

I read through the related request and I am seeing some similarities in needs.  My application will be performing a very similar task.  Ill be controlling basically 32 UUTs all in parallel witching them on and off as the test iterates through a section of code.  I assume I'll be passing simple read and write bits through each relay to control the switching of voltage through each channel (which is the part I am finding challenging).

 

This is the relay I'll be suing and have in hand: https://www.sainsmart.com/products/16-channel-9-36v-usb-relay-module?variant=32630303817807&currency...

 

Ill have 4 of these working for all four power supplies which as I mentioned s the BK Precision 9120A model.  I am currently seeting up global Booleans as well to control the individual cases for each UUT.

 

I'll attach a copy of my vi.

0 Kudos
Message 3 of 10
(1,883 Views)

Are you planning to use the DAQ to control the USB Relay board? because I don't see any way you could control the relays electrically.

 

I believe, that relay board comes with its own driver to be controlled from PC. Please share a high level diagram of how you intended to connect stuff together and how they will be controlled.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 10
(1,876 Views)

Yes, I plan on using the DAQ pod to control the relays to switch power on and off to the UUTs.

 

The basic idea is I'll have the DAQ pod controlling the switches on the relays to either supply power to the UUT or power it off.  The LabVIEW test will run a number of iterations that will require me to switch power on and off to multiple UUTs at the same time, so the need for the switches will be to have multiple UUTs controlled by the same relay hooked up to a singular power power supply.  That is where I want to use the DAQ pod to either tell that channel on the relay to either supply power to the unit or cut power.  So in short the DAQ is what will be controlling the relay.

 

Does that make sense?

0 Kudos
Message 5 of 10
(1,844 Views)

I understand your requirement, just that the USB Relay board does not seem to have the option to get signals from the DAQ DIO pins. It looks like the USB Relay board in the link shared can be controlled only over USB and not using digital signals provided externally.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 10
(1,834 Views)

I am seeing the issue now, well bummer.  Is there a way I can still use the relay with the DAQ using the USB on the PC?  If not, is there a way you would recommend I try and resolve this issue?  Do you recommend any other relays that can accomplish what I need?

0 Kudos
Message 7 of 10
(1,818 Views)

Since the USB Relay board already contains a way to communicate with PC (over USB), you could eliminate the need for DAQ to control the relay board and if the relay board provides some sort of dll API to control it, it would be direct way rather.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 8 of 10
(1,812 Views)

That would make more sense, do you have any references or recommendations on that?

 

Appreciate all the help BTW!

0 Kudos
Message 9 of 10
(1,810 Views)

I have seen another Forum user recommend the Numato relays and they can be controlled using simple commands over SERIAL Console (you would do that with VISA drivers in LV)

 

https://numato.com/product/16-channel-usb-relay-module/

https://numato.com/kb/understanding-readallwriteall-commands-for-relay-modules/

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 10 of 10
(1,801 Views)