RAPID Registers

In the “RAPID Instructions, Functions and Data types” manual and others I see references to using registers (“Add reg1, 3;”) but I can’t find a description of those registers anywhere. Can someone point me to where I can learn about those?

reg1,reg2,… reg5 are built in variables for assigning numeric values. They are located in a system module named ‘USER.SYS’ and the module is loaded automatically when you start the controller.

Yes, they are numeric datatypes, NUM. As with any of the predefined datatypes, you are free to create your own, call them what you like, and store them wherever you need to. They can be either local or global, and of the VAR, CONST or PERS type.

How are they accessed to change them?

You can use the assignment instruction as in reg1:=5.

Thank you for your reply on this old topic!

That would be a set value, (reg1:=5) no?

If it needs to be adjustable, then is “reg1” from an input on the numbered keyboard?

It can be assigned the value of any other variable of the same datatype or an alias datatype. It could be the result of a formula or even another datatype if it has the same atomic component of num. For example, reg1:=p10.trans.x;

And yes, it could be a prompt like TPReadNum.

So with that said, “reg1” is a physical location on the Teach Pendant (TPReadNum, which is from the keypad).

I appreciate your patience and help with this. I operated the ABB’s for over 20 years but have been away from this for about 14 years now and am getting back into it. It’s been coming back to me but still have a little way to go. It’s nice having this forum for sure. This wasn’t around when I was doing it last.

You are welcome. The data don’t actually reside on the pendant, it is in the controller’s memory. But how else would you be able to view and make instructions using it? The pendant, of course. That is, unless you have an IRC5 or newer controller, you could connect with robotstudio and make changes and apply programming changes.

Unfortunately not. All the ones we have are older models using the S4 pendant. I’ve already looked into RobotStudio and it isn’t compatible with them.

I understand what you are saying about the reg’s. Thanks again! Now I need to skim thru some of the older posts about “IF” command. I need to add a subroutine to perform a function until certain conditions are met. Any ideas where I may find that?

Start with the knowledge hub button at the top of the forum page. You can also go here:

https://www.robot-forum.com/robotforum/thread/25347-baseware-2-1-rapid-reference-manual-user-s-guide/

Thank you!! :+1: