Hey,
i need help to write a structured text program that set a signal to high 6s and to low 6s. I used TONR to do this but it doesn't work
I wote the same program in ladder logic and that program works fine find attached the program here
i need help to write a structured text program that set a signal to high 6s and to low 6s. I used TONR to do this but it doesn't work
Code:
TONR_0.PRE := 6000;
TONR_0.Reset := Reset ;
TONR_0.TimerEnable:= 1;
TONR(TONR_0);
timer_state := TONR_0.DN;
TONR_1.PRE := 6000;
TONR_1.TimerEnable:= timer_state;
TONR_1.Reset := Reset;
if timer_state then
TONR(TONR_1);
if TONR_1.DN AND Local:1:I.Data.1 then
TONR(TONR_0);
end_if;
end_if;
if TONR_0.DN then
impact67_55144:O1.Data[0]:= -1;
impact67_55144:O1.Data[1]:= -1;
end_if;
if not(TONR_1.DN) then
impact67_55144:O1.Data[0]:= 0;
impact67_55144:O1.Data[1]:= 0;
I wote the same program in ladder logic and that program works fine find attached the program here