LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DC POWER RESET DEVICE VI

I am trying to use NI DC POWER RESET DEVICE.VI to reset my PXIe cards without using NI MAX but when i run the vi , the following msg pops up.error.PNG

0 Kudos
Message 1 of 4
(900 Views)

Please attach your code. We cannot debug an image. We can't even know what's wrong with your code without the block diagram.

You can also reset the device using the NI System Configuration API (the driver for NI MAX). See <LabVIEW>examples\nisyscfg\Reset All Devices.vi

You can use dcpowerscx as the filter experts.

ZYOng_0-1684415859960.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 2 of 4
(868 Views)

Sorry for the inconvience but the problem was I was not initializing the instrument handle that's why it was giving error .I have now initialozed it nidcpower initialize with channels and it is working fine but I can reset the cards one by one and when I try to implement it in python , sometimes it gives error like 

"There is already a session open to the device from another process, or a calibration session is open. You must close the open session, exit the application holding the device, or release the device in the Soft Front Panel."

 

I am attaching both the implementations:

labview.PNG

 

PYTHON CODE

 

import nidcpower

def reset_cards(resource_name)
        with nidcpower.Session(resource_name=resource_name,reset=True) as my_session:
                  print('hello')
                  my_session.reset_device
                  print('Hi')


            #selecting and opening/initializing the channels
     
resource_name ='PXIe_4137_2'
reset_cards(resource_name)
 
 
The Labview code does not give this error but the python code gives me above error for some PXIe slots.
0 Kudos
Message 3 of 4
(815 Views)

Did you call niDCPower Close VI or my_session.close explicitly at the end of your code? LabVIEW might release the resource automatically for some drivers if it is a top VI. However, this feature is not available for text programming and you need to release the resource explicitly.

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 4 of 4
(798 Views)