armstrap / armstrap-pyvirtualbench Goto Github PK
View Code? Open in Web Editor NEWPython wrappers to control NI VirtualBench
License: Other
Python wrappers to control NI VirtualBench
License: Other
I have tried to run the example after renaming my device to match the dio_exampl.py program. Command line spits this out, but I have not found any solution to the problem yet, anyone else see this?
python dio_example.py
Traceback (most recent call last):
File "dio_example.py", line 42, in
dio = virtualbench.acquire_digital_input_output(channels_to_write);
File "C:\Program Files\Python36\lib\pyvirtualbench.py", line 525, in acquire_digital_input_output
return self.DigitalInputOutput(self, lines, reset)
File "C:\Program Files\Python36\lib\pyvirtualbench.py", line 533, in init
status = self.nilcicapi.niVB_Dig_InitializeW(self.library_handle, c_wchar_p(self.lines), c_bool(reset), byref(self.instrument_handle))
OSError: exception: access violation reading 0x0000000010D98990
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "dio_example.py", line 53, in
virtualbench.release()
File "C:\Program Files\Python36\lib\pyvirtualbench.py", line 381, in release
status = self.nilcicapi.niVB_Finalize(self.library_handle)
OSError: exception: access violation writing 0x0000000010D98998
I get this error message when I run the acquire_digital_multimeter function. Any clue what is the error due to?
File "", line 1, in
dmm = virtualbench.acquire_digital_multimeter();
File "C:\Users\Admin\Payam Rabiei Dropbox\Partow\Measurement\Device Measurement\Python\armstrap-pyvirtualbench-master\lib\pyvirtualbench.py", line 1648, in acquire_digital_multimeter
return self.DigitalMultimeter(self, device_name, reset)
File "C:\Users\Admin\Payam Rabiei Dropbox\Partow\Measurement\Device Measurement\Python\armstrap-pyvirtualbench-master\lib\pyvirtualbench.py", line 1656, in init
status = self.nilcicapi.niVB_DMM_InitializeW(self.library_handle, c_wchar_p(self.device_name), c_bool(reset), byref(self.instrument_handle))
OSError: exception: access violation reading 0x000000003679CEE0
It seems my python code gets until incl second line
virtualbench = PyVirtualBench('VB8012-30DB550')
print(virtualbench)
ps = virtualbench.acquire_power_supply()
at acquire_power_supply() I get following error:
<pyvirtualbench.PyVirtualBench object at 0x00000184F9266A30>
Traceback (most recent call last):
File "C:/Users/glanzer/PycharmProjects/pyVirtualBench/testPSandDMM.py", line 18, in <module>
ps = virtualbench.acquire_power_supply()
File "C:\Users\glanzer\PycharmProjects\pyVirtualBench\venv\lib\site-packages\pyvirtualbench.py", line 1938, in acquire_power_supply
return self.PowerSupply(self, device_name, reset)
File "C:\Users\glanzer\PycharmProjects\pyVirtualBench\venv\lib\site-packages\pyvirtualbench.py", line 1946, in __init__
status = self.nilcicapi.niVB_PS_InitializeW(self.library_handle, c_wchar_p(self.device_name), c_bool(reset), byref(self.instrument_handle))
OSError: exception: access violation reading 0x00000000F74B8AF0
Any hint or help would be awesome!
Hi there
Just two small issues:
In method set_calibration_information(..)
on line 493
there is a wrong passing of the local device name to the API call, because the class member c_wchar_p(device_name)
is passed directly, instead of c_wchar_p(local_device_name)
.
In method set_calibration_password(..)
on line 502
the assignment of local_device_name = ..
is missing completely and is therefore not being passed to the API call.
Thank you for your work.
Since the dmm.read() function returns the value in float, when a DMM overrange occurs (in resistance measurement), it stops the execution of the code. I hope this bug could be fixed and return a value like NAN or overrange, as it would allow for the automation without affecting the flow of the code.
Hello!
I am really happy that I finally found support for the NI VirtualBench! Thanks a lot! Unfortunately I have a problem running the mso_simple_example.py It throws me an error at line 446 of pyvirtualbench.py "TypeError: can't multiply sequence by non-int of type 'c_ulonglong'"
Any suggestions how I can work arround this?
Thanks!!
Leopold
File "", line 1, in
runfile('C:/Users/gleo/Downloads/armstrap-pyvirtualbench-master/armstrap-pyvirtualbench-master/examples/mso_simple_example.py', wdir='C:/Users/gleo/Downloads/armstrap-pyvirtualbench-master/armstrap-pyvirtualbench-master/examples')
File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/gleo/Downloads/armstrap-pyvirtualbench-master/armstrap-pyvirtualbench-master/examples/mso_simple_example.py", line 97, in
channels_enabled, number_of_channels = virtualbench.collapse_channel_string(channels)
File "C:\Anaconda3\lib\pyvirtualbench.py", line 446, in collapse_channel_string
names_out = (c_wchar * names_out_size)()
TypeError: can't multiply sequence by non-int of type 'c_ulonglong'
When running the MSO with two digital channels enabled, I get a list of values that are either 0, 1, 2, or 3. This doesn't make sense to me. What does a 2 and a 3 correlate to in binary digital data?
Hello,
Could someone help me with the install of pyVirtualBench? I put the pyvirutalbench.py file in my "C:\Anaconda2\lib" folder by when I run one of the example programs i get the following error: "WindowsError: [Error 126] The specified module could not be found"
It is possible I missed it in the example, but how does the I2C code read from a specified register?
I see where the slave address is configured, that is straight forward.
If I wanted to read register 0x31 from device address 0x50, how would I do that?
My version of the NI driver (18.0.0) comes with a lib64 compiled nivirtualbench.lib. Would it be possible to update the Python wrapper to support this?
I can run ps_example.py
fine on 32-bit Python, but on 64-bit I get:
Traceback (most recent call last):
File "examples/ps_example.py", line 43, in <module>
ps = virtualbench.acquire_power_supply()
File "C:\Users\User\armstrap-pyvirtualbench\lib\pyvirtualbench.py", line 1938, in acquire_power_supply
return self.PowerSupply(self, device_name, reset)
File "C:\Users\User\armstrap-pyvirtualbench\lib\pyvirtualbench.py", line 1946, in __init__
status = self.nilcicapi.niVB_PS_InitializeW(self.library_handle, c_wchar_p(self.device_name), c_bool(reset), byref(self.instrument_handle))
OSError: exception: access violation reading 0x0000000063AB4490
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "examples/ps_example.py", line 56, in <module>
virtualbench.release()
File "C:\Users\User\armstrap-pyvirtualbench\lib\pyvirtualbench.py", line 382, in release
status = self.nilcicapi.niVB_Finalize(self.library_handle)
OSError: exception: access violation writing 0x0000000063AB4498
If you can provide any guidance on what changes would be necessary, I can look into doing this and submitting a PR.
Power Supply doesn't allow to enable multiple channels with different settings.
MSO doesn't either.
I was wondering if that issue is known and if it can be fixed. There has no activity on this repo for Quite a long time.
Regards
Hi all
I have attempted to run a few of the example scripts however I keep running into the same error " NameError: name 'virtualbench' is not defined ". I believe that I have followed the correct steps outlined in the commenting and documentation so any input would be very much appreciated.
Hi there,
First of all, big kudos for pushing this project out. I love my VBench and used your examples successfully for the frequency generator without problems. However, I'm having an issue with the I2C example. First I was getting an issue from the acquire_inter_integrated_circuit command. Comparing the class structure to the SPI class, it looked like line 2201 should have been
self.bus = bus
rather than
self.bus = outer.bus
This stopped an issue with running the code (SPI_Example runs fine by the way). However, then I get an issue with C types as shown below:
<<
but basically a NameError on the c_uint16 of the address variable.
Any ideas you have would be MOST appreciated! I am looking at the updated NI Driver (rev 1.2 -> I'm using 1.1.1) so maybe that already resolves this bug?
Side note - how do you decide which of the digital IO lines are the SCLK/SDA? I couldn't really tell that in the example code.
Thanks!
-Paul
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.