Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni8452 finddevice function in C API

Hey,

 

I am using a Ni8452 for sending DIO signal. I am trying to configure it to a computer and control it using python in VS studio code. I have the driver installed and the have the proper dll path specified in the ni845x.py as shown below 

 

anikjj97_0-1750139137891.png

 

However in the line of self.i2c.ni845xFindDevice() it throws an error as following :


" self.status_code = self.i2c.ni845xFindDevice(self.first_device, self.find_device_handle, number_found)
ValueError: Procedure called with not enough arguments (12 bytes missing) or wrong calling convention"

 

Over the internet that if the dll is 32 bit then it is better to call the dll using wdll function instead of cdll in the load library function after changing it c.cdll.LoadLibrary(self.dll_location) i get this following error:

" self.status_code = self.i2c.ni845xFindDevice(self.first_device, self.find_device_handle, number_found)
AttributeError: 'NI8452Interface' object has no attribute 'i2c' "

 

How can I fix this issue ? Has anyone face any similar issue regarding this? Please let me know it is quite urgent.

0 Kudos
Message 1 of 3
(154 Views)

Please see if this works instead https://github.com/amitibo/pylibni845x

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 3
(147 Views)

Hello ,

 

thank you for your reply. This one only has I2C configuration. I want to configure some DIO pin to generate a pulse wave. I am not sure whether I can do this with I2C. 

0 Kudos
Message 3 of 3
(138 Views)