PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reseting PXI 2510 Switches the correct way

Hello, 

 

i have a 4 PXI switch cartes that i need to reset after some operation of controlling each individual relay, im using this function to reset the 4 switches :

 

//Close Session if another one is opened
CloseSession();
//Creat switch instance 
switchSession = new NISwitch(sPXIDeviceAddress, sPXIDeviceTopology, false, true);
switchSession.DriverOperation.Warning += new System.EventHandler<SwitchWarningEventArgs>(DriverOperationWarning);

this is wrapped inside a loop that call this function for each PXI switch card, the problem is that some relay is not openned to there initial state, when i check again i found some relay still being closed,

 

how to reset the device to its initial state and oppen all relay in each individual card ?

0 Kudos
Message 1 of 8
(2,527 Views)

Hi BadreArras,

 

If your goal is to open all of the relays, have you tried using the niSwitch_DisconnectAll function? This function breaks all existing paths in a specified instrument and will return a warning if a path cannot be broken.

 

ViStatus niSwitch_DisconnectAll (ViSession Instrument_Handle);

0 Kudos
Message 2 of 8
(2,487 Views)

Hello Matt, 

 

i have implement this function this way : 

 public Boolean DisconnectAll(string sPXIDeviceAddress, string sPXIDeviceTopology)
        {
            try
            {
                //Close Session if another one is opened
                CloseSession();
                //Creat switch instace 
                switchSession = new NISwitch(sPXIDeviceAddress, sPXIDeviceTopology, false, false);
                switchSession.DriverOperation.Warning += new System.EventHandler<SwitchWarningEventArgs>(DriverOperationWarning);
                // Breaks all path in the given switch
switchSession.Path.DisconnectAll(); return true; } catch (Exception _ex) { throw new System.Exception(_ex.Message); } }

but its not working as expected, may be the implementation is wrong ? can you suggest something else captain !

0 Kudos
Message 3 of 8
(2,413 Views)

Hi BadreArras,

 

I’m not an expert on programming with CVI, so I went looking through the help documentation for NI Switch functions. From what I found, I’d like to offer two suggestions:

 

  1. For initializing a new switch, you implementation looks a little different from some of the examples. The help documentation list three different functions:
    1. niSwicth_init
    2. niSwitch_InitWithOptions
    3. niSwitch_InitWithTopology

All of the examples I looked through used one of these three. I’m not sure if your current implementation is working for elsewhere in your code, but you may want to try one of these.

 

  1. For the DisconnectAll function, I believe you need to pass in the instrument handle as a parameter, which is doesn’t look like you’re doing here.
0 Kudos
Message 4 of 8
(2,401 Views)

Hello Matt, 

 

im using C# not CVI,for the initialisation im using this overload,passing to it the switch name, the topology, simulation , and the reset:

 

  // Creat switch instance 
   switchSession = new NISwitch(sPXIDeviceAddress, sPXIDeviceTopology, false, false);

and for the disconnect all , i creat a switch instance passing to it the instrument name , topology, after that i can access to its proprieties by the DOT notation :

 

DisconnectALL.jpg

 

here is the code used :

 

     switchSession = new NISwitch(sPXIDeviceAddress, sPXIDeviceTopology, false, false);
     switchSession.DriverOperation.Warning += new System.EventHandler<SwitchWarningEventArgs>(DriverOperationWarning);
     switchSession.Path.DisconnectAll();

many thanks ^^

0 Kudos
Message 5 of 8
(2,398 Views)

Thanks for clearing that up me. So when uses the DisconnectAll function, are there still relays that aren’t opening? I’m just curious as to what you meant when you said that it’s not working as expected.

0 Kudos
Message 6 of 8
(2,380 Views)

Hello Matt, 

 

its not working as expected, because some relays still closed after calling the disconnectall function, and please note that when calling the alternative function which is intialise with reset, its works, but sometimes (1 of 10) relays are not oppened !

0 Kudos
Message 7 of 8
(2,364 Views)

Is it the same relay that doesn’t open? Can you get this relay to open by using the soft front panel?

0 Kudos
Message 8 of 8
(2,348 Views)