09-25-2012 08:48 AM
Hi,
I have a question regarding control of individual relays via DAQmx API.
There is a small illustrative example which uses DAQmxSwitchSetTopologyAndReset,
DAQmxSwitchCloseRelays and, DAQmxSwitchOpenRelays method to open and
close a specific relay. However, I am unable to find a document which describes how
individual relays are named.
For instance, the specification of PXI 2510 shows relays with k0, k0a, k0b etc.
However when I send "/dev2510/k0" as relay name to DAQmxSwitchOpenRelays
the API refuses to open the relay and returns back with negative error code.
I was wondering if there is some document which explains how relays are named.
Thanks in advance.
09-25-2012 10:26 AM
Hey aDhm,
The relay names are in the NI-Switches Help file (installed on your computer at: start»all programs»national instruments»NI-switch»documentation»NI switches help.chm) under the specific device. For example, the 2510's diagram is located in the help file under Devices»NI PXI-2510»Hardware Diagram.
You're using the correct syntax for NI-DAQmx ('/dev2510/k0'). Can you let us know the error code? My generic recommendations without a code are to verify the device name and verify the device is operational in the NI-Switch Soft Front Panel.
Note that for NI-Switch - a session based IVI driver - the device name isn't needed once the session is open.
09-25-2012 10:46 AM
Hi John,
Thanks for the reply.
I currently don't have NI-SWITCH installed on the system. I access the devices using "Measurement and Automation". I understand that Switchblocks/FIU can be programmed via --in addition to NI SWITCH-- NI DAQmx. Moreover the relay names are listed as k0, ka0 etc in Measurement and Automation. I should also mention that I am currently testing the code with a virtual device. But I reckon that shouldn't affect the way a relay is named or accessed.
09-25-2012 11:01 AM
aDhm,
Testing with a virtual device should not cause any difference in the naming scheme for individual relays. Additionally, as you mentioned you can use NI-DAQmx to program these modules without having NI-SWITCH installed.
This link here shows some of the relay names for the 2510. As you see, there are k0 relays between ch0 and dut0 as well as k0a and k0b for dut0 to busA and dut0 to busB.
What is the error that you were receiving?
Have you verified that the device name is listed correctly?