Instances watching problem
Posted: 07 Aug 2018, 12:51
When I open this program from instances I can see values of variables.
But when I change one line (line no. 28) there are no values of variables.
Code: Select all
PROGRAM RevolutionPiCounterProgram
VAR
Path:string[80];
FD:dint := 0;
DidOpen:bool;
DoOpen:bool;
DoClose:bool;
flash:bool;
END_VAR
VAR CONSTANT
Linux_O_WRONLY : DINT := 1;
Linux_O_APPEND : DINT := 8;
Linux_O_CREAT : DINT := 512;
Linux_O_TRUNC : DINT := 1024;
END_VAR
VAR_EXTERNAL
RevPiStatus : BYTE; //
RevPiIOCycle : BYTE; //
RevPiLED : BYTE; //
END_VAR
Path := '/home/shares/public/test.csv';
if (DoOpen) then
DoOpen := false;
//FD := System_open(pathname:=Path,flags:=IOR(Linux_O_WRONLY,Linux_O_APPEND),ENO => DidOpen);
(*
if (not DidOpen) then
FD := System_open(pathname := Path, flags := IOR(Linux_O_WRONLY,Linux_O_CREAT,Linux_O_TRUNC), mode := 2#110100000, ENO=> DidOpen);
end_if;
*)
end_if;
if (DoClose) then
DoClose := false;
System_close(fd := FD);
end_if;
// flashing led A1 to see that program runs
flash := not flash;
if flash then
RevPiLED := 1; //green
//RevPiLED := 2; //red
else
RevPiLED := 0;
end_if;
END_PROGRAM
Code: Select all
PROGRAM RevolutionPiCounterProgram
VAR
Path:string[80];
FD:dint := 0;
DidOpen:bool;
DoOpen:bool;
DoClose:bool;
flash:bool;
END_VAR
VAR CONSTANT
Linux_O_WRONLY : DINT := 1;
Linux_O_APPEND : DINT := 8;
Linux_O_CREAT : DINT := 512;
Linux_O_TRUNC : DINT := 1024;
END_VAR
VAR_EXTERNAL
RevPiStatus : BYTE; //
RevPiIOCycle : BYTE; //
RevPiLED : BYTE; //
END_VAR
Path := '/home/shares/public/test.csv';
if (DoOpen) then
DoOpen := false;
FD := System_open(pathname:=Path,flags:=IOR(Linux_O_WRONLY,Linux_O_APPEND),ENO => DidOpen);
(*
if (not DidOpen) then
FD := System_open(pathname := Path, flags := IOR(Linux_O_WRONLY,Linux_O_CREAT,Linux_O_TRUNC), mode := 2#110100000, ENO=> DidOpen);
end_if;
*)
end_if;
if (DoClose) then
DoClose := false;
System_close(fd := FD);
end_if;
// flashing led A1 to see that program runs
flash := not flash;
if flash then
RevPiLED := 1; //green
//RevPiLED := 2; //red
else
RevPiLED := 0;
end_if;
END_PROGRAM