09-13-2018 02:52 AM
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?
09-14-2018 02:29 PM
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?
09-24-2018 01:53 AM
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