I don't have much programming experience, but would like to energize and run script only when IO8 is ON, if not the script wont run but will continue scanning IO8.
clear()
if(!('StaticIO' in this)) throw "Please open the StaticIO instrument";
var IO=7
print("Running StaticIO script");
StaticIO.Channel1.Mode.text = "IOs";
StaticIO.Channel0.Mode.text = "IOs";
var dio8=StaticIO.Channel1.DIO8.Input.value
StaticIO.run()
while( dio8="1" ){ //DIO 8
// Loop at .3s rate
for(var c = 0; c <= IO; c++){
StaticIO.Channel0.DIO[c].text = "1";
wait(.3);
StaticIO.Channel0.DIO[c].text = "0";
wait(.3);
}
for(var c = IO; c > 0; c--){
StaticIO.Channel0.DIO[c-1].text = "1";
wait(.3);
StaticIO.Channel0.DIO[c-1].text = "0";
wait(.3);}
else if (dio8="0"){
END
}
}
//Error in: "file 2" line: 28 "else if (dio8="0"){END}"
//SyntaxError: Parse error