diff --git a/L2SIVacuum/DUTs/Pumps/ST_PTM.TcDUT b/L2SIVacuum/DUTs/Pumps/ST_PTM.TcDUT index 50d30f8..e51a93c 100644 --- a/L2SIVacuum/DUTs/Pumps/ST_PTM.TcDUT +++ b/L2SIVacuum/DUTs/Pumps/ST_PTM.TcDUT @@ -31,7 +31,7 @@ NOTE: This is an archetype, use an extension of this structure for a specific pu (* Readbacks *) {attribute 'pytmc' := ' - pv: ILK_STATUS; + pv: ILK_OK; field: ZNAM ILK ACTIVE; field: ONAM ILK OK; io: i; diff --git a/L2SIVacuum/DUTs/Valves/ST_VCN.TcDUT b/L2SIVacuum/DUTs/Valves/ST_VCN.TcDUT index 2e8e8ae..807bcc1 100644 --- a/L2SIVacuum/DUTs/Valves/ST_VCN.TcDUT +++ b/L2SIVacuum/DUTs/Valves/ST_VCN.TcDUT @@ -21,7 +21,7 @@ STRUCT // Outputs {attribute 'pytmc' := ' - pv: POS_AO; + pv: POS_AO_R; io: i ; '} q_iRawPosition : INT; //Position control diff --git a/L2SIVacuum/DUTs/Valves/ST_VGC.TcDUT b/L2SIVacuum/DUTs/Valves/ST_VGC.TcDUT index c5b158d..e2df55d 100644 --- a/L2SIVacuum/DUTs/Valves/ST_VGC.TcDUT +++ b/L2SIVacuum/DUTs/Valves/ST_VGC.TcDUT @@ -95,8 +95,8 @@ STRUCT field: PREC 2 field: EGU "TORR" '} - rAT_VAC_SP : REAL := 0.01; // Interlock setpoint for gauges on both sides of valve - rAT_VAC_SP_LAST : REAL :=0.01 ; // Interlock setpoint for gauges on both sides of valve + rAT_VAC_SP : REAL := 0.000001; // Interlock setpoint for gauges on both sides of valve + rAT_VAC_SP_LAST : REAL :=0.000001 ; // Interlock setpoint for gauges on both sides of valve {attribute 'pytmc' := ' pv: AT_VAC_HYS; io: o; @@ -105,7 +105,7 @@ STRUCT field: PREC 2 field: EGU "TORR" '} - rAT_VAC_HYS : REAL :=0.01; // Hysteresis of the vacuum sp + rAT_VAC_HYS : REAL :=0.000001; // Hysteresis of the vacuum sp {attribute 'pytmc' := ' pv: HYST_PERC ; io: o; diff --git a/L2SIVacuum/DUTs/Valves/ST_VRC.TcDUT b/L2SIVacuum/DUTs/Valves/ST_VRC.TcDUT index 0dc3cfc..af6b305 100644 --- a/L2SIVacuum/DUTs/Valves/ST_VRC.TcDUT +++ b/L2SIVacuum/DUTs/Valves/ST_VRC.TcDUT @@ -1,5 +1,5 @@  - + diff --git a/L2SIVacuum/L2SIVacuum.plcproj b/L2SIVacuum/L2SIVacuum.plcproj index bc985a6..70c2d03 100644 --- a/L2SIVacuum/L2SIVacuum.plcproj +++ b/L2SIVacuum/L2SIVacuum.plcproj @@ -16,7 +16,7 @@ false SLAC false - L2SI Vacuum Library + lcls-twincat-vacuum 0.0.0 @@ -197,6 +197,9 @@ Code + + Code + Code @@ -212,6 +215,9 @@ Code + + Code + Code @@ -221,6 +227,9 @@ Code + + Code + Code true @@ -270,6 +279,9 @@ Code + + Code + Code @@ -308,6 +320,7 @@ + diff --git a/L2SIVacuum/L2SIVacuum.tmc b/L2SIVacuum/L2SIVacuum.tmc index 41228e0..cc78691 100644 --- a/L2SIVacuum/L2SIVacuum.tmc +++ b/L2SIVacuum/L2SIVacuum.tmc @@ -1,4 +1,4 @@ -AMSNETID48BYTE06%d.%d.%d.%d.%d.%d[0][1][2][3][4][5]ST_System88xSwAlmRstBOOL80xAtVacuumBOOL88xFirstScanBOOL816xOverrideModeBOOL824xIOStateBOOL832I_EcatMaster1AMSNETID4840namingomitTcAddressTypeInputT_MaxString2048STRING(255)TcEventSeverity16INT01234plcAttribute_qualified_onlyplcAttribute_strictE_Subsystem16WORDNILVALUE0VACUUM1MPS2MOTION3FIELDBUS4SDS5I_ArgumentsChangeListener64PVOIDOnArgumentsChangedITcAsyncResult32ITcUnknownGetIsBusyHRESULT32bIsBusyBOOL3232GetHasErrorHRESULT32bErrorBOOL3232GetErrorCodeHRESULT32hresultHRESULT32FB_AsyncStrResult128bBusyBOOL8564352bErrorBOOL8564416hrErrorCodeHRESULT32564432nStringSizeUDINT32564400sResultSTRING(255)2048564424__getbBusyBOOL8bBusyBOOL8b32IsBusyBOOL3232propertymonitoringcallInitipResultITcAsyncStringResult64conditionalshowGetStringBOOL8sResultSTRING(80)64nResultUDINT32__getnStringSizeUDINT32nStringSizeUDINT32propertymonitoringcall__getbErrorBOOL8bErrorBOOL8b32HasErrorBOOL3232propertymonitoringcall__getsResultSTRING(255)2048sResultSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__gethrErrorCodeHRESULT32hrErrorCodeHRESULT32hrErrorHRESULT32propertymonitoringcallPouTypeFunctionBlockenable_dynamic_creationconditionalshow_all_localsno_explicit_calldo not call this POU directlyno_assignTcSourceInfoType32UDINT0124plcAttribute_qualified_onlyplcAttribute_strictTcSerializedSourceInfoType96eTypeTcSourceInfoType320obDataUDINT3232cbDataUDINT3264ITcSourceInfo32ITcUnknownGetNumTypesHRESULT32nCountUDINT32GetTypesHRESULT32ppSourceInfoTypesTcSerializedSourceInfoType32GetDataSizeHRESULT32cbDataUDINT32GetDataHRESULT32ppDataPVOID32ITcEvent32ITcUnknownGetEventClassHRESULT32eventClassGUID32GetEventIdHRESULT32eventIdUDINT32GetSeverityHRESULT32severityTcEventSeverity32GetSourceInfoHRESULT32pipSourceInfoITcSourceInfo32GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)32nJsonAttributeUDINT32GetTextHRESULT32nLangIdDINT32pipResultITcAsyncStringResult32GetEventClassNameHRESULT32nLangIdDINT32pipResultITcAsyncStringResult32I_TcSourceInfo64PVOID__getguidGUID128property__getipDataITcSourceInfo64propertyconditionalshow__getnIdUDINT32propertymonitoringcall__getsNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8EqualsToBOOL8ipOtherI_TcSourceInfo64TcEventEntry192uuidEventClassGUID1280nEventIdUDINT32128eSeverityTcEventSeverity16160I_TcEventBase64PVOID__geteSeverityTcEventSeverity16propertymonitoringcall__getEventClassGUID128property__getipSourceInfoI_TcSourceInfo64propertymonitoringcall__getnEventIdUDINT32propertymonitoringcall__getsEventClassNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getsEventTextSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getstEventEntryTcEventEntry192propertyEqualsToBOOL8ipOtherI_TcEventBase64EqualsToEventClassBOOL8OtherEventClassGUID128EqualsToEventEntryBOOL8OtherEventClassGUID128nOtherEventIDUDINT32eOtherSeverityTcEventSeverity16EqualsToEventEntryExBOOL8stOtherTcEventEntry192GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64nJsonAttributeUDINT32RequestEventClassNameBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputRequestEventTextBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputIQueryInterface64PVOID__GetInterfacePointerBOOL8pRefDWORD64__GetInterfaceReferenceBOOL8nInterfaceIdDINT32pRefDWORD64TcEventArgumentType16INT012345678910111213141516171819plcAttribute_qualified_onlyplcAttribute_strictITcArguments32ITcUnknownCountHRESULT32nCountUDINT32AddArgumentHRESULT32eTypeTcEventArgumentType16pDataPVOID32cbDataUDINT32GetHRESULT32nIndexUDINT32eTypeTcEventArgumentType32ppDataPVOID32ClearHRESULT32GetArgumentTypesHRESULT32pArgumentTypesTcEventArgumentType32GetDataSizeHRESULT32cbDataUDINT32GetDataHRESULT32pDataBYTE32I_TcArguments64IQueryInterface__getipDataITcArguments64propertyconditionalshowAddBlobI_TcArguments64pDataPVOID64cbDataUINT16AddBoolI_TcArguments64valueBOOL8AddByteI_TcArguments64valueBYTE8AddDIntI_TcArguments64valueDINT32AddDWordI_TcArguments64valueDWORD32AddEventReferenceIdI_TcArguments64nEventIdUDINT32AddEventReferenceIdGuidI_TcArguments64nEventIdUDINT32EventClassGUID128AddIntI_TcArguments64valueINT16AddLIntI_TcArguments64valueLINT64AddLRealI_TcArguments64valueLREAL64AddRealI_TcArguments64valueREAL32AddSIntI_TcArguments64valueSINT8AddStringI_TcArguments64valueSTRING(80)64ItemTypeInOutAddUDIntI_TcArguments64valueUDINT32AddUIntI_TcArguments64valueUINT16AddULIntI_TcArguments64valueULINT64AddUSIntI_TcArguments64valueUSINT8AddWordI_TcArguments64valueWORD16AddWStringI_TcArguments64valueWSTRING(80)64ItemTypeInOutClearI_TcArguments64FB_TcSourceInfo2944I_TcSourceInfonIdUDINT32564240564288sNameSTRING(255)2048564312564336__setbCutInstancePathByLastInstbCutInstancePathByLastInstBOOL8propertyClearExtendNameBOOL8sExtensionSTRING(255)2048__getipDataITcSourceInfo64ipDataITcSourceInfo64propertyconditionalshow__getnIdUDINT32nIdUDINT32propertymonitoringcallResetToDefault_sInstancePathSTRING(255)2048__getguidGUID128guidGUID128property__setnIdnIdUDINT32monitoringcallpropertymonitoringcall__setguidguidGUID128propertyEqualsToBOOL8ipOtherI_TcSourceInfo64__getsNameSTRING(255)2048sNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__setsNamesNameSTRING(255)2048monitoringcallTcEncodingUTF-8propertymonitoringcallTcEncodingUTF-8PouTypeFunctionBlockno_explicit_calldo not call this POU directlyFB_TcEventBase4096I_ArgumentsChangeListenerfbSourceInfoFB_TcSourceInfo2944512.bCutInstancePathByLastInst1conditionalshow__REQUESTEVENTCLASSNAME__FBRESULTFB_AsyncStrResult1283712conditionalshow__REQUESTEVENTCLASSNAME__BBUSYBOOL83840conditionalshow__REQUESTEVENTTEXT__FBRESULTFB_AsyncStrResult1283904conditionalshow__REQUESTEVENTTEXT__BBUSYBOOL84032conditionalshoweSeverityTcEventSeverity16564528ipSourceInfoI_TcSourceInfo64564488nEventIdUDINT32564656sEventClassNameSTRING(255)2048564576sEventTextSTRING(255)2048564664EqualsToEventClassBOOL8OtherEventClassGUID128_EventClassGUID128GetEventClassNameHRESULT32nLangIdDINT32fbResultFB_AsyncStrResult64ItemTypeInOutipTmpEventITcEvent64ipResultITcAsyncStringResult64hrHRESULT32ReleaseHRESULT32OnArgumentsChanged__getipSourceInfoI_TcSourceInfo64ipSourceInfoI_TcSourceInfo64propertymonitoringcallEqualsToBOOL8ipOtherI_TcEventBase64__getipEventITcEvent64ipEventITcEvent64property__getEventClassGUID128EventClassGUID128ipTmpEventITcEvent64property__geteSeverityTcEventSeverity16eSeverityTcEventSeverity16ipTmpEventITcEvent64propertymonitoringcall__getstEventEntryTcEventEntry192stEventEntryTcEventEntry192propertyOnCreateHRESULT32EqualsToEventEntryBOOL8OtherEventClassGUID128nOtherEventIDUDINT32eOtherSeverityTcEventSeverity16RequestEventTextBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputfbResultFB_AsyncStrResult128uselocation__REQUESTEVENTTEXT__FBRESULTbBusyBOOL8uselocation__REQUESTEVENTTEXT__BBUSY__getsEventClassNameSTRING(255)2048sEventClassNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getipArgumentsI_TcArguments64ipArgumentsI_TcArguments64propertyGetEventTextHRESULT32nLangIdDINT32fbResultFB_AsyncStrResult64ItemTypeInOutipTmpEventITcEvent64ipResultITcAsyncStringResult64hrHRESULT32GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64nJsonAttributeUDINT32ipTmpEventITcEvent64RequestEventClassNameBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputfbResultFB_AsyncStrResult128uselocation__REQUESTEVENTCLASSNAME__FBRESULTbBusyBOOL8uselocation__REQUESTEVENTCLASSNAME__BBUSYEqualsToEventEntryExBOOL8stOtherTcEventEntry192__getnEventIdUDINT32nEventIdUDINT32ipTmpEventITcEvent64propertymonitoringcall__getsEventTextSTRING(255)2048sEventTextSTRING(255)2048propertymonitoringcallTcEncodingUTF-8PouTypeFunctionBlockconditionalshow_all_localsno_explicit_calldo not call this POU directlyno_assignI_TcMessage64I_TcEventBaseSendHRESULT32nTimeStampULINT64ITcMessage32ITcEventSetJsonAttributeHRESULT32sJsonAttributePCCH32GetArgumentsHRESULT32pipArgumentsITcArguments32SendHRESULT32timeStampULINT64ITcMessage232ITcMessageGetTimeSentHRESULT32timeStampULINT32FB_TcMessage4224FB_TcEventBaseI_TcMessagenTimeSentULINT64564712SetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64ItemTypeInOutCreateExHRESULT32stEventEntryTcEventEntry192ipSourceInfoI_TcSourceInfo64InitipMessageITcMessage64ipArgumentsITcArguments64ipSourceInfoITcSourceInfo64conditionalshow__getnTimeSentULINT64nTimeSentULINT64ipMessage2ITcMessage264nTimeStampULINT64propertymonitoringcallTcDisplayTypeGUID18071995-0000-0000-0000-000000000046CreateHRESULT32eventClassGUID128nEventIdUDINT32eSeverityTcEventSeverity16ipSourceInfoI_TcSourceInfo64hrHRESULT32ipArgumentsITcArguments64__getipEventITcEvent64ipEventITcEvent64propertySendHRESULT32nTimeStampULINT64TcEncodingFILETIMEReleaseHRESULT32PouTypeFunctionBlockreflectionconditionalshow_all_localsno_explicit_calldo not call this POU directlyFB_LogMessage31232sMsgT_MaxString204864ItemTypeInputeSevrTcEventSeverity1621120ItemTypeInputeSubsystemE_Subsystem162128ItemTypeInputsJsonT_MaxString20482144{}ItemTypeInputbInitializedBOOL841920bInitFailedBOOL842000sSubsystemSourceSTRING(80)6484208fbMessageFB_TcMessage644864fbMessagesFB_TcMessage05211204928fbSourceFB_TcSourceInfo294426048ipResultMessageI_TcMessage6428992hrHRESULT3229056hrLastInternalErrorHRESULT3229088eTraceLevelTcEventSeverity16291200sPathT_MaxString204829136instance-pathnoinitPouTypeFunctionBlockreflectionST_LibVersion288iMajorUINT160iMinorUINT1616iBuildUINT1632iRevisionUINT1648nFlagsDWORD3264sVersionSTRING(23)19296E_WATCHDOG_TIME_CONFIG16INTeWATCHDOG_TIME_DISABLED0eWATCHDOG_TIME_SECONDS1eWATCHDOG_TIME_MINUTES2E_HashPrefixTypes16INTHASHPREFIX_IEC0HASHPREFIX_STDC1E_SBCSType16INTeSBCS_WesternEuropean1eSBCS_CentralEuropean2T_AmsNetID192STRING(23)E_RouteTransportType16UINTeRouteTransport_None0eRouteTransport_TCP_IP1eRouteTransport_IIO_LIGHTBUS2eRouteTransport_PROFIBUS_DP3eRouteTransport_PCI_ISA_BUS4eRouteTransport_ADS_UDP5eRouteTransport_FATP_UDP6eRouteTransport_COM_PORT7eRouteTransport_USB8eRouteTransport_CAN_OPEN9eRouteTransport_DEVICE_NET10eRouteTransport_SSB11eRouteTransport_SOAP12ST_AmsRouteEntry1184sNameSTRING(31)2560sNetIDT_AmsNetID192256sAddressSTRING(79)640448eTransportE_RouteTransportType161088tTimeoutTIME321120dwFlagsDWORD321152E_ArgType16INTARGTYPE_UNKNOWN0ARGTYPE_BYTE1ARGTYPE_WORD2ARGTYPE_DWORD3ARGTYPE_REAL4ARGTYPE_LREAL5ARGTYPE_SINT6ARGTYPE_INT7ARGTYPE_DINT8ARGTYPE_USINT9ARGTYPE_UINT10ARGTYPE_UDINT11ARGTYPE_STRING12ARGTYPE_BOOL13ARGTYPE_BIGTYPE14ARGTYPE_ULARGE15ARGTYPE_UHUGE16ARGTYPE_LARGE17ARGTYPE_HUGE18ARGTYPE_LWORD19T_Arg128eTypeE_ArgType1600cbLenUDINT cbLen = length of string + 1 (null delimiter). ]]>32320pDataPVOID64640T_ULARGE_INTEGER64dwLowPartDWORD320dwHighPartDWORD3232TIMESTRUCT128wYearWORD160wMonthWORD1616wDayOfWeekWORD1632wDayWORD1648wHourWORD1664wMinuteWORD1680wSecondWORD1696wMillisecondsWORD16112ST_TimeZoneInformation864biasDINTAMSNETID48BYTE06%d.%d.%d.%d.%d.%d[0][1][2][3][4][5]ST_System88xSwAlmRstBOOL80xAtVacuumBOOL88xFirstScanBOOL816xOverrideModeBOOL824xIOStateBOOL832I_EcatMaster1AMSNETID4840namingomitTcAddressTypeInputT_MaxString2048STRING(255)TcEventSeverity16INT01234plcAttribute_qualified_onlyplcAttribute_strictE_Subsystem16WORDNILVALUE0VACUUM1MPS2MOTION3FIELDBUS4SDS5I_ArgumentsChangeListener64PVOIDOnArgumentsChangedITcAsyncResult32ITcUnknownGetIsBusyHRESULT32bIsBusyBOOL3232GetHasErrorHRESULT32bErrorBOOL3232GetErrorCodeHRESULT32hresultHRESULT32FB_AsyncStrResult128bBusyBOOL8564128bErrorBOOL8564192hrErrorCodeHRESULT32564208nStringSizeUDINT32564176sResultSTRING(255)2048564200__getbBusyBOOL8bBusyBOOL8b32IsBusyBOOL3232propertymonitoringcallInitipResultITcAsyncStringResult64conditionalshowGetStringBOOL8sResultSTRING(80)64nResultUDINT32__getnStringSizeUDINT32nStringSizeUDINT32propertymonitoringcall__getbErrorBOOL8bErrorBOOL8b32HasErrorBOOL3232propertymonitoringcall__getsResultSTRING(255)2048sResultSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__gethrErrorCodeHRESULT32hrErrorCodeHRESULT32hrErrorHRESULT32propertymonitoringcallPouTypeFunctionBlockenable_dynamic_creationconditionalshow_all_localsno_explicit_calldo not call this POU directlyno_assignTcSourceInfoType32UDINT0124plcAttribute_qualified_onlyplcAttribute_strictTcSerializedSourceInfoType96eTypeTcSourceInfoType320obDataUDINT3232cbDataUDINT3264ITcSourceInfo32ITcUnknownGetNumTypesHRESULT32nCountUDINT32GetTypesHRESULT32ppSourceInfoTypesTcSerializedSourceInfoType32GetDataSizeHRESULT32cbDataUDINT32GetDataHRESULT32ppDataPVOID32ITcEvent32ITcUnknownGetEventClassHRESULT32eventClassGUID32GetEventIdHRESULT32eventIdUDINT32GetSeverityHRESULT32severityTcEventSeverity32GetSourceInfoHRESULT32pipSourceInfoITcSourceInfo32GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)32nJsonAttributeUDINT32GetTextHRESULT32nLangIdDINT32pipResultITcAsyncStringResult32GetEventClassNameHRESULT32nLangIdDINT32pipResultITcAsyncStringResult32I_TcSourceInfo64PVOID__getguidGUID128property__getipDataITcSourceInfo64propertyconditionalshow__getnIdUDINT32propertymonitoringcall__getsNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8EqualsToBOOL8ipOtherI_TcSourceInfo64TcEventEntry192uuidEventClassGUID1280nEventIdUDINT32128eSeverityTcEventSeverity16160I_TcEventBase64PVOID__geteSeverityTcEventSeverity16propertymonitoringcall__getEventClassGUID128property__getipSourceInfoI_TcSourceInfo64propertymonitoringcall__getnEventIdUDINT32propertymonitoringcall__getsEventClassNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getsEventTextSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getstEventEntryTcEventEntry192propertyEqualsToBOOL8ipOtherI_TcEventBase64EqualsToEventClassBOOL8OtherEventClassGUID128EqualsToEventEntryBOOL8OtherEventClassGUID128nOtherEventIDUDINT32eOtherSeverityTcEventSeverity16EqualsToEventEntryExBOOL8stOtherTcEventEntry192GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64nJsonAttributeUDINT32RequestEventClassNameBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputRequestEventTextBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputIQueryInterface64PVOID__GetInterfacePointerBOOL8pRefDWORD64__GetInterfaceReferenceBOOL8nInterfaceIdDINT32pRefDWORD64TcEventArgumentType16INT012345678910111213141516171819plcAttribute_qualified_onlyplcAttribute_strictITcArguments32ITcUnknownCountHRESULT32nCountUDINT32AddArgumentHRESULT32eTypeTcEventArgumentType16pDataPVOID32cbDataUDINT32GetHRESULT32nIndexUDINT32eTypeTcEventArgumentType32ppDataPVOID32ClearHRESULT32GetArgumentTypesHRESULT32pArgumentTypesTcEventArgumentType32GetDataSizeHRESULT32cbDataUDINT32GetDataHRESULT32pDataBYTE32I_TcArguments64IQueryInterface__getipDataITcArguments64propertyconditionalshowAddBlobI_TcArguments64pDataPVOID64cbDataUINT16AddBoolI_TcArguments64valueBOOL8AddByteI_TcArguments64valueBYTE8AddDIntI_TcArguments64valueDINT32AddDWordI_TcArguments64valueDWORD32AddEventReferenceIdI_TcArguments64nEventIdUDINT32AddEventReferenceIdGuidI_TcArguments64nEventIdUDINT32EventClassGUID128AddIntI_TcArguments64valueINT16AddLIntI_TcArguments64valueLINT64AddLRealI_TcArguments64valueLREAL64AddRealI_TcArguments64valueREAL32AddSIntI_TcArguments64valueSINT8AddStringI_TcArguments64valueSTRING(80)64ItemTypeInOutAddUDIntI_TcArguments64valueUDINT32AddUIntI_TcArguments64valueUINT16AddULIntI_TcArguments64valueULINT64AddUSIntI_TcArguments64valueUSINT8AddWordI_TcArguments64valueWORD16AddWStringI_TcArguments64valueWSTRING(80)64ItemTypeInOutClearI_TcArguments64FB_TcSourceInfo2944I_TcSourceInfonIdUDINT32564016564064sNameSTRING(255)2048564088564112__setbCutInstancePathByLastInstbCutInstancePathByLastInstBOOL8propertyClearExtendNameBOOL8sExtensionSTRING(255)2048__getipDataITcSourceInfo64ipDataITcSourceInfo64propertyconditionalshow__getnIdUDINT32nIdUDINT32propertymonitoringcallResetToDefault_sInstancePathSTRING(255)2048__getguidGUID128guidGUID128property__setnIdnIdUDINT32monitoringcallpropertymonitoringcall__setguidguidGUID128propertyEqualsToBOOL8ipOtherI_TcSourceInfo64__getsNameSTRING(255)2048sNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__setsNamesNameSTRING(255)2048monitoringcallTcEncodingUTF-8propertymonitoringcallTcEncodingUTF-8PouTypeFunctionBlockno_explicit_calldo not call this POU directlyFB_TcEventBase4096I_ArgumentsChangeListenerfbSourceInfoFB_TcSourceInfo2944512.bCutInstancePathByLastInst1conditionalshow__REQUESTEVENTCLASSNAME__FBRESULTFB_AsyncStrResult1283712conditionalshow__REQUESTEVENTCLASSNAME__BBUSYBOOL83840conditionalshow__REQUESTEVENTTEXT__FBRESULTFB_AsyncStrResult1283904conditionalshow__REQUESTEVENTTEXT__BBUSYBOOL84032conditionalshoweSeverityTcEventSeverity16564304ipSourceInfoI_TcSourceInfo64564264nEventIdUDINT32564432sEventClassNameSTRING(255)2048564352sEventTextSTRING(255)2048564440EqualsToEventClassBOOL8OtherEventClassGUID128_EventClassGUID128GetEventClassNameHRESULT32nLangIdDINT32fbResultFB_AsyncStrResult64ItemTypeInOutipTmpEventITcEvent64ipResultITcAsyncStringResult64hrHRESULT32ReleaseHRESULT32OnArgumentsChanged__getipSourceInfoI_TcSourceInfo64ipSourceInfoI_TcSourceInfo64propertymonitoringcallEqualsToBOOL8ipOtherI_TcEventBase64__getipEventITcEvent64ipEventITcEvent64property__getEventClassGUID128EventClassGUID128ipTmpEventITcEvent64property__geteSeverityTcEventSeverity16eSeverityTcEventSeverity16ipTmpEventITcEvent64propertymonitoringcall__getstEventEntryTcEventEntry192stEventEntryTcEventEntry192propertyOnCreateHRESULT32EqualsToEventEntryBOOL8OtherEventClassGUID128nOtherEventIDUDINT32eOtherSeverityTcEventSeverity16RequestEventTextBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputfbResultFB_AsyncStrResult128uselocation__REQUESTEVENTTEXT__FBRESULTbBusyBOOL8uselocation__REQUESTEVENTTEXT__BBUSY__getsEventClassNameSTRING(255)2048sEventClassNameSTRING(255)2048propertymonitoringcallTcEncodingUTF-8__getipArgumentsI_TcArguments64ipArgumentsI_TcArguments64propertyGetEventTextHRESULT32nLangIdDINT32fbResultFB_AsyncStrResult64ItemTypeInOutipTmpEventITcEvent64ipResultITcAsyncStringResult64hrHRESULT32GetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64nJsonAttributeUDINT32ipTmpEventITcEvent64RequestEventClassNameBOOL8nLangIdDINT32sResultSTRING(80)64nResultSizeUDINT32bErrorBOOL8ItemTypeOutputhrErrorCodeHRESULT32ItemTypeOutputfbResultFB_AsyncStrResult128uselocation__REQUESTEVENTCLASSNAME__FBRESULTbBusyBOOL8uselocation__REQUESTEVENTCLASSNAME__BBUSYEqualsToEventEntryExBOOL8stOtherTcEventEntry192__getnEventIdUDINT32nEventIdUDINT32ipTmpEventITcEvent64propertymonitoringcall__getsEventTextSTRING(255)2048sEventTextSTRING(255)2048propertymonitoringcallTcEncodingUTF-8PouTypeFunctionBlockconditionalshow_all_localsno_explicit_calldo not call this POU directlyno_assignI_TcMessage64I_TcEventBaseSendHRESULT32nTimeStampULINT64ITcMessage32ITcEventSetJsonAttributeHRESULT32sJsonAttributePCCH32GetArgumentsHRESULT32pipArgumentsITcArguments32SendHRESULT32timeStampULINT64ITcMessage232ITcMessageGetTimeSentHRESULT32timeStampULINT32FB_TcMessage4224FB_TcEventBaseI_TcMessagenTimeSentULINT64564488SetJsonAttributeHRESULT32sJsonAttributeSTRING(80)64ItemTypeInOutCreateExHRESULT32stEventEntryTcEventEntry192ipSourceInfoI_TcSourceInfo64InitipMessageITcMessage64ipArgumentsITcArguments64ipSourceInfoITcSourceInfo64conditionalshow__getnTimeSentULINT64nTimeSentULINT64ipMessage2ITcMessage264nTimeStampULINT64propertymonitoringcallTcDisplayTypeGUID18071995-0000-0000-0000-000000000046CreateHRESULT32eventClassGUID128nEventIdUDINT32eSeverityTcEventSeverity16ipSourceInfoI_TcSourceInfo64hrHRESULT32ipArgumentsITcArguments64__getipEventITcEvent64ipEventITcEvent64propertySendHRESULT32nTimeStampULINT64TcEncodingFILETIMEReleaseHRESULT32PouTypeFunctionBlockreflectionconditionalshow_all_localsno_explicit_calldo not call this POU directlyFB_LogMessage31232sMsgT_MaxString204864ItemTypeInputeSevrTcEventSeverity1621120ItemTypeInputeSubsystemE_Subsystem162128ItemTypeInputsJsonT_MaxString20482144{}ItemTypeInputbInitializedBOOL841920bInitFailedBOOL842000sSubsystemSourceSTRING(80)6484208fbMessageFB_TcMessage644864fbMessagesFB_TcMessage05211204928fbSourceFB_TcSourceInfo294426048ipResultMessageI_TcMessage6428992hrHRESULT3229056hrLastInternalErrorHRESULT3229088eTraceLevelTcEventSeverity16291200sPathT_MaxString204829136instance-pathnoinitPouTypeFunctionBlockreflectionST_LibVersion288iMajorUINT160iMinorUINT1616iBuildUINT1632iRevisionUINT1648nFlagsDWORD3264sVersionSTRING(23)19296E_WATCHDOG_TIME_CONFIG16INTeWATCHDOG_TIME_DISABLED0eWATCHDOG_TIME_SECONDS1eWATCHDOG_TIME_MINUTES2E_HashPrefixTypes16INTHASHPREFIX_IEC0HASHPREFIX_STDC1E_SBCSType16INTeSBCS_WesternEuropean1eSBCS_CentralEuropean2T_AmsNetID192STRING(23)E_RouteTransportType16UINTeRouteTransport_None0eRouteTransport_TCP_IP1eRouteTransport_IIO_LIGHTBUS2eRouteTransport_PROFIBUS_DP3eRouteTransport_PCI_ISA_BUS4eRouteTransport_ADS_UDP5eRouteTransport_FATP_UDP6eRouteTransport_COM_PORT7eRouteTransport_USB8eRouteTransport_CAN_OPEN9eRouteTransport_DEVICE_NET10eRouteTransport_SSB11eRouteTransport_SOAP12ST_AmsRouteEntry1184sNameSTRING(31)2560sNetIDT_AmsNetID192256sAddressSTRING(79)640448eTransportE_RouteTransportType161088tTimeoutTIME321120dwFlagsDWORD321152E_ArgType16INTARGTYPE_UNKNOWN0ARGTYPE_BYTE1ARGTYPE_WORD2ARGTYPE_DWORD3ARGTYPE_REAL4ARGTYPE_LREAL5ARGTYPE_SINT6ARGTYPE_INT7ARGTYPE_DINT8ARGTYPE_USINT9ARGTYPE_UINT10ARGTYPE_UDINT11ARGTYPE_STRING12ARGTYPE_BOOL13ARGTYPE_BIGTYPE14ARGTYPE_ULARGE15ARGTYPE_UHUGE16ARGTYPE_LARGE17ARGTYPE_HUGE18ARGTYPE_LWORD19T_Arg128eTypeE_ArgType1600cbLenUDINT cbLen = length of string + 1 (null delimiter). ]]>32320pDataPVOID64640T_ULARGE_INTEGER64dwLowPartDWORD320dwHighPartDWORD3232TIMESTRUCT128wYearWORD160wMonthWORD1616wDayOfWeekWORD1632wDayWORD1648wHourWORD1664wMinuteWORD1680wSecondWORD1696wMillisecondsWORD16112ST_TimeZoneInformation864biasDINT320standardNameSTRING(31)25632standardDateTIMESTRUCTrFULL_SCALEREAL323841000FW_GetCurTaskIndex96nIndexBYTE864ItemTypeOutputPouTypeFunctionBlockconditionalshowGETCURTASKINDEX256indexBYTE864ItemTypeOutputfbGetCurTaskIndexFW_GetCurTaskIndex96128conditionalshowPouTypeFunctionBlockconditionalshow_all_localsVERSION64uiMajorUINT160uiMinorUINT1616uiServicePackUINT1632uiPatchUINT1648PlcLicenseInfo1024LicenseIdGUID1280InstancesUDINT32128LicenseNameSTRING(95)768256PlcAppSystemInfo2048ObjIdOTCID320TaskCntUDINT3232OnlineChangeCntUDINT3264FlagsDWORD3296AdsPortUINT16128BootDataLoadedBOOL8144OldBootDataBOOL8152AppTimestampDT32160KeepOutputsOnBPBOOL8192ShutdownInProgressBOOL8200LicensesPendingBOOL8208BSODOccuredBOOL8216LoggedInBOOL8224TComSrvPtrITComObjectServer32256TcComInterfaceAppNameSTRING(63)512512ProjectNameSTRING(63)5121024PlcTaskSystemInfo1024ObjIdOTCID320CycleTimeUDINT3232PriorityUINT1664AdsPortUINT1680CycleCountUDINT3296DcTaskTimeLINT64128LastExecTimeUDINT32192FirstCycleBOOL8224CycleTimeExceededBOOL8232InCallAfterOutputUpdateBOOL8240RTViolationBOOL8248TaskNameSTRING(63)512512LCLSGeneralEventClassCriticalCriticalErrorErrorWarningWarningInfoInfoVerboseVerboseL2SIVacuum{08500001-0000-0000-F000-000000000064}{bca6ee0a-9ce1-4d3f-98ca-413abc0d94fd}TF6340 TC3 Serial-Communication{b27b051a-ca6a-42ea-833e-82cc92903d83}TC3 UMLLCLSGeneralEventClassApplicationNamePort_851ChangeDate2020-03-02T14:22:04GeneratedCodeSize221184GlobalDataSize57344 \ No newline at end of file + rFULL_SCALEREAL323841000FW_GetCurTaskIndex96nIndexBYTE864ItemTypeOutputPouTypeFunctionBlockconditionalshowGETCURTASKINDEX256indexBYTE864ItemTypeOutputfbGetCurTaskIndexFW_GetCurTaskIndex96128conditionalshowPouTypeFunctionBlockconditionalshow_all_localsVERSION64uiMajorUINT160uiMinorUINT1616uiServicePackUINT1632uiPatchUINT1648PlcLicenseInfo1024LicenseIdGUID1280InstancesUDINT32128LicenseNameSTRING(95)768256PlcAppSystemInfo2048ObjIdOTCID320TaskCntUDINT3232OnlineChangeCntUDINT3264FlagsDWORD3296AdsPortUINT16128BootDataLoadedBOOL8144OldBootDataBOOL8152AppTimestampDT32160KeepOutputsOnBPBOOL8192ShutdownInProgressBOOL8200LicensesPendingBOOL8208BSODOccuredBOOL8216LoggedInBOOL8224TComSrvPtrITComObjectServer32256TcComInterfaceAppNameSTRING(63)512512ProjectNameSTRING(63)5121024PlcTaskSystemInfo1024ObjIdOTCID320CycleTimeUDINT3232PriorityUINT1664AdsPortUINT1680CycleCountUDINT3296DcTaskTimeLINT64128LastExecTimeUDINT32192FirstCycleBOOL8224CycleTimeExceededBOOL8232InCallAfterOutputUpdateBOOL8240RTViolationBOOL8248TaskNameSTRING(63)512512LCLSGeneralEventClassCriticalCriticalErrorErrorWarningWarningInfoInfoVerboseVerboseL2SIVacuum{08500001-0000-0000-F000-000000000064}{bca6ee0a-9ce1-4d3f-98ca-413abc0d94fd}TF6340 TC3 Serial-Communication{b27b051a-ca6a-42ea-833e-82cc92903d83}TC3 UMLLCLSGeneralEventClassApplicationNamePort_851ChangeDate2020-03-16T12:59:32GeneratedCodeSize233472GlobalDataSize57344 \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_972.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_972.TcPOU index 12941f9..f0c5583 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_972.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_972.TcPOU @@ -8,7 +8,7 @@ VAR_OUTPUT {attribute 'pytmc' := ' pv: '} - VG : ST_VG; + PG : ST_VG; END_VAR VAR_IN_OUT @@ -24,15 +24,16 @@ END_VAR 1 THEN - VG.rPRESS := LREAL_TO_REAL(EXPT(10, 2*rV-11)); - VG.xPRESS_OK := TRUE; - VG.eState := Valid; //Press OK + PG.rPRESS := LREAL_TO_REAL(EXPT(10, 2*rV-11)); + PG.xPRESS_OK := TRUE; + PG.eState := Valid; //Press OK ELSE - VG.xPRESS_OK := FALSE; - VG.eState := OoR; + PG.xPRESS_OK := FALSE; + PG.eState := OoR; END_IF (* Soft IO Mapping*) @@ -40,7 +41,7 @@ ACT_IO();]]> - + @@ -54,7 +55,9 @@ END_VAR - + + + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_9XX.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_9XX.TcPOU index 073cb70..036e060 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_9XX.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_9XX.TcPOU @@ -35,7 +35,7 @@ END_VAR IF PG.rVAC_SP = 0 THEN PG.rVAC_SP := rVAC_SP; END_IF - +If (iTermBits=0) THEN iTermBits := 32767;END_IF rV := 10*INT_TO_REAL(PG.i_iPRESS_R)/iTermBits; IF rV >= 0.99 THEN diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_CMR362.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_CMR362.TcPOU index 7a830bf..e223745 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_CMR362.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_CMR362.TcPOU @@ -7,7 +7,7 @@ VAR_INPUT END_VAR VAR_OUTPUT {attribute 'pytmc' := 'pv:'} - VG : ST_VG; + PG : ST_VG; END_VAR VAR MinPressure: REAL := 7.5E-3; //Torr @@ -25,32 +25,32 @@ END_VAR ACT_IO(); (* Real-value calculation *) - - V := 10*INT_TO_REAL(VG.i_iPRESS_R)/iTermBits; +If (iTermBits=0) THEN iTermBits := 32767;END_IF +V := 10*INT_TO_REAL(PG.i_iPRESS_R)/iTermBits; IF V < 0.4 THEN - VG.eState := GaugeDisconnected; //Most likely not connected + PG.eState := GaugeDisconnected; //Most likely not connected ELSIF V >= 0.4 AND V <= 1.0 THEN - VG.rPRESS := MinPressure; - VG.eState := ValidLo; + PG.rPRESS := MinPressure; + PG.eState := ValidLo; ELSIF V > 1 AND V <= 9.8 THEN - VG.rPRESS := LREAL_TO_REAL((V-1)*0.125*FullScale); - VG.eState := Valid; + PG.rPRESS := LREAL_TO_REAL((V-1)*0.125*FullScale); + PG.eState := Valid; ELSE -VG.eState := OoR; //Larger voltage, probably out of range? +PG.eState := OoR; //Larger voltage, probably out of range? END_IF (* Pressure OK check *) -VG.xPRESS_OK := (VG.rPRESS >= MinPressure); +PG.xPRESS_OK := (PG.rPRESS >= MinPressure); (*Soft IO Mapping*) ACT_IO(); @@ -59,7 +59,7 @@ ACT_IO(); - + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_GCM.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_GCM.TcPOU index 5b5e5b0..779c8d5 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_GCM.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_GCM.TcPOU @@ -11,7 +11,7 @@ VAR_IN_OUT END_VAR VAR_OUTPUT {attribute 'pytmc' := 'pv:'} - VG : ST_VG; + PG : ST_VG; END_VAR VAR_INPUT i_rFULL_SCALE : REAL; @@ -32,17 +32,17 @@ A. Wallace The full-scale pressure times the ratio of the meas. voltage to full-scale voltage (10V). The minimum pressure is always going to be 5e-4 * F.S.V.*) -VG.rFULL_SCALE := i_rFULL_SCALE; -rMinPressure := VG.rFULL_SCALE * 5E-4; +PG.rFULL_SCALE := i_rFULL_SCALE; +rMinPressure := PG.rFULL_SCALE * 5E-4; +If (iTermBits=0) THEN iTermBits := 32767;END_IF +rV :=MAX((10*INT_TO_REAL(PG.i_iPRESS_R)/iTermBits),0); -rV :=MAX((10*INT_TO_REAL(VG.i_iPRESS_R)/iTermBits),0); - -VG.rPRESS := (VG.rFULL_SCALE/10)*rV; -IF VG.rPRESS > (rMinPressure)THEN - VG.xPRESS_OK := TRUE; +PG.rPRESS := (PG.rFULL_SCALE/10)*rV; +IF PG.rPRESS > (rMinPressure)THEN + PG.xPRESS_OK := TRUE; ELSE - VG.xPRESS_OK := FALSE; + PG.xPRESS_OK := FALSE; END_IF (*IO soft linking*) @@ -50,7 +50,7 @@ ACT_IO();]]> - + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_ITR90.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_ITR90.TcPOU index 268eb75..4a211f3 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_ITR90.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_ITR90.TcPOU @@ -1,5 +1,5 @@  - + - + @@ -85,6 +86,7 @@ END_VAR + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS275.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS275.TcPOU index 01b2e84..b302ea2 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS275.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS275.TcPOU @@ -41,7 +41,7 @@ IF PG.rVAC_SP = 0 THEN END_IF (* Real-value calculation *) - +If (iTermBits=0) THEN iTermBits := 32767;END_IF V := 10*INT_TO_REAL(PG.i_iPRESS_R)/iTermBits; Vlowest := MIN(V, Vlowest); diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS392.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS392.TcPOU index 67b96aa..8626d49 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS392.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS392.TcPOU @@ -1,5 +1,5 @@  - + - + + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS500.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS500.TcPOU index 664b994..0203160 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS500.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS500.TcPOU @@ -1,5 +1,5 @@  - + - + - + + diff --git a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS_937A.TcPOU b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS_937A.TcPOU index 61869dc..8154b12 100644 --- a/L2SIVacuum/POUs/Functions/Gauges/FB_MKS_937A.TcPOU +++ b/L2SIVacuum/POUs/Functions/Gauges/FB_MKS_937A.TcPOU @@ -1,5 +1,5 @@  - + ); bError:= fb_Read_VG.bError OR fb_CheckWatchdog.bWatchdog; -]]> +IG.xPRESS_OK := NOT(fb_Read_VG.bError AND fb_CheckWatchdog.bWatchdog);]]> - + + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraDryPump.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraDryPump.TcPOU index b3ae0ed..10d1c6c 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraDryPump.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraDryPump.TcPOU @@ -1,9 +1,9 @@  - + + + +//Mapping +ACT_IO(); +// Log States and triggers +ACT_Logger();]]> + + + stpump.eState THEN + CASE stpump.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := stpump.eState; + END_IF + + +// Log Action +tAction(CLK:= stPump.q_xRunDo); +IF tAction.Q THEN fbLogger(sMsg:='Pump commanded to start', eSevr:=TcEventSeverity.Info); END_IF + + +// Log FAULT +tFault(CLK:= NOT stPump.i_xAlarm); +IF tFault.Q THEN fbLogger(sMsg:='Pump Lost Alarm OK bit', eSevr:=TcEventSeverity.Critical); END_IF + +]]> + + @@ -113,14 +154,43 @@ stPump.i_xRemote:= i_xRemote;]]> + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraEVA.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraEVA.TcPOU index 69b5ae5..b339f11 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraEVA.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_EbaraEVA.TcPOU @@ -1,9 +1,9 @@  - + +ACT_IO(); + +// Log States and triggers +ACT_Logger();]]> @@ -61,6 +73,42 @@ q_xRunDo:=stPump.q_xRunDo; q_xRemote:= stPump.q_xRemote;]]> + + + stpump.eState THEN + CASE stpump.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := stpump.eState; + END_IF + + + +// Log Action +tAction(CLK:= stPump.q_xRunDo); +IF tAction.Q THEN fbLogger(sMsg:='Pump commanded to start', eSevr:=TcEventSeverity.Info); END_IF + + +// Log FAULT +tFault(CLK:= stPump.i_xAlarmOK); +IF tFault.Q THEN fbLogger(sMsg:='Pump Lost Alarm OK bit', eSevr:=TcEventSeverity.Critical); END_IF + +]]> + + @@ -70,7 +118,9 @@ q_xRemote:= stPump.q_xRemote;]]> - + + + @@ -78,9 +128,13 @@ q_xRemote:= stPump.q_xRemote;]]> + + + + @@ -88,5 +142,27 @@ q_xRemote:= stPump.q_xRemote;]]> + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU index 97eb0b5..b35fb9b 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU @@ -3,7 +3,7 @@ + +// Log States and triggers +ACT_Logger();]]> + + + stPump.eState THEN + CASE stPump.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := stPump.eState; + END_IF + +// ILK logger + +IF NOT stPump.xILKOk AND stPump.q_xHVEna_DO THEN + fbLogger(sMsg:='Lost external interlock while pump was running.', eSevr:=TcEventSeverity.Critical); +END_IF + + +// Log Action +tAction(CLK:= stPump.q_xHVEna_DO); +IF tAction.Q THEN fbLogger(sMsg:='Pump commanded to start', eSevr:=TcEventSeverity.Info); END_IF + + +// Log FAULT +tFault(CLK:= NOT tPumpStartTimeout.Q); +IF tFault.Q THEN fbLogger(sMsg:='Pump Fault', eSevr:=TcEventSeverity.Critical); END_IF + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Agilent.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Agilent.TcPOU index ef280b7..acf847a 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Agilent.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Agilent.TcPOU @@ -3,7 +3,7 @@ @@ -220,8 +216,10 @@ tFaultWindowElapsed(PT:=tFaultWindowDuration); tR1Fault(IN:= (step = 60), PT:=tR1FaultDuration); tStartTimeOut(IN := (step=20), PT:=tTimeOutDuration); tR1TimeOut(IN := (step=40), PT:=tTimeOutDuration); - +(* IO Mapping*) IO(); +// Log States and triggers +ACT_Logger(); (*Assign Error Message*) iq_stPtm.sError := ErrorMessage(nErrorCode, iq_stPtm.eState); (*Validate Backing Pressure set point doesn't exceed the Maximum backingPressure*) @@ -301,7 +299,10 @@ END_VAR - + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_010M.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_010M.TcPOU index 437d08c..c482d41 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_010M.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_010M.TcPOU @@ -1,16 +1,16 @@  - + 5V 0->100C i_iCurrentMon AT %I* : INT; //Link to Analog -- input Voltage to the output current of motor 0->5V 0->10A @@ -45,7 +44,7 @@ VAR q_xProtection AT %Q* : BOOL; q_xSetSpeed AT %Q* : BOOL; q_iSpeedSet AT %Q* :INT; //Link to analog Output - //more? + END_VAR]]> ); - IF NOT (TOF_SetSpeed.Q) THEN iq_stPTM.iq_xSpeedSet:= FALSE; + IF (TOF_SetSpeed.Q) THEN iq_stPTM.iq_xSpeedSet:= FALSE; END_IF (* to reset the Reset Bit *) IF (iq_stPTM.xResetSW ) THEN iq_stPTM.q_xReset := TRUE; END_IF TOF_RESET (IN:= iq_stPTM.q_xReset, Q => ); - IF NOT (TOF_RESET.Q) THEN + IF TOF_RESET.Q THEN iq_stPTM.q_xReset:= FALSE; iq_stPTM.xResetSW := FALSE; END_IF + (*When the Protection signal is lost, Error bit doesn't show, but the controller still needs to be reset*) +RTRIG_INLK(CLK:= iq_stPTM.q_xProtection ); + IF (RTRIG_INLK.Q) AND (iq_stPTM.i_xNCFault) THEN + iq_stPTM.q_xReset := TRUE; + END_IF + (*Validate Backing Pressure set point doesn't exceed the Maximum backingPressure*) iq_stPtm.rBackingPressureSP := BackingPressureSetPoint(iq_stPtm.rBackingPressureSP,i_rMaxBackingPressure); + + + (*Pump STATE*) +IF iq_stPtm.i_xFault THEN + iq_stPtm.eState := pumpFAULT; +ELSIF iq_stPTM.i_xDecel AND NOT iq_stPtm.q_RunDO THEN + iq_stPtm.eState := pumpSTOPPING; +ELSIF NOT iq_stPtm.q_RunDO AND NOT iq_stPTM.i_xFault THEN + iq_stPtm.eState := pumpSTOPPED; +ELSIF NOT iq_stPtm.i_xAtSpd AND iq_stPtm.q_RunDO AND iq_stPTM.i_xAccel THEN + iq_stPtm.eState := pumpSTARTING; +ELSIF iq_stPtm.i_xAtSpd AND iq_stPtm.q_RunDO THEN + iq_stPtm.eState := pumpRUNNING; +ELSE + iq_stPtm.eState := pumpFAULT; +END_IF + (*soft IO mapping*) ACT_IO(); -]]> +// Log States and triggers +ACT_Logger();]]> @@ -120,12 +140,13 @@ ACT_IO(); iq_stPTM.i_xDecel := i_xDecel ; iq_stPTM.i_xAccel := i_xAccel ; iq_stPTM.i_xRotate := i_xRotate; + iq_stPTM.i_xFault := NOT iq_stPTM.i_xNCFault; //Normally closed fault handling iq_stPTM.i_xNCFault := i_xNCFault ; - iq_stPTM.i_xALARM:= i_xALARM; + iq_stPTM.i_xALARM:= NOT i_xNCFault; iq_stPTM.i_xAtSpd := i_xAtSpd; - iq_stPTM.i_iTempMon := i_iTempMon; - iq_stPTM.i_iCurrentMon := i_iCurrentMon; -//V (AI/32767*10) * (33600 {Max RPM} - 100) / 5 + iq_stPTM.i_iTempMon := 100*LREAL_TO_INT(i_iTempMon/16383);// Manual page 28(DC 0 to 5V -> 0 to 100 DegC) + iq_stPTM.i_iCurrentMon := 10*LREAL_TO_INT(i_iCurrentMon/16383);// Manual page 28 (DC 0 to 5V -> 0 to 10 A) + iq_stPTM.i_diCurSpd := 100*LREAL_TO_DINT(i_iRawSpeed/16383);// Manual page 28 (DC 0 to 5V -> 0 to 100HZ) (*outputs*) q_xStart:= iq_stPTM.q_xStart; q_xStop := iq_stPTM.q_xStop; @@ -137,26 +158,59 @@ ACT_IO(); (*Validate Set Speed within range *) IF iq_stPTM.q_iSpeedSet >= i_iMinSpeedRPM AND iq_stPTM.q_iSpeedSet <=i_iMaxSpeedRPM THEN q_iSpeedSet := LIMIT(0, DINT_TO_INT((iq_stPTM.q_iSpeedSet - i_iMinSpeedRPM) / i_iMaxSpeedRPM *16383/5),16383); //Max 5V - //:= DINT_TO_INT((q_iSpeedSet-i_iMinSpeedRPM) / i_iMaxSpeedRPM *32767/2); //Max 5V END_IF (* Pump speed calculation *) -IF i_iRawSpeed / (EXPT(2,i_iADCBits)-1) * 10 >= 0.2 THEN //Speed reading appears to zero at ~0.16V +(*IF i_iRawSpeed / (EXPT(2,i_iADCBits)-1) * 10 >= 0.2 THEN //Speed reading appears to zero at ~0.16V iq_stPTM.i_diCurSpd := LREAL_TO_DINT(i_iRawSpeed/(EXPT(2,i_iADCBits)-1)*67000); //V (AI/(2^{# ADC bits} -1 ) * 10[ADC 10V scaling]) * (33600 [Max RPM] - 100) / 5 ELSE iq_stPTM.i_diCurSpd := 0; +END_IF*) + + + + +]]> + + + + + + + +IF ePrevState <> iq_stPTM.eState THEN + CASE iq_stPTM.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := iq_stPTM.eState; + END_IF + + + + + +]]> @@ -182,67 +236,40 @@ this^.iq_stPtm.xRunSW := run;]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_011M.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_011M.TcPOU index e4ebc0e..5fc3085 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_011M.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Ebara_011M.TcPOU @@ -1,13 +1,13 @@  - + ); - IF NOT (TOF_SetSpeed.Q) THEN iq_stPTM.iq_xSpeedSet:= FALSE; + IF TOF_SetSpeed.Q THEN iq_stPTM.iq_xSpeedSet:= FALSE; END_IF (* to reset the Reset Bit *) IF (iq_stPTM.xResetSW ) THEN iq_stPTM.q_xReset := TRUE; END_IF TOF_RESET (IN:= iq_stPTM.q_xReset, Q => ); - IF NOT (TOF_RESET.Q) THEN + IF TOF_RESET.Q THEN iq_stPTM.q_xReset:= FALSE; iq_stPTM.xResetSW := FALSE; END_IF + + (*Pump STATE*) +IF iq_stPtm.i_xFault THEN + iq_stPtm.eState := pumpFAULT; +ELSIF iq_stPTM.i_xDecel AND NOT iq_stPtm.q_RunDO THEN + iq_stPtm.eState := pumpSTOPPING; +ELSIF NOT iq_stPtm.q_RunDO AND NOT iq_stPTM.i_xFault THEN + iq_stPtm.eState := pumpSTOPPED; +ELSIF NOT iq_stPtm.i_xAtSpd AND iq_stPtm.q_RunDO THEN + iq_stPtm.eState := pumpSTARTING; +ELSIF iq_stPtm.i_xAtSpd AND iq_stPtm.q_RunDO THEN + iq_stPtm.eState := pumpRUNNING; +ELSE + iq_stPtm.eState := pumpFAULT; +END_IF + +(*Validate Backing Pressure set point doesn't exceed the Maximum backingPressure*) +iq_stPtm.rBackingPressureSP := BackingPressureSetPoint(iq_stPtm.rBackingPressureSP,i_rMaxBackingPressure); + (*soft IO mapping*) ACT_IO(); +// Log States and triggers +ACT_Logger(); ]]> @@ -140,6 +162,55 @@ END_IF iq_stPTM.i_xFault := NOT iq_stPTM.i_xNCFault; //??]]> + + + iq_stPTM.eState THEN + CASE iq_stPTM.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := iq_stPTM.eState; + END_IF + +// ILK logger + + + +// Log Action +tAction(CLK:= iq_stPTM.q_RunDO); +IF tAction.Q THEN fbLogger(sMsg:='Pump commanded to start', eSevr:=TcEventSeverity.Info); END_IF + + +// Log FAULT +tFault(CLK:= iq_stPTM.i_xNCFault); +IF tFault.Q THEN fbLogger(sMsg:='Pump Lost Alarm OK bit', eSevr:=TcEventSeverity.Critical); END_IF + +]]> + + + + + + + + - + + + + + + + + + + + + + @@ -180,6 +263,13 @@ this^.iq_stPtm.xRunSW := run;]]> + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_MagDriveDigital.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_MagDriveDigital.TcPOU index 170bb8e..f1c60b4 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_MagDriveDigital.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_MagDriveDigital.TcPOU @@ -1,9 +1,9 @@  - + @@ -89,6 +92,8 @@ this^.iq_stPtm.xRunSW := run;]]> + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Pfeiffer.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Pfeiffer.TcPOU index 5b53d43..e91a22d 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Pfeiffer.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_Pfeiffer.TcPOU @@ -1,9 +1,9 @@  - + +ACT_IO(); +// Log States and triggers +ACT_Logger(); +]]> @@ -109,6 +112,8 @@ this^.iq_stPtm.xRunSW := run;]]> + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TurboDrive.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TurboDrive.TcPOU index 6f8272b..df63ac8 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TurboDrive.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TurboDrive.TcPOU @@ -1,9 +1,9 @@  - + +ACT_IO(); +// Log States and triggers +ACT_Logger(); +]]> @@ -101,6 +104,8 @@ this^.iq_stPtm.xRunSW := run;]]> + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TwisTorr.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TwisTorr.TcPOU index b2e812e..98971dc 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TwisTorr.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PTM_TwisTorr.TcPOU @@ -1,9 +1,9 @@  - + +ACT_IO(); +// Log States and triggers +ACT_Logger(); +]]> @@ -63,6 +66,44 @@ iq_stPtm.i_xFault := i_xFault; q_RunDO := iq_stPtm.q_RunDO;]]> + + + iq_stPTM.eState THEN + CASE iq_stPTM.eState OF + pumpFAULT: + fbLogger(sMsg:='Pump Fault.', eSevr:=TcEventSeverity.Critical); + pumpSTOPPED: + fbLogger(sMsg:='Pump stopped.', eSevr:=TcEventSeverity.Critical); + pumpSTARTING: + fbLogger(sMsg:='Pump starting.', eSevr:=TcEventSeverity.Info); + pumpRUNNING: + fbLogger(sMsg:='Pump running.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := iq_stPTM.eState; + END_IF + +// ILK logger + + + +// Log Action +tAction(CLK:= iq_stPTM.q_RunDO); +IF tAction.Q THEN fbLogger(sMsg:='Pump commanded to start', eSevr:=TcEventSeverity.Info); END_IF + + +// Log FAULT +tFault(CLK:= NOT iq_stPTM.i_xFault); +IF tFault.Q THEN fbLogger(sMsg:='Pump Lost Alarm OK bit', eSevr:=TcEventSeverity.Critical); END_IF + +]]> + + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_Pump.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_Pump.TcPOU new file mode 100644 index 0000000..f5f55bb --- /dev/null +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_Pump.TcPOU @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Pumps/Interfaces/FB_TPIP_ADS.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/Interfaces/FB_TPIP_ADS.TcPOU new file mode 100644 index 0000000..2f39c3a --- /dev/null +++ b/L2SIVacuum/POUs/Functions/Pumps/Interfaces/FB_TPIP_ADS.TcPOU @@ -0,0 +1,62 @@ + + + + + + , + bError=> , + nErrorId=> ); + + +(*Error*) +fb_CheckWatchdog( + bEnable:= TRUE, + tWatchdogTime:= T#100ms, + nCnt:= iWatchdog , + bWatchdog=> , + nLastCnt=> ); +bError:= fb_Read_VG.bError OR fb_CheckWatchdog.bWatchdog; + +IG.xPRESS_OK := NOT( fb_Read_VG.bError AND fb_CheckWatchdog.bWatchdog);]]> + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VCC.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VCC.TcPOU index 34a33ac..5ef4408 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VCC.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VCC.TcPOU @@ -1,7 +1,8 @@  - + - - + - - + - + + diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VGC_AP.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VGC_AP.TcPOU index dc63ab2..abf2947 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VGC_AP.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VGC_AP.TcPOU @@ -1,5 +1,5 @@  - + iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Vented', eSevr:=TcEventSeverity.Info); + ePrevState := iq_stValve.eVGC_State; + END_IF + (* Assuming the pump down went well, we are now at vacuum on both sides, so we move to the vacuum state, otherwise remain in the vented state *) - IF iq_stValve.xAT_VAC THEN - iq_stValve.eVGC_State := AtVacuum; + IF iq_stValve.xAT_VAC AND (NOT (iq_stValve.xERR_DifPres)) AND NOT (NOT (iq_stValve.xERR_SP)) and NOT (NOT (iq_stValve.xERR_ExtFault))THEN + iq_stValve.eVGC_State := AtVacuum; ELSE - iq_stValve.eVGC_State := Vented; + iq_stValve.eVGC_State := Vented; END_IF AtVacuum: + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Vacuum setpoint satisfied', eSevr:=TcEventSeverity.Info); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF iq_stValve.xAT_VAC THEN (* If both pressure setpoints are made, then enable the differential pressure interlock, regardless of the valve state assuming we're using some kind of ion gauge where a pressure setpoint cannot be higher than 1E-4 T *) iq_stValve.eVGC_State := AtVacuum; + ELSE (* If the valve is open (or in an unknown state) and either gauge is not at it's vacuum setpoint, we have a loss of vacuum error *) IF (iq_stValve.i_xOpnLS OR (NOT iq_stValve.i_xOpnLS AND NOT iq_stValve.i_xClsLS)) THEN - iq_stValve.eVGC_State := ERR_LostVac; + iq_stValve.eVGC_State := ERR_LostVac; + iq_stValve.xERR_SP := TRUE; //TAW changed this to the ERR_SP bool because I think that's what it was intended to be? (* Alternatively, if the valve is already closed and we lose pressure on one side, it was probably intentional venting, so we calmly move back to venting mode, and disable the differential pressure interlock *) //?? ELSIF iq_stValve.i_xClsLS THEN - iq_stValve.eVGC_State := Vented; + iq_stValve.eVGC_State := Vented; END_IF END_IF - ERR_DiffPress: - iq_stValve.eVGC_State := Vented; - iq_stValve.xERR_DifPres := TRUE; + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Potential accidental vent.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + + IF NOT (iq_stValve.xERR_DifPres) THEN + iq_stValve.eVGC_State := Vented; + END_IF + ERR_LostVac: - iq_stValve.eVGC_State := Vented; - iq_stValve.xERR_SP := TRUE; - + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Unexpected loss of vacuum while valve was open.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF NOT (iq_stValve.xERR_SP) THEN + iq_stValve.eVGC_State := Vented; + END_IF + + ERR_ExtFault: + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Lost external interlock while valve was open.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF NOT (iq_stValve.xERR_ExtFault) AND (NOT i_xExt_OK) THEN + iq_stValve.eVGC_State := Vented; + END_IF END_CASE +IF (NOT i_xExt_OK) THEN + iq_stValve.eVGC_State := ERR_ExtFault; + iq_stValve.xERR_ExtFault := TRUE; +END_IF // Interlock evaluation - with bypass for DP ILK bypass /////////////////////////////////////////////// @@ -247,7 +295,10 @@ tonDelOK(IN:=iq_stValve.xOPN_OK, PT:=tDelOK); rtOK(CLK:=tonDelOK.Q); IF rtOK.Q AND iq_stValve.pv_xOvrdOpn THEN iq_stValve.pv_xOvrdOpn :=FALSE; - iq_stValve.pv_xOPN_SW := TRUE; //for seamless transition + if (iq_stValve.eState = OPEN) AND (i_xOverrideMode) THEN iq_stValve.pv_xOPN_SW := TRUE; END_IF //for seamless transition + //Log + fbLogger(sMsg:='Override expired', eSevr:=TcEventSeverity.Warning); + END_IF //Override timer @@ -255,13 +306,13 @@ tonOvrd(IN:=iq_stValve.pv_xOvrdOpn, PT:=tOvrd); (* If Epics Command to close the Valve, check if PMPS and EPS are ok, otherwise Keep command set to open valve *) IF NOT(iq_stValve.pv_xOPN_SW) AND ((NOT i_xPMPS_OK) OR (NOT i_xEPS_OK)) THEN - iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal + //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal END_IF (* Reset the EPICS command to open the valve if the interlock is lost *) (* based on EPS ok state, EPS overrides OPN_OK*) IF NOT iq_stValve.xOPN_OK THEN IF i_xEPS_OK THEN iq_stValve.pv_xOPN_SW := FALSE; iq_stValve.sErrorMessage := 'ILK Active'; - ELSE iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal + ELSE //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal END_IF END_IF @@ -288,6 +339,19 @@ tOPNtimeout(IN:= iq_stValve.q_xOPN_DO, PT := tTimeOutDuration ); tCLStimeout(IN:= NOT iq_stValve.q_xOPN_DO, PT := tTimeOutDuration); +// Log valve timeouts +tErrorPresent(CLK:=iq_stValve.bErrorPresent); +IF tErrorPresent.Q THEN fbLogger(sMsg:=iq_stValve.sErrorMessage, eSevr:=TcEventSeverity.Warning); END_IF + +// Log valve open +tAction(CLK:= iq_stValve.q_xOPN_DO); +IF tAction.Q THEN fbLogger(sMsg:='Valve commanded open', eSevr:=TcEventSeverity.Info); END_IF + +// Log override mode enabled +tOverrideActivated(CLK:= (tonOvrd.Q AND i_xOverrideMode)); +IF tOverrideActivated.Q THEN fbLogger(sMsg:='Valve override mode activated', eSevr:=TcEventSeverity.Warning); END_IF + + // Alarm reset ////////////////////////////////////// ACT_ResetAlarms(); @@ -379,12 +443,21 @@ END_VAR - + + + + + + + - + + + + @@ -408,6 +481,7 @@ END_VAR + diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VGC_EBD.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VGC_EBD.TcPOU index 20f8396..7250f89 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VGC_EBD.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VGC_EBD.TcPOU @@ -86,6 +86,13 @@ VAR tCLStimeout:TON; + // For logging + fbLogger : FB_LogMessage := (eSubsystem:=E_SubSystem.VACUUM); + ePrevState : E_VGC; + tErrorPresent : R_TRIG; + tAction : R_TRIG; // Primary action of this device (OPN_DO, PUMP_RUN, etc.) + tOverrideActivated : R_TRIG; + (*IO*) i_xOpnLS AT%I*: BOOL; i_xClsLS AT%I*: BOOL; @@ -178,54 +185,94 @@ END_IF the state is unexpected and triggers a fault, because it suggests that something is wrong with the valve, or gauges or mapping or there is a major leak on one side.*) iq_stValve.eVGC_State := ERR_DiffPress; + iq_stValve.xERR_DifPres := TRUE; END_IF // Valve state /////////////////////////////////////////////////// CASE iq_stValve.eVGC_State OF Vented: (* The Vented state is used during pump down *) + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Vented', eSevr:=TcEventSeverity.Info); + ePrevState := iq_stValve.eVGC_State; + END_IF + (* Assuming the pump down went well, we are now at vacuum on both sides, so we move to the vacuum state, otherwise remain in the vented state *) - IF iq_stValve.xAT_VAC THEN - iq_stValve.eVGC_State := AtVacuum; + IF iq_stValve.xAT_VAC AND (NOT (iq_stValve.xERR_DifPres)) AND NOT (NOT (iq_stValve.xERR_SP)) and NOT (NOT (iq_stValve.xERR_ExtFault))THEN + iq_stValve.eVGC_State := AtVacuum; ELSE - iq_stValve.eVGC_State := Vented; + iq_stValve.eVGC_State := Vented; END_IF AtVacuum: + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Vacuum setpoint satisfied', eSevr:=TcEventSeverity.Info); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF iq_stValve.xAT_VAC THEN (* If both pressure setpoints are made, then enable the differential pressure interlock, regardless of the valve state assuming we're using some kind of ion gauge where a pressure setpoint cannot be higher than 1E-4 T *) iq_stValve.eVGC_State := AtVacuum; + ELSE (* If the valve is open (or in an unknown state) and either gauge is not at it's vacuum setpoint, we have a loss of vacuum error *) IF (iq_stValve.i_xOpnLS OR (NOT iq_stValve.i_xOpnLS AND NOT iq_stValve.i_xClsLS)) THEN - iq_stValve.eVGC_State := ERR_LostVac; + iq_stValve.eVGC_State := ERR_LostVac; + iq_stValve.xERR_SP := TRUE; //TAW changed this to the ERR_SP bool because I think that's what it was intended to be? (* Alternatively, if the valve is already closed and we lose pressure on one side, it was probably intentional venting, so we calmly move back to venting mode, and disable the differential pressure interlock *) //?? ELSIF iq_stValve.i_xClsLS THEN - iq_stValve.eVGC_State := Vented; + iq_stValve.eVGC_State := Vented; END_IF END_IF ERR_DiffPress: - iq_stValve.eVGC_State := Vented; - iq_stValve.xERR_DifPres := TRUE; + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Potential accidental vent.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + + IF NOT (iq_stValve.xERR_DifPres) THEN + iq_stValve.eVGC_State := Vented; + END_IF + ERR_LostVac: - iq_stValve.eVGC_State := Vented; - iq_stValve.xERR_SP := TRUE; - - END_CASE - - + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Unexpected loss of vacuum while valve was open.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF NOT (iq_stValve.xERR_SP) THEN + iq_stValve.eVGC_State := Vented; + END_IF + + ERR_ExtFault: + //Log new state + IF ePrevState <> iq_stValve.eVGC_State THEN + fbLogger(sMsg:='Lost external interlock while valve was open.', eSevr:=TcEventSeverity.Critical); + ePrevState := iq_stValve.eVGC_State; + END_IF + IF NOT (iq_stValve.xERR_ExtFault) AND (NOT i_xExt_OK) THEN + iq_stValve.eVGC_State := Vented; + END_IF +END_CASE +IF (NOT i_xExt_OK) THEN + iq_stValve.eVGC_State := ERR_ExtFault; + iq_stValve.xERR_ExtFault := TRUE; +END_IF // Interlock evaluation - with bypass for DP ILK bypass /////////////////////////////////////////////// @@ -248,7 +295,10 @@ tonDelOK(IN:=iq_stValve.xOPN_OK, PT:=tDelOK); rtOK(CLK:=tonDelOK.Q); IF rtOK.Q AND iq_stValve.pv_xOvrdOpn THEN iq_stValve.pv_xOvrdOpn :=FALSE; - iq_stValve.pv_xOPN_SW := TRUE; //for seamless transition + if (iq_stValve.eState = OPEN) AND (i_xOverrideMode) THEN iq_stValve.pv_xOPN_SW := TRUE; END_IF //for seamless transition + //Log + fbLogger(sMsg:='Override expired', eSevr:=TcEventSeverity.Warning); + END_IF //Override timer @@ -256,13 +306,13 @@ tonOvrd(IN:=iq_stValve.pv_xOvrdOpn, PT:=tOvrd); (* If Epics Command to close the Valve, check if PMPS and EPS are ok, otherwise Keep command set to open valve *) IF NOT(iq_stValve.pv_xOPN_SW) AND ((NOT i_xPMPS_OK) OR (NOT i_xEPS_OK)) THEN - iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal + //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal END_IF (* Reset the EPICS command to open the valve if the interlock is lost *) (* based on EPS ok state, EPS overrides OPN_OK*) IF NOT iq_stValve.xOPN_OK THEN IF i_xEPS_OK THEN iq_stValve.pv_xOPN_SW := FALSE; iq_stValve.sErrorMessage := 'ILK Active'; - ELSE iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal + ELSE //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal END_IF END_IF @@ -275,19 +325,32 @@ xMPS_OK := (iq_stValve.eState=OPEN);//iq_stValve.i_xOpnLS; ///Check valve moving postion timout IF NOT iq_stValve.i_xClsLS AND tCLStimeout.Q THEN iq_stValve.bErrorPresent := TRUE; - iq_stValve.sErrorMessage := ': Close Timeout'; + iq_stValve.sErrorMessage := ' Close Timeout'; ELSIF NOT iq_stValve.i_xOpnLS AND tOPNtimeout.Q THEN iq_stValve.bErrorPresent := TRUE; - iq_stValve.sErrorMessage := ': Open Timeout'; + iq_stValve.sErrorMessage := ' Open Timeout'; END_IF IF (iq_stValve.eState=INVALID) THEN iq_stValve.bErrorPresent := TRUE; - iq_stValve.sErrorMessage := CONCAT(sPath,': Invalid Valve Position'); + iq_stValve.sErrorMessage := CONCAT(sPath,' Invalid Valve Position'); END_IF + + (*Timers*) tOPNtimeout(IN:= iq_stValve.q_xOPN_DO, PT := tTimeOutDuration ); tCLStimeout(IN:= NOT iq_stValve.q_xOPN_DO, PT := tTimeOutDuration); +// Log valve timeouts +tErrorPresent(CLK:=iq_stValve.bErrorPresent); +IF tErrorPresent.Q THEN fbLogger(sMsg:=iq_stValve.sErrorMessage, eSevr:=TcEventSeverity.Warning); END_IF + +// Log valve open +tAction(CLK:= iq_stValve.q_xOPN_DO); +IF tAction.Q THEN fbLogger(sMsg:='Valve commanded open', eSevr:=TcEventSeverity.Info); END_IF + +// Log override mode enabled +tOverrideActivated(CLK:= (tonOvrd.Q AND i_xOverrideMode)); +IF tOverrideActivated.Q THEN fbLogger(sMsg:='Valve override mode activated', eSevr:=TcEventSeverity.Warning); END_IF // Alarm reset ////////////////////////////////////// @@ -360,64 +423,7 @@ END_VAR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VRC.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VRC.TcPOU index 95849db..3ececda 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VRC.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VRC.TcPOU @@ -1,11 +1,11 @@  - + +ACT_IO(); + +// Log States and triggers +ACT_Logger();]]> @@ -107,6 +141,47 @@ iq_stValve.xOverrideMode := i_xOverrideMode; q_xOPN_DO:= iq_stValve.q_xOPN_DO;]]> + + + iq_stValve.eState THEN + CASE iq_stValve.eState OF + INVALID: + fbLogger(sMsg:='Valve invalid position.', eSevr:=TcEventSeverity.Critical); + MOVING: + fbLogger(sMsg:='Valve moving', eSevr:=TcEventSeverity.Warning); + OPEN: + fbLogger(sMsg:='Valve Open.', eSevr:=TcEventSeverity.Info); + CLOSED: + fbLogger(sMsg:='Valve closed.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := iq_stValve.eState; + END_IF + + + +// Log valve timeouts +tErrorPresent(CLK:=iq_stValve.bErrorPresent); +IF tErrorPresent.Q THEN fbLogger(sMsg:=iq_stValve.sErrorMessage, eSevr:=TcEventSeverity.Warning); END_IF + +// Log valve open +tAction(CLK:= iq_stValve.q_xOPN_DO); +IF tAction.Q THEN fbLogger(sMsg:='Valve commanded open', eSevr:=TcEventSeverity.Info); END_IF + +// Log override mode enabled +tOverrideActivated(CLK:= (tonOvrd.Q AND i_xOverrideMode)); +IF tOverrideActivated.Q THEN fbLogger(sMsg:='Valve override mode activated', eSevr:=TcEventSeverity.Warning); END_IF +]]> + + - - + + + + + + + + + + + + + @@ -147,6 +233,28 @@ END_VAR + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VRC_EBD.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VRC_EBD.TcPOU index f10c6e6..7a9fa75 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VRC_EBD.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VRC_EBD.TcPOU @@ -1,10 +1,10 @@  - + xFirstPass); +IF xFirstPass THEN + iq_stValve.eVGC_State := Vented; + iq_stValve.pv_xOPN_SW := FALSE; +END_IF + -///Check valve postion +///Check valve position IF NOT iq_stValve.i_xClsLS AND iq_stValve.i_xOpnLS THEN iq_stValve.eState:=OPEN; ELSIF iq_stValve.i_xClsLS AND NOT iq_stValve.i_xOpnLS THEN @@ -48,6 +64,11 @@ END_IF iq_stValve.xOPN_OK := i_xExtILK_OK; IF NOT iq_stValve.xOPN_OK and NOT tonOvrd.Q THEN iq_stValve.pv_xOPN_SW := FALSE; + iq_stValve.eVGC_State := ERR_ExtFault; +END_IF + +IF (iq_stValve.q_xOPN_DO) AND (iq_stValve.xOPN_OK) THEN + iq_stValve.eVGC_State := AtVacuum; END_IF (* Override logic *) @@ -58,7 +79,12 @@ when the valve permission goes true for more than ten seconds consistently, remo tonDelOK(IN:=iq_stValve.xOPN_OK, PT:=T#10S); rtOK(CLK:=tonDelOK.Q); -IF rtOK.Q THEN iq_stValve.pv_xOvrdOpn :=FALSE; END_IF +IF rtOK.Q AND iq_stValve.pv_xOvrdOpn THEN + iq_stValve.pv_xOvrdOpn :=FALSE; + if (iq_stValve.eState=OPEN) AND (i_xOverrideMode) THEN iq_stValve.pv_xOPN_SW := TRUE; END_IF + //Log + fbLogger(sMsg:='Override expired', eSevr:=TcEventSeverity.Warning); +END_IF //Override timer tonOvrd(IN:=iq_stValve.pv_xOvrdOpn, PT:=T#10S); @@ -66,8 +92,31 @@ tonOvrd(IN:=iq_stValve.pv_xOvrdOpn, PT:=T#10S); (* Here's where the valve opens *) iq_stValve.q_xOPN_DO := (iq_stValve.pv_xOPN_SW AND iq_stValve.xOPN_OK) OR (tonOvrd.Q AND i_xOverrideMode); +///Check valve moving postion timout +IF NOT iq_stValve.i_xClsLS AND tCLStimeout.Q THEN + iq_stValve.bErrorPresent := TRUE; + iq_stValve.sErrorMessage := ' Close Timeout'; +ELSIF NOT iq_stValve.i_xOpnLS AND tOPNtimeout.Q THEN + iq_stValve.bErrorPresent := TRUE; + iq_stValve.sErrorMessage := ' Open Timeout'; +END_IF +IF (iq_stValve.eState=INVALID) THEN + iq_stValve.bErrorPresent := TRUE; + iq_stValve.sErrorMessage := CONCAT(sPath,' Invalid Valve Position'); +END_IF + +(*Timers*) +tOPNtimeout(IN:= iq_stValve.q_xOPN_DO, PT := tTimeOutDuration ); +tCLStimeout(IN:= NOT iq_stValve.q_xOPN_DO, PT := tTimeOutDuration); + + + + (*Soft IO Mapping*) -ACT_IO();]]> +ACT_IO(); + +// Log States and triggers +ACT_Logger();]]> @@ -80,6 +129,47 @@ q_xOPN_DO:= iq_stValve.q_xOPN_DO; q_xOPN_DO_2:= iq_stValve.q_xOPN_DO;]]> + + + iq_stValve.eState THEN + CASE iq_stValve.eState OF + INVALID: + fbLogger(sMsg:='Valve invalid position.', eSevr:=TcEventSeverity.Critical); + MOVING: + fbLogger(sMsg:='Valve moving', eSevr:=TcEventSeverity.Warning); + OPEN: + fbLogger(sMsg:='Valve Open.', eSevr:=TcEventSeverity.Info); + CLOSED: + fbLogger(sMsg:='Valve closed.', eSevr:=TcEventSeverity.Info); + END_CASE + ePrevState := iq_stValve.eState; + END_IF + + + +// Log valve timeouts +tErrorPresent(CLK:=iq_stValve.bErrorPresent); +IF tErrorPresent.Q THEN fbLogger(sMsg:=iq_stValve.sErrorMessage, eSevr:=TcEventSeverity.Warning); END_IF + +// Log valve open +tAction(CLK:= iq_stValve.q_xOPN_DO); +IF tAction.Q THEN fbLogger(sMsg:='Valve commanded open', eSevr:=TcEventSeverity.Info); END_IF + +// Log override mode enabled +tOverrideActivated(CLK:= (tonOvrd.Q AND i_xOverrideMode)); +IF tOverrideActivated.Q THEN fbLogger(sMsg:='Valve override mode activated', eSevr:=TcEventSeverity.Warning); END_IF +]]> + + + - - + + + + + + + + + + + + + + + + @@ -107,6 +212,28 @@ END_VAR + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_Valve.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_Valve.TcPOU new file mode 100644 index 0000000..2256692 --- /dev/null +++ b/L2SIVacuum/POUs/Functions/Valves/FB_Valve.TcPOU @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK.TcPOU b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK.TcPOU index 8b09801..83274cc 100644 --- a/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK.TcPOU @@ -1,5 +1,5 @@  - + diff --git a/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK_1.TcPOU b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK_1.TcPOU new file mode 100644 index 0000000..f6287f8 --- /dev/null +++ b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_ILK_1.TcPOU @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_Protection_ILK.TcPOU b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_Protection_ILK.TcPOU index 691090f..b09f3cd 100644 --- a/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_Protection_ILK.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/functions/F_TurboGateValve_Protection_ILK.TcPOU @@ -1,5 +1,5 @@  - +