Add-On Instruction routine examples
These examples show routines in add-on instructions.
Add-on instruction definition with an externally specified logic routine
aoi MyAOIDef (required input dint myinput { desc:=”hello”;},output dint myout { visible := false; },required inout dint myInOut { desc := “hello”; }){tag dint someLocalTag;
extern routine logic() // Forward declares for external logic specification
}
NOTE:
External specification indicates that the routine is in some other file. The file extension denotes the language type.
Add-on instruction definition with an inline routine specification
aoi MyAOIDef (required input dint myinput { desc:=”hello”;},output dint myout { visible := false; },required inout dint myInOut { desc := “hello” ;}){routine ld logic {xic(myInput.1) Mov(2, myout) ote(myOut.1);}routine preScan { nop(); }
}
Add-on instruction instance declared and called from a routine
routine ld myRoutine() {// using AOI instance to access backing data (as done today)xic(myAOI.done) xic(myAOI.myOut) nop();
tag MyAOIDef_type myAOI; // declaring aoi backing tagtag MyAOIDef_type myAOI2;
// AOI name is the mnemonicMyAOIDef (myAOI, sInput, sOut, sInOut);MyAOIDef (myAOI2, sInput, sOut, sInOut);
}
Logic routine accessing add-on instruction parameters
aoi MyAOIDef (input dint myinput { desc:=”hello”; },output dint myout,inout dint myInOut { desc := “hello”; }){tag dint someLocalTag; // tag defined in AOI
routine ld logic() {Xic(someLocalTagt.1) mov(2, myout) ote(myout.1);}
}
Provide Feedback