Hi, Dear All,
Please excuse me for this maybe a newbie question. I need to collect
Analog Input using my DAQ card, and put the data ( int data) into FIFO
(dev/rtf1), then handle these data in user space. Following is part of
the codes:
------------------------
int data;
char * buf;
comedi_read_data(cf,AI_device, AI_chan,range,aref,&data);
rtl_printf("AI data = %d \n", data); (1)
rtf_put(1,"data=32776", 10); (1)
sprintf(buf, "%d", data); (2)
rtf_put(1,buf,sizeof(data)); (2)
------------------------
If I try the two line codes labled (1) , the program works, it could
collect data from Analog Input and print it out, also, my user space
main program could get the character string "data=32776".
However, actually I want the main user space program to get the value of
integer "data", so I change the codes to the two lines labeled (2), I
put the integer "data" to a char buffer "buf", and put its contents into
FIFO /dev/rtf1, and want the main user space program to get this value.
But, very time I "insmod" this module, the computer freeze. I don't
know why?(just due to "sprintf"?)
Now I could not send my kernel AI data collection value to user space
through FIFO, could you please point out where I was wrong? Thanks a
lot for any kind hints.
Best regards,
Yuhong
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/