Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch Set Topology without Reset

I have a PXI chassis and relay module, and am wondering if it is possible to initialize the relays, but NOT reset them. 

I have an application where every time I poll the status of the relays, I save their status to a file, so that in the event of a crash, or some other horrific problem, I can restart the program with everything in its previous state.  In my code, I use the DAQmxSwitchSetTopologyAndReset() function, and as soon as this is executed you can hear the relays all click -- I would like to initialize things, but not have the relays all go to the closed or open state.

Thanks for your time.

0 Kudos
Message 1 of 7
(8,016 Views)
shardy1216:
 
You don't need cache the state of the relays and reinstate them if the crash is minor - ie: only your program crashes.  You only need to cache the state of the relays and reinstate them if the crash is major - ie: your machine crashes and you have to reboot.  Which case are you trying to handle?
 
Brian
 
0 Kudos
Message 2 of 7
(8,001 Views)
Well, both actually. 

Could you explain a bit more how one would do it for the case of only a minor crash?  For the major crash (i.e. system reboot) is there a way of init'ing the device without resetting the relays? 

Thanks for your help.

~Steve
0 Kudos
Message 3 of 7
(7,998 Views)

For the minor case, the switch driver will maintain the relay state between runs of your program.  You only need to rerun your program (if it crashes) but your program needs to not call setTopologyAndReset to allow the driver state to continue from where you left off.  You can do this by just relying on the default topology as set in MAX and then removing the setTopologyAndReset call from your program.

For the major case, you need to maintain a cache of the relay state yourself and then reinstate it after the reboot, since the driver will open all for this case. 

Brian

 

0 Kudos
Message 4 of 7
(7,993 Views)
Hello Steve,

Another option you have for the minor case you and Brian have been discussing is to use the niSwitch driver function niSwitch_InitWithTopology().  This driver has more functionality than DAQmx (when using it for switches), and this function is the same as DAQmxSwitchSetTopologyAndReset() but there is an input to this function to turn off the device reset when it is called.  The only catch to this is that it still will reset the card when you call it the first time after a computer reboot.  As Brian says, the only way to get it back to the configuration it is in is to save and set it, no matter which driver you use.

Here is a link to the NI Switch driver, the installer includes example programs, so you can take a look at those if you want.

Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 5 of 7
(7,967 Views)

I am using the niSwitch <Initialize with topology.vi> driver which has the option to reset the PXI switch module.  However, when I wire a False (no Reset) to the control, it gives me error -1074135021 stating that the device has to be reset when the VI is run.

I have an application where I need to open/close 1 switch but keep all the existing switches in their current states.  I am looking for a way to resolve this.

0 Kudos
Message 6 of 7
(6,373 Views)

palpro,

 

I couldn't reproduce this error, I think I need some more information.

 

Which version of the NI-Switch driver are you using?

 

Which switch module and topology are you using?

 

You should be able to initialize an NI-Switch session without resetting the switch as long as it is set to the same topology.

 

 - Marshall

0 Kudos
Message 7 of 7
(6,364 Views)