02-25-2021 12:35 PM
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!
02-25-2021 02:46 PM
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
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,
In the Test Panel, go by the numbering, and once you configured stuff, click Start
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).
02-26-2021 11:40 AM
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¤cy...
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.
02-26-2021 06:18 PM
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.
03-01-2021 02:33 PM
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?
03-02-2021 06:48 PM
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.
03-04-2021 11:44 AM
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?
03-04-2021 12:53 PM
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.
03-04-2021 01:00 PM
That would make more sense, do you have any references or recommendations on that?
Appreciate all the help BTW!
03-05-2021 02:50 PM
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/