Hi guys, I'm new here and very much new to writing macros, I've done a few for probing on my machine but have a simple problem I can't seem to figure out. I just want to have a macro running in the background to turn on an output if the machine position is above 1500mm and turn it off it they are below, here is what I have so far:
int pistonPort = 1;
int pistonPin = 1;
double Ymachposvariable = exec.GetYmachpos();
if(double Ymachposvariable > 1500)
{
exec.Setoutpin(pistonPort, pistonPin);
}
if(double Ymachposvariable < 1500)
{
exec.Clroutpin(pistonPort, pistonPin);
}