BoSChoW
Member
Hi guys,
i was trying to make a program in simatic step 7 with which i could with the useing of a switch choose between automatic, manual and step mode. Any ideas how do i do that in SCL. I was trying to do it with a CASE statemant followed by an IF but i failed, it seems that the program remains stuck in the CASE statement in the last execution . . . The program looks like this:
IF auto OR step //if auto mode or step mode is selected
THEN
CASE auto OF
1: IF op_inp.DW0=plc_inp.DW0 //if the value of inputs tyed in OP7 is equal to number of connected inputs
THEN output1:=true; output2:=false; steping:=2;
ELSIF op_inp.DW0<>plc_inp.DW0 //if the values are not equal
THEN output1:=false; output2:=false; steping:=1;
END_IF;
.
.
.
.
16: IF op_inp.DW16=plc_inp.DW16 //if the value of inputs tyed in OP7 is equal to number of connected inputs
THEN output15:=true; output16:=false; GOTO I;
ELSIF op_inp.DW0<>plc_inp.DW0 //if the values are not equal
THEN output15:=false; output16:=false; steping:=16;
END_IF;
END_CASE;
I: IF auto //if auto mode is selected
then step:=steping; //the value of steping is aquired by step
else
IF step //is setp mode is selected
then
IF start //and if the start button is pressed
then step:=steping; // the value of steping is aquired by step
else GOTO I;
END_IF;
END_IF;
END_IF;
This is my version of the program and any other suggestions are very much aprishiated. Thank you for your help and time.
i was trying to make a program in simatic step 7 with which i could with the useing of a switch choose between automatic, manual and step mode. Any ideas how do i do that in SCL. I was trying to do it with a CASE statemant followed by an IF but i failed, it seems that the program remains stuck in the CASE statement in the last execution . . . The program looks like this:
IF auto OR step //if auto mode or step mode is selected
THEN
CASE auto OF
1: IF op_inp.DW0=plc_inp.DW0 //if the value of inputs tyed in OP7 is equal to number of connected inputs
THEN output1:=true; output2:=false; steping:=2;
ELSIF op_inp.DW0<>plc_inp.DW0 //if the values are not equal
THEN output1:=false; output2:=false; steping:=1;
END_IF;
.
.
.
.
16: IF op_inp.DW16=plc_inp.DW16 //if the value of inputs tyed in OP7 is equal to number of connected inputs
THEN output15:=true; output16:=false; GOTO I;
ELSIF op_inp.DW0<>plc_inp.DW0 //if the values are not equal
THEN output15:=false; output16:=false; steping:=16;
END_IF;
END_CASE;
I: IF auto //if auto mode is selected
then step:=steping; //the value of steping is aquired by step
else
IF step //is setp mode is selected
then
IF start //and if the start button is pressed
then step:=steping; // the value of steping is aquired by step
else GOTO I;
END_IF;
END_IF;
END_IF;
This is my version of the program and any other suggestions are very much aprishiated. Thank you for your help and time.