From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

Pxie-4139: python

Dear, 

I'm starting to use python code to drive the Pxie-4139 board. I'm working on PXie-8821 with windows7 64 bit

I found this site https://pypi.org/project/nidcpower/ and install module and library.

This is an example code

 

import nidcpower

def example(resource_name, channels, options, voltage, length):
    
    
    with nidcpower.Session(resource_name=resource_name, channels=channels, options=options) as session:


        print(resource_name)
        # Configure the session.
        session.measure_record_length = length
        session.measure_record_length_is_finite = True

        session.measure_when = nidcpower.MeasureWhen.AUTOMATICALLY_AFTER_SOURCE_COMPLETE
        session.voltage_level = voltage
        print(session.get_channel_name)

        session.output_function = nidcpower.OutputFunction.DC_VOLTAGE
        session.current_limit = 100e-3

        
        session.commit()
        
        print('Effective measurement rate: {0} S/s'.format(session.measure_record_delta_time / 1))

        samples_acquired = 0
        print('  #    Voltage    Current    In Compliance')
        row_format = '{0:3d}:   {1:8.6f}   {2:8.6f}   {3}'
        
        with session.initiate():
            while samples_acquired < length:
                measurements = session.fetch_multiple(count=session.fetch_backlog)
                samples_acquired += len(measurements)
                for i in range(len(measurements)):
                    print(row_format.format(i, measurements[i].voltage, measurements[i].current, measurements[i].in_compliance))

       

    
options = {'simulate': False, 'driver_setup': {'Model': '4139', 'BoardType': 'PXIe', }, }
example('PXI1Slot2', '0', options, 3.0, 1)


And here the result

DriverError: -1074097933: Amount of time allocated to perform this operation was exceeded.

Information concerning the primary and secondary error codes has already been added to the error elaboration and therefore does not need further elaboration.

Amount of time allocated to perform this operation was exceeded


Probably there is an error with the library.
.
Any suggestion? 



 

 

 

 

0 Kudos
Message 1 of 3
(3,700 Views)

How did you run the example? Parameters, and so forth. Maybe post the full text of the command line.

Did you debug enough to see which function raised the error? 

Marcos Kirsch
Chief Software Engineer
NI Driver Software
0 Kudos
Message 2 of 3
(3,670 Views)

I used python(x,y) and function gave me this output. I'm trying to do other tests, but I'm think there be some driver problems. I'll let you know


0 Kudos
Message 3 of 3
(3,639 Views)