Hello,
I am trying to assign one of the programmable keys to an interrupt, this would then run a routine to allow the user to edit a variable.
I have the P2 key connected to the input called di16_spare.
http://s11.postimage.org/h9iq5zx1v/photo.jpg
However:
- In the IO page, when I press the P2 key, the state of di16_spare doesn't change.
- when I run the program, when I press the P2 key it doesn't run the interrupt routine.
I have read some of the other threads about this topic, but I still can't get it to work. Any suggestions?
When I changed the ISignalDI line to DI7 (a toggle switch) then the interrupt worked. I just can't get it to work with the P2 key on the pendant.
I attended the ABB Advanced Programming Class at Auborn Hills in November, but I don't remember how to do this...
---------------------------------------------------------------------------------------------
%%%
VERSION:1
LANGUAGE:ENGLISH
%%%
MODULE TEST_INTERRUPT
VAR intnum intno1:=0;
PERS num height:=50;
CONST robtarget p10:=[[463.69,1155.18,1972.55],[0.239518,-0.168385,0.790093,0.538546],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PROC ENABLE_INT()
CONNECT intno1 WITH trap_p2;
ISignalDI\Single,di16_Spare,1,intno1;
IEnable;
IWatch intno1;
RETURN;
ENDPROC
TRAP trap_p2
TPErase;
TPReadNum height,"how high to offset";
TPErase;
ENDTRAP
PROC main()
ENABLE_INT;
MoveJ p10,v400,z0,tool0;
MoveL Offs(p10,0,0,height),v400,z0,tool0;
IDelete intno1;
ENDPROC
ENDMODULE