PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

The NI DC power Python library interferes with Python's library "pexpect"

Hi There,

 
We found a problem on Ubuntu 22.04 that the nidcpower session is conflicting with Python library "pexpect".
Basically when the nidcpower session is alive, the ssh will fail. I attached two sample python programs modified from the sample program by NI (https://github.com/ni/nimi-python/tree/1.1.5).
The difference between these two sample python programs is whether the ssh client codes are inside the context manager of "with nidcpower.Session(resource_name=resource_name, channels=channels, options=options) as session:"
When they are inside the context manager, the ssh will fail. But if they are outside it, the ssh could succeed.
 
Can you try it on your end and let us know why this is happening?
 
To reproduce the problem, you will need another computer (I was using another Ubuntu PC) and make sure you can ssh to it without a password. You can use this command to run the programs "python3 ni_power.py -n NI-PS -c 0 -v 0.5". (You need to change the python file names to ni_power.py though, or modify the file name in the command)
 
Thanks,
Daniel
0 Kudos
Message 1 of 1
(33 Views)