Maybe u can use a trap routine in your RAPID code for changing active mechanical unit.When u press button6, set a virtual signal to 1 and catch it with a trap routine.
VAR intnum Ileri;
IDelete tx;
CONNECT Ileri WITH IRBc;
ISignalDO doVirtual,1,tx;
TRAP IRBc
ActUnit INTERCH;
ENDTRAP
And at the end of ur button6_click event reset virtual signal.
Thanks for the help for the tip. But I’ve already tried that, calling a Rapid program first with ActUnit Interch, and after to tried to read the value, but it gave me always “0”.
Further, I found that, changing on the Virtual FlexPendant to the INTERCH and using the following code (similiar to read robot axis number 1) it gaves me the correct value of the external axis (INTERCH).