rtapi_task_start(3rtapi)

πŸ’– rtapi_task_start β€” from the 3rtapi manual, bestie πŸ’–

okay so you're here for rtapi_task_start, and honestly? iconic behavior. this is a <cyan>3rtapi</cyan> page, which means it's RTAPI-flavored, and it's about kicking a realtime task into periodic mode. let's get into it πŸ¦‹


✨ NAME ✨

rtapi_task_start β€” start a realtime task in periodic mode 🌸


✨ SYNTAX ✨

int rtapi_task_start(int task_id, unsigned long period_nsec)

that's the whole signature, no notes, she's clean πŸ’…


✨ ARGUMENTS ✨

  • task_id β€” a task ID that you got back from an earlier call to rtapi_task_new. like, you can't just make one up, bestie, she needs to be a real one 🫢
  • period_nsec β€” the clock period, in nanoseconds, between iterations of a periodic task. yes nanoseconds. yes that's tiny. that's the whole point ⭐

✨ DESCRIPTION ✨

so rtapi_task_start starts a task in periodic mode. that's the vibe. πŸŽ€

but here's the thing β€” the task must be in the paused state. that's non-negotiable, that's the vibe check, she will not go otherwise πŸ’€


✨ REALTIME CONSIDERATIONS ✨

call this only from within init/cleanup code, not from realtime tasks. like literally do not. this is not a realtime-context function and she is not trying to be 😭

✨ RETURN VALUE ✨

returns an RTAPI status code. that's it, that's the tea β˜•


✨ SEE ALSO ✨

the whole friend group, go read them too πŸ‘‘


mwah πŸ’œ that's the page. this was pulled from the LinuxCNC Documentation, dated 2006-10-12, and the page itself is rtapi_task_start(3rtapi). go start a task, bestie, you got this ✨🌈