How do I create something like a class and have instances of it in ABB RAPID language?
In reviewing the PDF for the RAPID language, it looks like you don't. I can't see anything online that states the RAPID language is object oriented. The manual doesn't even contain the word "class" once, and the language doesn't seem to support structures or methods.
Turns out the closest thing to a Struct is a RECORD you can write:
MODULE myModule
RECORD myRecord
pos a;
num b;
sring c;
END RECORD
PROC main()
myRecord{1,1}.a.x := 123;
myRecord{1,2}.b := 1234;
ENDPROC
ENDMODULE
You can put a RECORD within a RECORD but you cannot put an array in a RECORD.
So RAPID is not object oriented