Hi,
How do I interpret RTIME? I mean how do I extract the actual time in
terms of RT-ticks or secs. Can somone please give a detailed explanation on
this.
In my program I would like to know the exact time when the data is put
on the parallel port. Just after I put data on the PP, I put the current
RT-time into a RT_FIFO on the RT-task side which is extracted in the user
space. I tried the following.....please comment if this is a right way of
doing it........ I get erronious data in the output......
===================================
.......in RT_MODULE.C
...
RTIME sampf;
outb(dat, LPT_PORT);
sampf=rt_get_time(); // store it in a variable
rtf_put(1, &sampf, sizeof(sampf)); // put the variable in a FIFO
...
..
=====================================
..........IN US_APP.C
...
..
RTIME sampff;
unsigned long low_word; // declare low_word and high_word
unsigned long high_word;
read(rcv, &sampff, sizeof(sampff)); // read the data from the FIFO
low_word= low_word | sampff; // extract the low_word
sampff= sampff>>32; // shift by 32 bits
high_word= high_word | sampff; // extract the high_word
.....
fprintf(fp,"%lu %lu\n",high_word,low_word); // print the result to a
file
....
...
===================================
When I read the values in the file........
I see
1 3189390619
1 3189390651
1 3189390715
1 3189390843
1 3189390847
1 3189390847
1 3189391359 // see the constant low_word from down here
1 3189391359
1 3189391359
...
1 3189407743 // constant again
1 3189407743
1 3189407743
....
--- [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/