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 0
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 post
Share on other sites
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now