c array

L

luca72

hello i'm using ctypes

i have this c function
PREF0 short usb_tc08_get_single (
short handle,
float * temp,
short * overflow_flags,
short units);
where :
nt main(void)
{
short handle = 0; /* The handle to a TC-08 returned by
usb_tc08_open_unit() */
char selection = 0; /* User selection from teh main menu */
float temp[9]; /* Buffer to store temperature readings from
the TC-08 */
int channel, reading; /* Loop counters */
int retVal = 0; /* Return value from driver calls indication
success / error */
USBTC08_INFO unitInfo;/* Struct to hold unit information */

how i can pass the value using c types?
strumento = ctypes.cdll.LoadLibrary('libusbtc08.so') and here is ok
but when i call the function
strumento.short usb_tc08_get_single(arg1, arg2,arg3,arg4)
arg1 is 0 arg2 2 is a carray i dont know how to convert, arg3 is none
and arg 4 is a string here is the c example
usb_tc08_get_single(handle, temp, NULL, USBTC08_UNITS_CENTIGRADE)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top