-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from ghalym/master
Changes and Fixes for TMO vac
- Loading branch information
Showing
7 changed files
with
234 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18"> | ||
<POU Name="FB_TBOOL_ADS" Id="{55de7e0e-296a-42bd-8da3-0dfe79b7395a}" SpecialFunc="None"> | ||
<Declaration><![CDATA[(* This function block is created for interface a boolean singal between different PLCs*) | ||
(* The variable values are read via ADS using the symbol name*) | ||
FUNCTION_BLOCK FB_TBOOL_ADS Extends FB_ADS | ||
VAR_INPUT | ||
sNetId : String; //NetID of the Destination PLC controller | ||
nPort : uint; // port number | ||
sVarName : string;// the variable name of the declared pip/pin function block. | ||
iWatchdog:UDINT;//The watchdog variable name written to by the remote plc | ||
END_VAR | ||
VAR_OUTPUT | ||
{attribute 'pytmc' := 'pv: value'} | ||
bBool : BOOL; | ||
{attribute 'pytmc' := 'pv: error'} | ||
bError: BOOL; | ||
END_VAR | ||
VAR | ||
fb_CheckWatchdog: FB_CheckWatchdog; | ||
fb_Read: FB_ReadAdsSymByName; | ||
ftReset: F_TRIG; | ||
xFirstPass: BOOL:= true; | ||
END_VAR | ||
]]></Declaration> | ||
<Implementation> | ||
<ST><![CDATA[ | ||
ftReset(CLK:= fb_Read.bBusy OR xFirstPass); | ||
xFirstPass := false; | ||
(*calling ADS read function*) | ||
fb_Read( | ||
bRead:=ftReset.Q , | ||
sNetId:= sNetId, | ||
nPort:= nPort, | ||
sVarName:= sVarName, | ||
nDestAddr:= ADR(bBool), | ||
nLen:= SIZEOF(bBool), | ||
tTimeout:= , | ||
eComMode:=eAdsComModeFastCom , | ||
bBusy=> , | ||
bError=> , | ||
nErrorId=> ); | ||
(*Error*) | ||
fb_CheckWatchdog( | ||
bEnable:= TRUE, | ||
tWatchdogTime:= T#900ms, | ||
nCnt:= iWatchdog , | ||
bWatchdog=> , | ||
nLastCnt=> ); | ||
bError:= fb_Read.bError OR fb_CheckWatchdog.bWatchdog; | ||
tErrorPresent(CLK:=bError); | ||
IF (fb_Read.bError OR fb_CheckWatchdog.bWatchdog) THEN | ||
bBool := FALSE; // If there is an error in connection the signal turns to FALSE | ||
END_IF; | ||
(*Logger*) | ||
ACT_Logger(); | ||
]]></ST> | ||
</Implementation> | ||
<Action Name="ACT_Logger" Id="{892f0adb-5f59-480d-b09f-897dbf477c82}"> | ||
<Implementation> | ||
<ST><![CDATA[IF tErrorPresent.Q THEN | ||
IF(fb_Read.bError) THEN fbLogger(sMsg:='ADS Read Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
IF(fb_CheckWatchdog.bWatchdog) THEN fbLogger(sMsg:='ADS Watchdog Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
END_IF | ||
]]></ST> | ||
</Implementation> | ||
</Action> | ||
</POU> | ||
</TcPlcObject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
L2SIVacuum/POUs/Functions/Gauges/Interfaces/FB_TGPI_ADS.TcPOU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18"> | ||
<POU Name="FB_TGPI_ADS" Id="{784926da-1c7e-4157-a217-23bd3a2c5d2d}" SpecialFunc="None"> | ||
<Declaration><![CDATA[(* This function block is created for interface devices between different PLC*) | ||
(* Not all the Variables in the original structure is required, just few signals *) | ||
(* The variable values are read via ADS using the symbol name*) | ||
FUNCTION_BLOCK FB_TGPI_ADS Extends FB_ADS | ||
VAR_INPUT | ||
sNetId : String; //NetID of the Destination PLC controller | ||
nPort : uint; // port number | ||
sVarName : string;// the variable name of the declared gauge function block. | ||
iWatchdog:UDINT;//The watchdog variable name written to by the remote plc | ||
END_VAR | ||
VAR_OUTPUT | ||
{attribute 'pytmc' := 'pv:'} | ||
IG : ST_VG; | ||
bError: BOOL; | ||
END_VAR | ||
VAR | ||
fb_CheckWatchdog: FB_CheckWatchdog; | ||
fb_Read_VG: FB_ReadAdsSymByName; | ||
ftReset: F_TRIG; | ||
xFirstPass: BOOL:= true; | ||
END_VAR | ||
]]></Declaration> | ||
<Implementation> | ||
<ST><![CDATA[ | ||
ftReset(CLK:= fb_Read_VG.bBusy OR xFirstPass); | ||
xFirstPass := false; | ||
(*calling ADS read function*) | ||
//IG.xPRESS_OK := false; | ||
fb_Read_VG( | ||
bRead:=ftReset.Q , | ||
sNetId:= sNetId, | ||
nPort:= nPort, | ||
sVarName:= CONCAT(sVarName,'.PG'), | ||
nDestAddr:= ADR(IG), | ||
nLen:= SIZEOF(IG), | ||
tTimeout:= , | ||
eComMode:=eAdsComModeFastCom , | ||
bBusy=> , | ||
bError=> , | ||
nErrorId=> ); | ||
(*Error*) | ||
fb_CheckWatchdog( | ||
bEnable:= TRUE, | ||
tWatchdogTime:= T#900ms, | ||
nCnt:= iWatchdog , | ||
bWatchdog=> , | ||
nLastCnt=> ); | ||
bError:= fb_Read_VG.bError OR fb_CheckWatchdog.bWatchdog; | ||
tErrorPresent(CLK:=bError); | ||
IF (fb_Read_VG.bError OR fb_CheckWatchdog.bWatchdog) THEN | ||
IG.xPRESS_OK := FALSE; | ||
END_IF; | ||
(*Logger*) | ||
ACT_Logger();]]></ST> | ||
</Implementation> | ||
<Action Name="ACT_Logger" Id="{7bcc19d2-8a8c-4c0c-850c-ad26eee2984d}"> | ||
<Implementation> | ||
<ST><![CDATA[IF tErrorPresent.Q THEN | ||
IF(fb_Read_VG.bError) THEN fbLogger(sMsg:='ADS Read Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
IF(fb_CheckWatchdog.bWatchdog) THEN fbLogger(sMsg:='ADS Watchdog Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
END_IF | ||
]]></ST> | ||
</Implementation> | ||
</Action> | ||
</POU> | ||
</TcPlcObject> |
65 changes: 65 additions & 0 deletions
65
L2SIVacuum/POUs/Functions/Valves/Interfaces/FB_TVGC_2S_ADS.TcPOU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18"> | ||
<POU Name="FB_TVGC_2S_ADS" Id="{2d33fb71-254e-4ee8-8b31-f9715402f769}" SpecialFunc="None"> | ||
<Declaration><![CDATA[(* This function block is created for interface devices between different PLC*) | ||
(* Not all the fields in the original structure is required, just few signals *) | ||
(*Use with FB_ADS_WATCHDOG on remotePLC*) | ||
FUNCTION_BLOCK FB_TVGC_2S_ADS extends FB_ADS | ||
VAR_INPUT | ||
sNetId : String; //NetID of the Destination PLC controller | ||
nPort : UINT; // port number | ||
sVarName : string;// the variable name of the (device) declared function block. | ||
iWatchdog:UDINT;//The watchdog variable name written to by the remote plc | ||
END_VAR | ||
VAR_OUTPUT | ||
{attribute 'pytmc' := 'pv: '} | ||
VGC:ST_VGC_2S; | ||
bError:BOOL; | ||
END_VAR | ||
VAR | ||
fb_CheckWatchdog: FB_CheckWatchdog; | ||
fb_Read_VGC: FB_ReadAdsSymByName; | ||
ftReset: F_TRIG; | ||
xFirstPass: bool:= true; | ||
END_VAR | ||
]]></Declaration> | ||
<Implementation> | ||
<ST><![CDATA[ftReset(CLK:= fb_Read_VGC.bBusy OR xFirstPass); | ||
xFirstPass:=false; | ||
(*calling ADS read function*) | ||
fb_Read_VGC( | ||
bRead:= ftReset.Q, | ||
sNetId:= sNetId, | ||
nPort:= nPort, | ||
sVarName:= CONCAT(sVarName,'.iq_stValve'), | ||
nDestAddr:= ADR(VGC), | ||
nLen:= SIZEOF(VGC), | ||
tTimeout:= , | ||
eComMode:= eAdsComModeFastCom, | ||
bBusy=> , | ||
bError=> , | ||
nErrorId=> ); | ||
(*Error*) | ||
fb_CheckWatchdog( | ||
bEnable:= TRUE, | ||
tWatchdogTime:= T#900ms, | ||
nCnt:= iWatchdog , | ||
bWatchdog=> , | ||
nLastCnt=> ); | ||
bError:= fb_Read_VGC.bError OR fb_CheckWatchdog.bWatchdog; | ||
ACT_Logger();]]></ST> | ||
</Implementation> | ||
<Action Name="ACT_Logger" Id="{4dcca01b-a24b-4b1b-865e-ad4d9c835d32}"> | ||
<Implementation> | ||
<ST><![CDATA[IF tErrorPresent.Q THEN | ||
IF(fb_Read_VGC.bError) THEN fbLogger(sMsg:='ADS Read Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
IF(fb_CheckWatchdog.bWatchdog) THEN fbLogger(sMsg:='ADS Watchdog Error', eSevr:=TcEventSeverity.Critical); END_IF; | ||
END_IF | ||
]]></ST> | ||
</Implementation> | ||
</Action> | ||
</POU> | ||
</TcPlcObject> |