Sure....
Set Trigger Macro using “Push User Button” in Brians:
First, you dont put the code in a button, you put it in a macro file. For
example file: m600.m1s
SetMessage( "This is a macro call..")
Then , you have to set that macro to be the default macro call with a call to
SetTriggerMacro( 600 ) at some point in the program, an init string could do
that if the SetTriggerMacro call were in another macro file that is called on
startup. Then the brain will execute m600 whenever that brain termination code is
called.
hehehehe.......... sorry couldn't resist...
Ok Make the "Macro" that you want to be triggered, for instance M600 as above this macro does what ever....
then if you want it to auto trigger you have to set it using the set macro call. this will be a SEPERATE macro call.
So under General cfg, in the Init Put your set trigger macro in the init line, call it M1000.m1s
in that macro put the set trigger macro call:
'M1000.m1s (in the init line)
SetTriggerMacro( 600 )
//////////////////////////
When Mach starts up, it runs the "Init" line, which in turn runs the SetTriggerMacro call and sets which macro number will trigger
i.e. M600.m1s
So, in Brains..... you have your even that triggers your "Trigger Macro button" termination.......
for aurguments sake, lets say you use ULED 2000 to trigger that function.
so your rung would look like: NOTE!! You may, or may not have to make an invert OP call after the ULED
depending on where it is coming from.
ULED 2000->Invert OP->Trigger Macro Button
so when ULED 2000 turns on, it will run the function that runs the macro you have set in the trigger.....
see!!!! Simple as PIE!!!!!!!! hehehhehehehe ( NOT!!!!! )
scott