ctypes

L

luca72

hello i have this api
PREF0 short usb_tc08_get_single (
short handle,
float * temp,
short * overflow_flags,
short units);

this is a sample program made in c
int 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 */

usb_tc08_get_single(handle, temp, NULL, USBTC08_UNITS_CENTIGRADE);

handle is c_short, but how a can define temp and the other two value?

myist.usb_tc08_get_single.argtypes = [ctypes.c_short, ctypes.c_float,
ctypes.c_short, ctypes.c_short] ----------is correct?
myist.usb_tc08_get_single.argtypes.restype = c_short ------- is
correct?

but whe i call myist.usb_tc08_get_single(0,
[9],NULL,USBTC08_UNITS_CENTIGRADE )

i get argument 2 wrong type
can you explain how to execute this function
Thanks

Luca
 

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,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top