Thanks for all the help and suggestions.
I investigated more about the topic and think I understand it a bit more.
Although I understood the code you posted, my experience is with Fanuc robots. Do you have any examples you could share using Fanuc code?