Added Drive Read UDFB

This commit is contained in:
Patrick McDonagh
2016-02-18 22:20:11 -06:00
parent 7b24e807fa
commit b082cf7f4c
13 changed files with 98 additions and 1 deletions

View File

@@ -1643,9 +1643,11 @@ Controller.Micro820.Micro820.VFD_Messaging.VFD.UnknownDrv
Controller.Micro820.Micro820.VFD_Messaging.VFD.UpdateRate_ms
Controller.Micro820.Micro820.VFD_OutputCurrent
Controller.Micro820.Micro820.VFD_OutputVoltage
Controller.Micro820.Micro820.VFD_Read
Controller.Micro820.Micro820.VFD_Ready
Controller.Micro820.Micro820.VFD_Running
Controller.Micro820.Micro820.VFD_SpeedFdbk
Controller.Micro820.Micro820.VFD_SpeedRef
Controller.Micro820.Micro820.VFD_Start
Controller.Micro820.Micro820.VFD_Stop
Controller.Micro820.Micro820.VFD_Write
1 Controller.Micro820.Micro820.__SYSVA_ABORT_CYCLE FALSE
1643 Controller.Micro820.Micro820.VFD_Messaging.VFD.UpdateRate_ms
1644 Controller.Micro820.Micro820.VFD_OutputCurrent
1645 Controller.Micro820.Micro820.VFD_OutputVoltage
1646 Controller.Micro820.Micro820.VFD_Read
1647 Controller.Micro820.Micro820.VFD_Ready
1648 Controller.Micro820.Micro820.VFD_Running
1649 Controller.Micro820.Micro820.VFD_SpeedFdbk
1650 Controller.Micro820.Micro820.VFD_SpeedRef
1651 Controller.Micro820.Micro820.VFD_Start
1652 Controller.Micro820.Micro820.VFD_Stop
1653 Controller.Micro820.Micro820.VFD_Write

View File

@@ -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>

View File

@@ -0,0 +1,60 @@
FUNCTION_BLOCK RA_PFx_ENET_PAR_READ
(*=====================================================================================================================================
[UDFB Name] :RA_PFx_ENET_PAR_READ (v6)
[Catagory] :Communication
[Description] :Read 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
IF UpdateRate_ms < 1000 THEN
ParReadCtrlCfg.TriggerType := 1000; (*Triggers message every 1000 ms while MSGParRead_EN is true*)
ELSE
ParReadCtrlCfg.TriggerType := ANY_TO_UDINT(UpdateRate_ms);
END_IF;
ParReadTargetCfg.Path := '4,'+ IPAddress;
ParReadTargetCfg.CipConnMode := 0; (*0-unconnected, 1-Class 3*)
ParReadTargetCfg.UcmmTimeout := 250; (*Unconnected message time out, Set to 0 means 3000ms, range 250-10000*)
ParReadTargetCfg.ConnMsgTimeout := 800; (*Class3 time out, Set to 0 means 3000ms, range 800-10000*)
ParReadTargetCfg.ConnClose := FALSE;(*Don't close the connection upon message completion*)
ParReadAppCfg.Service := 14; (*Service code 0Eh for Get Attribute Single*)
ParReadAppCfg.Class := 15; (*Class code 0Fh for Parameter Object*)
ParReadAppCfg.Attribute := 1; (*Attribute 1 for Parameter Value*)
CIPErrorStatus := NoErrorStatus;
END_IF;
(*-------- Main Routine --------*)
IF FBEN THEN
ParReadAppCfg.Instance := ANY_TO_UDINT(ParameterNumber);
MSGParRead_Q_RTRIG(MSGParRead.Q);
MSGParRead_Err_RTRIG(MSGParRead.Status.Error);
IF MSGParRead_Q_RTRIG.Q THEN
CIPErrorStatus := MSGParRead.Status;
ParameterValue := ANY_TO_UINT(SHL(ANY_TO_DINT(ParReadResData[2]),8)+ ANY_TO_DINT(ParReadResData[1]));
END_IF;
IF MSGParRead_Err_RTRIG.Q THEN
CIPErrorStatus := MSGParRead.Status;
ParameterValue := 0;
END_IF;
ELSE
ParameterValue := 0;
END_IF;
MSGParRead_EN := FBEN;
MSGParRead(MSGParRead_EN, ParReadCtrlCfg, ParReadAppCfg, ParReadTargetCfg,, 0, ParReadResData);
END_FUNCTION_BLOCK

View File

@@ -36,5 +36,7 @@
<ShapeStyle Type="ISaGRAF.Workbench.Mlge.LanguageContainer.LD.Shape.WbLDVariableAccessShape" Assembly="ISaGRAF.Workbench.Mlge.LanguageContainer.LD" Alpha="255" Background="#FFFFFFFF" BackgroundGradient="#FFFFFFFF" FontColor="windowtext" DisplayMode="NameAndAlias" Key="[0,18],[1,18],[1,19],[1,19]" />
<ShapeStyle Type="ISaGRAF.Workbench.Mlge.LanguageContainer.LD.Shape.WbLDVariableAccessShape" Assembly="ISaGRAF.Workbench.Mlge.LanguageContainer.LD" Alpha="255" Background="#FFFFFFFF" BackgroundGradient="#FFFFFFFF" FontColor="windowtext" DisplayMode="NameAndAlias" Key="[0,18],[1,18],[1,20],[1,20]" />
<ShapeStyle Type="ISaGRAF.Workbench.Mlge.LanguageContainer.LD.Shape.WbLdCoilShape" Assembly="ISaGRAF.Workbench.Mlge.LanguageContainer.LD" FontColor="windowtext" DisplayMode="NameAndAlias" Key="[0,18],[4,18]" />
<ShapeStyle Type="ISaGRAF.Workbench.Mlge.LanguageContainer.LD.Shape.WbLdRungShape" Assembly="ISaGRAF.Workbench.Mlge.LanguageContainer.LD" PowerRailColor="Silver" DisplayLabel="false" RungColor="WhiteSmoke" CommentColor="White" LabelColor="LightGoldenrodYellow" DisplayComment="true" Key="[0,22]" />
<ShapeStyle Type="ISaGRAF.Workbench.Mlge.LanguageContainer.LD.Shape.WbLdContactShape" Assembly="ISaGRAF.Workbench.Mlge.LanguageContainer.LD" FontColor="windowtext" DisplayMode="NameAndAlias" Key="[0,22],[1,22]" />
</LanguageContainerStyle>
</Root>

View File

@@ -13,6 +13,12 @@ EOR [5,0]
SOR [0,18] (**) (**) FB [1,0] (*>*) (*1*) ( (*EN:EN*)(**) (**) , (*i1:*)(*VFD_SpeedFdbk*) (**) , (*i2:*)(*0.0*) (**) ; (*o1:*)(**) (**) ) OTE [4,0] (*VFD_Running*) (**)
EOR [5,0]
(**)
SOR [0,22] (**) (**) XIC [1,0] (**) (**)
EOR [2,0]
EOF
#end_info
#info= ID_MAX

Binary file not shown.

View File

@@ -25,3 +25,22 @@ 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
Controller.Micro820.Micro820.VFD_Read
Controller.Micro820.Micro820.VFD_Write
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.FBEN
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.IPAddress
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.UpdateRate_ms
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParameterNumber
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.FBENO
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.CIPErrorStatus
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParameterValue
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.MSGParRead
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.MSGParRead_EN
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParReadCtrlCfg
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParReadAppCfg
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParReadTargetCfg
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.ParReadResData
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.FBEN_RTRIG
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.MSGParRead_Q_RTRIG
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.MSGParRead_Err_RTRIG
Controller.Micro820.Micro820.RA_PFx_ENET_PAR_READ.NoErrorStatus

Binary file not shown.

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectElements>
<AcfElementGuid Guid="150f03a9-89f5-4069-b29d-b64d9ee17aa8" />
<AcfElementGuid Guid="2e293809-2592-4360-9ef5-9e938bc7b980" />
<AcfElementGuid Guid="5c9551f1-c000-4c03-b505-8294f43771c9" />
<AcfElementGuid Guid="634a5889-7131-459b-82bb-32669f70ba62" />

View File

@@ -3,6 +3,9 @@
<AcfElementGuid Guid="150f03a9-89f5-4069-b29d-b64d9ee17aa8">
<File>RA_PFx_ENET_PAR_WRITE.AcfMlge</File>
</AcfElementGuid>
<AcfElementGuid Guid="278001ad-1041-4dee-adea-ceb4ed34e4f2">
<File>RA_PFx_ENET_PAR_READ.AcfMlge</File>
</AcfElementGuid>
<AcfElementGuid Guid="2e293809-2592-4360-9ef5-9e938bc7b980">
<File>Control.AcfMlge</File>
</AcfElementGuid>

Binary file not shown.

View File

@@ -1 +1 @@
PV_IPP_VFD;2711R-T4T;C:\Users\Patrick\Desktop\IntelligentPumpPanel_VFD\PVc Project
PV_IPP_VFD;2711R-T4T;C:\Users\Patrick\Documents\Henry_Pump\vfd_ipp\PVc Project

Binary file not shown.