Kuhnke Electronics Instruction Manual
Kuhnke Electronics Instruction Manual Kuhnke Electronics Instruction Manual
Remanent Data PROGRAM operating time � Operating hour counter: This program compiles a count of the operating time using elements from SystemData. xrdata.SysVars.secs := xrdata.SysVars.secs +1 ; IF xrdata.SysVars.secs >= 60 THEN END_IF xrdata.SysVars.secs := 0; xrdata.SysVars.mins := xrdata.SysVars.mins +1 ; IF xrdata.SysVars.mins >= 60 THEN END_IF xrdata.SysVars.mins := 0; xrdata.SysVars.hors := xrdata.SysVars.hors + 1 ; IF xrdata.SysVars.hors >= 24 THEN END_IF PROGRAM PLC_PRG VAR END_VAR VAR RETAIN END_VAR xrdata.SysVars.hors := 0; xrdata.SysVars.days := xrdata.SysVars.days + 1 ; PLC_PRG Checks if the extraremanent data are OK. Run "Clear" to remove the data if they are not OK. noof_SystemStarts counts the number of system starts. Rema1 is a Retain variable. Use it to check the difference to the extraremanent data. flag: BOOL := TRUE ; running: UDINT; Start_OK: BOOL; Clear: BOOL; Rema1: UDINT; 122 E 700 GB
Start_OK := CheckXREMDATA(Clear); IF flag AND Start_OK THEN END_IF xrdata.SysVars.noof_SystemStarts := Rema1:=Rema1+1; flag := FALSE; IF Start_OK THEN (* The actual main program goes here. *) END_IF running:=running +1; FUNCTION CheckXREMDATA : BOOL VAR_INPUT END_VAR VAR END_VAR flag1:BOOL; Remanent Data xrdata.SysVars.noof_SystemStarts+1; CheckXREMDATA: Use the "magic words" to check if the remanent data are OK. If the contents of the "magic words" changed they are overwritten with the defined bit pattern. Depending on the value of the "clear" input variable, the extraremanent structures can be removed. pSysVars: POINTER TO DWORD; pExtrarema02: POINTER TO DWORD; Size_SysVars: UINT; Size_Extrarema02: UINT; i: INT; pByte: POINTER TO ARRAY[0..4095] OF BYTE; 123
- Page 71 and 72: 4.4.1 Installing a Thread Function
- Page 73 and 74: Thread usage Function Libraries A t
- Page 75 and 76: 4.4.2 Installing / Uninstalling a T
- Page 77 and 78: To uninstall a timer task: Function
- Page 79 and 80: 4.4.3 Enabling / Disabling the Outp
- Page 81 and 82: 4.4.5 Direct Write of Local Outputs
- Page 83 and 84: FUNCTION INSTALL_ERROR_IRQ : BOOL V
- Page 85 and 86: Function Libraries INSTALL_INPUT_IR
- Page 87 and 88: 4.4.8 Installing a REF IRQ Module F
- Page 89 and 90: 4.4.10 Setting up the Watchdog Func
- Page 91 and 92: 4.5 Library MMC.LIB Function Librar
- Page 93 and 94: 4.5.2 Registering with the File Sys
- Page 95 and 96: 4.5.4 Copying Files Function Librar
- Page 97 and 98: 4.5.6 Determining the Free MMC Spac
- Page 99 and 100: 4.5.8 Moving a File Function Librar
- Page 101 and 102: 4.5.9 Opening a File Function Libra
- Page 103 and 104: 4.5.10 Reading from a File Function
- Page 105 and 106: 4.5.12 Setting the Edit Bookmark of
- Page 107 and 108: 4.5.14 Initialising the File System
- Page 109 and 110: Function Libraries FUNCTION_BLOCK M
- Page 111 and 112: � Use 'start' to repeatedly run t
- Page 113 and 114: 4.6.4 Online Reset (cold) 4.6.5 Res
- Page 115 and 116: 4.7.2 Variables with Set Addresses
- Page 117 and 118: 4.8 Extraremanent Data 4.8.1 Remane
- Page 119 and 120: Remanent Data If an extraremanent m
- Page 121: TYPE Extrarema_02: STRUCT END_STRUC
- Page 125 and 126: 5 Software Software Read this secti
- Page 127 and 128: Internal combi I/Os %IX0.0-%IX0.3 a
- Page 129 and 130: Internal I/Os AI_x and AO_x I/O Var
- Page 131 and 132: Software If an "Input IRQ module" h
- Page 133 and 134: 5.3.3 Functions of Internal Outputs
- Page 135 and 136: Software Value Frequency Value Freq
- Page 137 and 138: 5.3.4 Short-circuited Output Softwa
- Page 139 and 140: 5.3.5 Internal Analogue Input Funct
- Page 141 and 142: 5.3.6 Internal Analogue Output Func
- Page 143 and 144: 5.3.7 Functions of Internal Counter
- Page 145 and 146: 5.3.7.1.2 Event Counter Variables V
- Page 147 and 148: Resolution of the rotary encoder: s
- Page 149 and 150: Software 5.4 Functions of the Basic
- Page 151 and 152: 5.7 Status Messages of Expansion Mo
- Page 153 and 154: 6 PROFIBUS-DP 6.1 Basic Information
- Page 155 and 156: 6.2 Master-Slave Communication PROF
- Page 157 and 158: 6.2.2 Receive Parameter Data (Prm_D
- Page 159 and 160: 6.2.2.2 Device-specific Bus Paramet
- Page 161 and 162: PROFIBUS replaces the term "byte" w
- Page 163 and 164: Octet 4: Diag.Master_Add PROFIBUS A
- Page 165 and 166: 6.2.4 Master-Slave Data Communicati
- Page 167 and 168: Example: VAR bIn_0: BYTE; bOut_0: B
- Page 169 and 170: 7 CANopen CANopen At this point, we
- Page 171 and 172: 7.1.1 CANopen Example CANopen A Ven
Start_OK := CheckXREMDATA(Clear);<br />
IF flag AND Start_OK THEN<br />
END_IF<br />
xrdata.SysVars.noof_SystemStarts :=<br />
Rema1:=Rema1+1;<br />
flag := FALSE;<br />
IF Start_OK THEN<br />
(* The actual main program goes here. *)<br />
END_IF<br />
running:=running +1;<br />
FUNCTION CheckXREMDATA : BOOL<br />
VAR_INPUT<br />
END_VAR<br />
VAR<br />
END_VAR<br />
flag1:BOOL;<br />
Remanent Data<br />
xrdata.SysVars.noof_SystemStarts+1;<br />
CheckXREMDATA:<br />
Use the "magic words" to check if the remanent data are<br />
OK. If the contents of the "magic words" changed they are<br />
overwritten with the defined bit pattern. Depending on the<br />
value of the "clear" input variable, the extraremanent<br />
structures can be removed.<br />
pSysVars: POINTER TO DWORD;<br />
pExtrarema02: POINTER TO DWORD;<br />
Size_SysVars: UINT;<br />
Size_Extrarema02: UINT;<br />
i: INT;<br />
pByte: POINTER TO ARRAY[0..4095] OF BYTE;<br />
123