The current pulley number is stored in field #2013, so you have to check this value in a macroloop and if it is 2 then set the output else clear the output. Below is a macro for this. Save it to the Profiles\Macro_yourprofilename folder as Mxxxx where xxxx is any number that is not used. (E.g. 20000, you can see the profile name on the main screen.) Go to General settings, press Config macroloops and set the number you used to an empty row. Tick Autorun, click Run, click Save settings. Don't forget to edit outputPort and outputPin, I tested with port #3 pin #17.
- Code: Select all
// ================================================================================================
// Check pulley, set output when pulley is 2 (M215 P2)
// ================================================================================================
const int outputPort = 3;
const int outputPin = 17;
bool isPulley2 = (AS3.Getfieldint(2013) == 2);
if (firstRun)
{
// Force output to be set/clear on startup
lastIsPulley2 = !isPulley2;
firstRun = false;
}
if (isPulley2 != lastIsPulley2)
{
// isPulley2 changed
if (isPulley2)
exec.Setoutpin(outputPort, outputPin);
else
exec.Clroutpin(outputPort, outputPin);
lastIsPulley2 = isPulley2;
}
// ================================================================================================
#Events
// ================================================================================================
bool firstRun = true;
bool lastIsPulley2 = false;
// ================================================================================================