Jump to content
OMRON Forums

sprintf in kernel space


hrektts
 Share

Recommended Posts

Hi,

 

I wonder if anyone can give me some advice please?

I would like to use "sprintf" in User Servo Algorithm to format double variables. Are there any functions to achieve this?

 

I found "rtsprintf" in /opt/ppmac/usralgo/usrcode.h in Power UMAC. However, it was just a prototype.

 

Thanks,

hrektts

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I would like to log data in a user servo. My program is composed of a user servo and a background C program. I want them to work as follows:

 

1) composes formatted string in a user servo <- I will use "sprintf" here.

2) passes the string to a FIFO, which I wrote, in a user servo

3) gets the string from a FIFO in a background C program

4) writes the string to a file

 

Are there any established ways?

Link to comment
Share on other sites

A much better way to do this is to pass your data directly to your background C program via FIFO or shared memory. Then your background task can convert the data to string and write it to a file.

 

I think sprintf can technically be done in the kernel (via vsnprintf), but it is tricky and can really mess up the determinism of your servo/phase loops if you aren't careful.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...