Instances watching problem

Für Themen rund um logi.RTS und logi.CAD 3
Post Reply
janbob
Posts: 3
Joined: 31 Jul 2018, 12:12
Answers: 0

Instances watching problem

Post by janbob »

When I open this program from instances I can see 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
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
User avatar
dirk
KUNBUS
Posts: 1924
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: Instances watching problem

Post by dirk »

As the question seems to depend on ST with logi.CAD3 I have moved it to the logi.cals forum.
User avatar
Walter
Official 3rd Party Support logi.cals
Posts: 77
Joined: 15 Dec 2016, 12:56
Answers: 0

Re: Instances watching problem

Post by Walter »

Hello,

it seems to be that there was a problem in your logi.CAD 3 version. In newer versions of logi.CAD 3 this issue does not appear

kind regards
Walter
Post Reply