[r2]: / aunit-prj,aunit,aunit_rtu / CODESYS_Control_for_Linux_ARM_SL / Plc Logic / Application / PLC_PRG / svnobj  Maximize  Restore  History

Download this file

19 lines (18 with data), 4.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// This program shows how to read and write to Shared Memory.
PROGRAM PLC_PRG
VAR
	tt: Ton;
	hShMemRead: RTS_IEC_HANDLE;
	ResultRead: RTS_IEC_RESULT;
	deInstRead : DataExchange;
	ReadResult: RTS_IEC_RESULT;
	iRead: __UXINT;
	hShMemWrite: RTS_IEC_HANDLE;
	ResultWrite: RTS_IEC_RESULT;
	deInstWrite : output;
	WriteResult: RTS_IEC_RESULT;
	iWrite: __UXINT;
	ulSize: UDINT := SIZEOF(DataExchange);
END_VAR
tt(IN := TRUE,PT:=T#500MS);
IF tt.Q THEN