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 ratefor(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);}elseif(dio8="0"){
END
}}//Error in: "file 2" line: 28 "else if (dio8="0"){END}"//SyntaxError: Parse error
Question
Arctic
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.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.