Simplified Permissives, Added UDFB for writing params
This commit is contained in:
@@ -1 +1 @@
|
||||
COMPILED
|
||||
TO RELINK
|
||||
@@ -901,6 +901,7 @@ Controller.Micro820.Micro820.RP_Pressure TRUE
|
||||
Controller.Micro820.Micro820.RP_Temperature FALSE
|
||||
Controller.Micro820.Micro820.RP_Trip TRUE
|
||||
Controller.Micro820.Micro820.RP_TubingPressure TRUE
|
||||
Controller.Micro820.Micro820.RP_VFD
|
||||
Controller.Micro820.Micro820.Run_Permissive TRUE
|
||||
Controller.Micro820.Micro820.Run_Time T#30s7ms
|
||||
Controller.Micro820.Micro820.Shutdown_Time T#31m24s246ms
|
||||
@@ -908,6 +909,7 @@ Controller.Micro820.Micro820.SP_Mode TRUE
|
||||
Controller.Micro820.Micro820.SP_Pressure TRUE
|
||||
Controller.Micro820.Micro820.SP_Temperature TRUE
|
||||
Controller.Micro820.Micro820.SP_Trip TRUE
|
||||
Controller.Micro820.Micro820.SP_VFD
|
||||
Controller.Micro820.Micro820.SP_Voltage TRUE
|
||||
Controller.Micro820.Micro820.Start_Button FALSE
|
||||
Controller.Micro820.Micro820.Start_Command FALSE
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
TO RELINK
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -1 +0,0 @@
|
||||
COMPILED
|
||||
@@ -105,26 +105,78 @@ ELSE
|
||||
TubingPressure_OK := TRUE;
|
||||
END_IF;
|
||||
|
||||
(* Start Permissive Status *)
|
||||
IF Pressure_Startup_Enabled THEN
|
||||
IF (DH_IntakePressure > Pressure_Startup) THEN
|
||||
SP_Pressure := TRUE;
|
||||
ELSE
|
||||
SP_Pressure := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
SP_Pressure := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Temp_Startup_Enabled THEN
|
||||
IF DH_IntakeTemperature < Temp_Startup THEN
|
||||
SP_Temperature := TRUE;
|
||||
ELSE
|
||||
SP_Temperature := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
SP_Temperature := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Hand_Mode OR Auto_Mode OR Test_Mode THEN
|
||||
SP_Mode := TRUE;
|
||||
ELSE
|
||||
SP_Mode := FALSE;
|
||||
END_IF;
|
||||
|
||||
SP_Trip := NOT TripStatus;
|
||||
SP_VFD := VFD_Ready;
|
||||
|
||||
|
||||
(* Pressure should be above the startup pressure setpoint and temperature should be below the startup temp setpoint to begin*)
|
||||
IF ((((DH_IntakePressure > DH_Pressure_Startup) AND DH_Pressure_Startup_Enabled) OR NOT DH_Pressure_Startup_Enabled) AND
|
||||
(((DH_IntakeTemperature < DH_Temp_Startup) AND DH_Temp_Startup_Enabled) OR NOT DH_Temp_Startup_Enabled) AND
|
||||
(Hand_Mode OR Auto_Mode OR Test_Mode) AND
|
||||
(NOT VFD_Fault)
|
||||
) THEN
|
||||
IF (SP_Pressure AND SP_Temperature AND SP_Mode AND SP_VFDFault) THEN
|
||||
Start_Permissive := TRUE;
|
||||
ELSE
|
||||
Start_Permissive := FALSE;
|
||||
Device_Status := 'Not ready to start';
|
||||
END_IF;
|
||||
|
||||
|
||||
(* Run Permissive Status *)
|
||||
IF Pressure_Shutdown_Enabled THEN
|
||||
IF DH_IntakePressure > Pressure_Shutdown THEN
|
||||
RP_Pressure := TRUE;
|
||||
ELSE
|
||||
RP_Pressure := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
RP_Pressure := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Temp_Shutdown_Enabled THEN
|
||||
IF DH_IntakeTemperature < Temp_Shutdown THEN
|
||||
RP_Temperature := TRUE;
|
||||
ELSE
|
||||
RP_Temperature := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
RP_Temperature := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Hand_Mode OR Auto_Mode OR Test_Mode THEN
|
||||
RP_Mode := TRUE;
|
||||
ELSE
|
||||
RP_Mode := FALSE;
|
||||
END_IF;
|
||||
|
||||
RP_VFD := VFD_Ready;
|
||||
RP_TubingPressure := Pressure_OK;
|
||||
|
||||
(* Pressure should be be above the shutdown pressure and temperature should be below shutdown temp setpoint to continue to run *)
|
||||
IF ((((DH_IntakePressure > DH_Pressure_Shutdown) AND DH_Pressure_Shutdown_Enabled) OR NOT DH_Pressure_Shutdown_Enabled) AND
|
||||
(((DH_IntakeTemperature < DH_Temp_Shutdown) AND DH_Temp_Shutdown_Enabled) OR NOT DH_Temp_Shutdown_Enabled) AND
|
||||
(Hand_Mode OR Auto_Mode OR Test_Mode)
|
||||
AND (NOT VFD_Fault)
|
||||
AND TubingPressure_OK
|
||||
) THEN
|
||||
IF (RP_Pressure AND RP_Temperature AND RP_Mode AND RP_VFD AND RP_TubingPressure) THEN
|
||||
Run_Permissive := TRUE;
|
||||
ELSE
|
||||
Run_Permissive := FALSE;
|
||||
@@ -202,64 +254,4 @@ END_IF;
|
||||
IF NOT VFD_Running THEN
|
||||
Start_Time_Set := FALSE;
|
||||
END_IF;
|
||||
|
||||
|
||||
(* Start Permissive Status *)
|
||||
IF DH_Pressure_Startup_Enabled THEN
|
||||
IF (DH_IntakePressure > DH_Pressure_Startup) THEN
|
||||
SP_Pressure := TRUE;
|
||||
ELSE
|
||||
SP_Pressure := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
SP_Pressure := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF DH_Temp_Startup_Enabled THEN
|
||||
IF DH_IntakeTemperature < DH_Temp_Startup THEN
|
||||
SP_Temperature := TRUE;
|
||||
ELSE
|
||||
SP_Temperature := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
SP_Temperature := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Hand_Mode OR Auto_Mode OR Test_Mode THEN
|
||||
SP_Mode := TRUE;
|
||||
ELSE
|
||||
SP_Mode := FALSE;
|
||||
END_IF;
|
||||
|
||||
(* Run Permissive Status *)
|
||||
IF DH_Pressure_Shutdown_Enabled THEN
|
||||
IF DH_IntakePressure > DH_Pressure_Shutdown THEN
|
||||
RP_Pressure := TRUE;
|
||||
ELSE
|
||||
RP_Pressure := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
RP_Pressure := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF DH_Temp_Shutdown_Enabled THEN
|
||||
IF DH_IntakeTemperature < DH_Temp_Shutdown THEN
|
||||
RP_Temperature := TRUE;
|
||||
ELSE
|
||||
RP_Temperature := FALSE;
|
||||
END_IF;
|
||||
ELSE
|
||||
RP_Temperature := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF Hand_Mode OR Auto_Mode OR Test_Mode THEN
|
||||
RP_Mode := TRUE;
|
||||
ELSE
|
||||
RP_Mode := FALSE;
|
||||
END_IF;
|
||||
|
||||
RP_TubingPressure := TubingPressure_OK;
|
||||
|
||||
|
||||
|
||||
END_PROGRAM
|
||||
@@ -1,13 +0,0 @@
|
||||
USINT_TO_UDINT(149):
|
||||
VFD_MESSAGING(163):FB,RA_PFX_ENET_STS_CMD(164);
|
||||
DINT_TO_USINT(154):
|
||||
UINT_TO_USINT(155):
|
||||
USINT_TO_UINT(151):
|
||||
RA_PFX_ENET_STS_CMD(164):FB,MSG_CIPGENERIC();FB,R_TRIG();FB,COP();
|
||||
CONTROL(161):FB,LINEARSCALE(159);
|
||||
USINT_TO_SINT(152):
|
||||
LINEARSCALE(159):
|
||||
SINT_TO_USINT(156):
|
||||
UDINT_TO_USINT(153):
|
||||
USINT_TO_DINT(150):
|
||||
READDOWNHOLEDATA(160):
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Root Version="5">
|
||||
<LanguageContainerStyle CommentTextColor="Green" CommentFont="Courier New, 10pt" PonctuationTextColor="Black" PonctuationFont="Courier New, 10pt" IdentifierTextColor="Black" IdentifierFont="Courier New, 10pt" OperatorTextColor="Black" OperatorFont="Courier New, 10pt" ReservedWordTextColor="Fuchsia" ReservedWordFont="Courier New, 10pt" PouTextColor="BlueViolet" PouFont="Courier New, 10pt" NumberTextColor="Firebrick" NumberFont="Courier New, 10pt" StringTextColor="Gray" StringFont="Courier New, 10pt" EditorTextAreaBackgroundColor="White" EditorFont="Courier New, 10pt" Index="0" />
|
||||
</Root>
|
||||
@@ -0,0 +1,88 @@
|
||||
FUNCTION_BLOCK RA_PFx_ENET_PAR_WRITE
|
||||
(*=====================================================================================================================================
|
||||
[UDFB Name] :RA_PFx_ENET_PAR_WRITE (v6)
|
||||
[Catagory] :Communication
|
||||
[Description] :Write a single PF4x or PF52x drive parameter over Ethernet using Explicit Messaging (v6)
|
||||
[Author] :Rockwell Automation
|
||||
[Created using CCW version] :6.01
|
||||
[FeedBack] :RASampleCode@ra.rockwell.com
|
||||
[Revison History] :2014-August - Original Release for Version 6
|
||||
[Notes] :DO NOT USE THIS UDFB WITH MORE THAN 4 DRIVES IN A PROJECT - IF YOU DO, YOU WILL GET RANDOM MSG ERRORS!
|
||||
|
||||
=====================================================================================================================================*)
|
||||
|
||||
FBENO := FBEN;
|
||||
(*-------- Initialize --------*)
|
||||
FBEN_RTRIG(FBEN);
|
||||
IF (__SYSVA_FIRST_SCAN OR FBEN_RTRIG.Q) THEN
|
||||
MSGTimeOut_EN := TRUE;
|
||||
MSGParWrite_EN:= FALSE;
|
||||
TimeOutCtrlCfg.TriggerType := 1000; (*Triggers message every 1000 ms while MSGTimeOut_EN is true*)
|
||||
TimeOutTargetCfg.Path := '4,'+ IPAddress;
|
||||
TimeOutTargetCfg.CipConnMode := 0; (*0-unconnected, 1-Class 3*)
|
||||
TimeOutTargetCfg.UcmmTimeout := 250; (*Unconnected message time out, Set to 0 means 3000ms, range 250-10000*)
|
||||
TimeOutTargetCfg.ConnMsgTimeout := 800; (*Class3 time out, Set to 0 means 3000ms, range 800-10000*)
|
||||
TimeOutTargetCfg.ConnClose := FALSE;(*Don't close the connection upon message completion*)
|
||||
TimeOutAppCfg.Service := 16; (*Service code 10h for Set Attribute Single*)
|
||||
TimeOutAppCfg.Class := 7; (*Class code 7 for Register Object*)
|
||||
TimeOutAppCfg.Instance := 0; (*Instance 0 for Class Attribute*)
|
||||
TimeOutAppCfg.Attribute := 100;(*Attribute 100 for Control Timeout*)
|
||||
|
||||
IF EnetCtrlTO_sec <> 0 THEN
|
||||
TimeOutReqData[1]:= EnetCtrlTO_sec; (*Set Ethernet Control Timeout value in seconds*)
|
||||
ELSE
|
||||
TimeOutReqData[1]:= 5; (*If 0 (invalid) set Ethernet Control Timeout to 5 seconds*)
|
||||
END_IF;
|
||||
|
||||
ParWriteCtrlCfg.TriggerType := 0;
|
||||
ParWriteTargetCfg.Path := '4,'+ IPAddress;
|
||||
ParWriteTargetCfg.CipConnMode := 0; (*0-unconnected, 1-Class 3*)
|
||||
ParWriteTargetCfg.UcmmTimeout := 250; (*Unconnected message time out, Set to 0 means 3000ms, range 250-10000*)
|
||||
ParWriteTargetCfg.ConnMsgTimeout:= 800; (*Class3 time out, Set to 0 means 3000ms, range 800-10000*)
|
||||
ParWriteTargetCfg.ConnClose := FALSE;(*Don't close the connection upon message completion*)
|
||||
ParWriteAppCfg.Service := 16; (*Service code 10h for Set Attribute Single*)
|
||||
ParWriteAppCfg.Class := 15; (*Class code 0Fh for Parameter Object*)
|
||||
ParWriteAppCfg.Instance := ANY_TO_UDINT(ParameterNumber);
|
||||
ParWriteAppCfg.Attribute := 1; (*Attribute 1 for Parameter Value*)
|
||||
ParWriteReqData[1] := ANY_TO_USINT(AND_MASK(ANY_TO_DINT(ParameterValue), 2#0000_0000_1111_1111));
|
||||
ParWriteReqData[2] := ANY_TO_USINT(SHR(ANY_TO_DINT(ParameterValue), 8));
|
||||
CIPErrorStatus := NoErrorStatus;
|
||||
END_IF;
|
||||
|
||||
(*-------- Main Routine --------*)
|
||||
IF FBEN THEN
|
||||
MSGTimeOut_Q_RTRIG(MSGTimeOut.Q);
|
||||
MSGParWrite_Q_RTRIG(MSGParWrite.Q);
|
||||
|
||||
IF MSGTimeOut_Q_RTRIG.Q THEN
|
||||
CIPErrorStatus := MSGTimeOut.Status;
|
||||
MSGTimeOut_EN := FALSE;
|
||||
MSGParWrite_EN := TRUE;
|
||||
END_IF;
|
||||
|
||||
IF MSGParWrite_Q_RTRIG.Q THEN
|
||||
CIPErrorStatus := MSGParWrite.Status;
|
||||
MSGParWrite_EN := FALSE;
|
||||
END_IF;
|
||||
|
||||
MSGTimeOut_Err_RTRIG(MSGTimeOut.Status.Error);
|
||||
MSGParWrite_Err_RTRIG(MSGParWrite.Status.Error);
|
||||
|
||||
IF MSGTimeOut_Err_RTRIG.Q THEN
|
||||
CIPErrorStatus := MSGTimeOut.Status;
|
||||
END_IF;
|
||||
|
||||
IF MSGParWrite_Err_RTRIG.Q THEN
|
||||
CIPErrorStatus := MSGParWrite.Status;
|
||||
MSGParWrite_EN := FALSE;
|
||||
END_IF;
|
||||
|
||||
ELSE
|
||||
MSGTimeOut_EN := FALSE;
|
||||
MSGParWrite_EN := FALSE;
|
||||
|
||||
END_IF;
|
||||
|
||||
MSGTimeOut(MSGTimeOut_EN, TimeOutCtrlCfg, TimeOutAppCfg, TimeOutTargetCfg, TimeOutReqData, 2,);
|
||||
MSGParWrite(MSGParWrite_EN, ParWriteCtrlCfg, ParWriteAppCfg, ParWriteTargetCfg, ParWriteReqData, 2,);
|
||||
END_FUNCTION_BLOCK
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
[RMDManager]
|
||||
TASK=BUILD
|
||||
TASK=REBUILD
|
||||
|
||||
27
Controller/Controller/RmcVariables
Normal file
27
Controller/Controller/RmcVariables
Normal file
@@ -0,0 +1,27 @@
|
||||
Controller.Micro820.Micro820.SP_VFD
|
||||
Controller.Micro820.Micro820.RP_VFD
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.FBEN
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.IPAddress
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.EnetCtrlTO_sec
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParameterNumber
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParameterValue
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.FBENO
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.CIPErrorStatus
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGParWrite
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGParWrite_EN
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParWriteCtrlCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParWriteAppCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParWriteTargetCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.ParWriteReqData
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.FBEN_RTRIG
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGParWrite_Q_RTRIG
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGParWrite_Err_RTRIG
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGTimeOut
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGTimeOut_EN
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGTimeOut_Err_RTRIG
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.MSGTimeOut_Q_RTRIG
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.TimeOutAppCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.TimeOutCtrlCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.TimeOutReqData
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.TimeOutTargetCfg
|
||||
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_WRITE.NoErrorStatus
|
||||
Binary file not shown.
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ProjectElements>
|
||||
<AcfElementGuid Guid="150f03a9-89f5-4069-b29d-b64d9ee17aa8">
|
||||
<File>RA_PFx_ENET_PAR_WRITE.AcfMlge</File>
|
||||
</AcfElementGuid>
|
||||
<AcfElementGuid Guid="2e293809-2592-4360-9ef5-9e938bc7b980">
|
||||
<File>Control.AcfMlge</File>
|
||||
</AcfElementGuid>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user