VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

pyvirtualbench

Hello, 

 

Has anyone every tried using pyVirtualBench, a python wrapper for virtual bench?  If so, how is it working for you? 

Message 1 of 8
(8,156 Views)

Hello niColleen,

 

Maybe you could also try asking this question on the pyVirtualBench community:

 

http://community.armstrap.org/


Regards,
Daniel M.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 8
(8,125 Views)

Thanks, Daniel. 

 

I was more trying to see if anyone was able to get the example code to work.  

 

I tried running any of the example code and I got the following error: 

Error/Warning -375941 occurred

NI-VirtualBench: Unable to find device.  

Device Name: myVirtualBench

 

I was able to find the VB device using the executable bench software, but not using the python wrapper.  So just wondering if anyone had tried this code and had any issues.  

 

Thank you. 

- C

0 Kudos
Message 3 of 8
(8,050 Views)

You will probably need to replace "myVirtualBench" with the name of your device.

 

By default, the device name is the model number and serial number separated by a hyphen; e.g., "VB8012-309738A".

 

You can see the device's name in the VirtualBench Application under File->About.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 8
(8,034 Views)

Thanks Brandon.  That solved the issue for running several of the example cases, but for the i2c example I'm still having some issues.  

 


File "pyvirtualbench.py", line 2120, in write_read
status = self.nilcicapi.niVB_I2C_WriteRead(self.instrument_handle, c_char_p(str(write_data)), c_size_t(len(write_data)), c_double(timeout_in_secs), c_pointer(number_of_bytes_written), byref(read_data), c_size_t(read_data_size))

NameError: global name 'c_pointer' is not defined

 

I don't think there's a c_pointer in python in ctypes.  Any thoughts? 

 

Thanks!

0 Kudos
Message 5 of 8
(7,894 Views)

The C API definition has that as a pointer to a signed 32-bit integer:

niVB_Status NIVB_DECL niVB_I2C_WriteRead(
   niVB_I2C_InstrumentHandle instrumentHandle,
   const uint8_t* writeData,
   size_t writeDataSize,
   double timeout,
   int32_t* numberOfBytesWritten,
   uint8_t* readData,
   size_t readDataSize);

I think, looking at the ctypes documentation, that in place of "c_pointer(number_of_bytes_written)" that should be "byref(number_of_bytes_written)".

 

You may want to consider filing an issue about it on the pyvirtualbench github project.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 6 of 8
(7,888 Views)

Someone please answer this question ...

I am also getting same problem...

plz post the Video regarding that ...

Thanks in advance.

 

 

0 Kudos
Message 7 of 8
(5,126 Views)

http://community.armstrap.org/  could not opened

0 Kudos
Message 8 of 8
(4,654 Views)