<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--Set 8 byte Drive Parameter-->
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="19.01" TargetName="AKD_Set_Parameter_LINT" TargetType="AddOnInstructionDefinition" TargetRevision="0.0 " TargetLastEdited="2014-12-05T13:11:46.953Z" ContainsContext="true" Owner="Danaher Associate, Danaher Motion" ExportDate="Fri Dec 05 10:55:09 2014" ExportOptions="References DecoratedData Context Dependencies ForceProtectedEncoding AllProjDocTrans">
<Controller Use="Context" Name="Example_PLC">
<DataTypes Use="Context">
<DataType Name="AKD_Status" Family="NoFamily" Class="User">
<Description>
<![CDATA[All connections to the drive ethernet module are established and data is successfully transferring.]]>
</Description>
<Members>
<Member Name="ZZZZZZZZZZAKD_Status0" DataType="SINT" Dimension="0" Radix="Decimal" Hidden="true" ExternalAccess="Read/Write"/>
<Member Name="Profile_In_Progress" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="0" ExternalAccess="Read/Write">
<Description>
<![CDATA[Profile Move In Progress]]>
</Description>
</Member>
<Member Name="Block_In_Execution" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="1" ExternalAccess="Read/Write">
<Description>
<![CDATA[Block In Execution]]>
</Description>
</Member>
<Member Name="On_Target_Position" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="2" ExternalAccess="Read/Write">
<Description>
<![CDATA[On Target Position (1=Current Position Equals Last Target Position)]]>
</Description>
</Member>
<Member Name="General_Fault" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="3" ExternalAccess="Read/Write">
<Description>
<![CDATA[General Fault]]>
</Description>
</Member>
<Member Name="Current_Direction" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="4" ExternalAccess="Read/Write">
<Description>
<![CDATA[Current Motor Direction (0=Reverse, 1=Forward)]]>
</Description>
</Member>
<Member Name="Home_Level" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="5" ExternalAccess="Read/Write">
<Description>
<![CDATA[Level of Home Input]]>
</Description>
</Member>
<Member Name="Reg_Level" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="6" ExternalAccess="Read/Write">
<Description>
<![CDATA[Level of Registration Input]]>
</Description>
</Member>
<Member Name="Enable" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status0" BitNumber="7" ExternalAccess="Read/Write">
<Description>
<![CDATA[State of Enable Output]]>
</Description>
</Member>
<Member Name="ZZZZZZZZZZAKD_Status9" DataType="SINT" Dimension="0" Radix="Decimal" Hidden="true" ExternalAccess="Read/Write"/>
<Member Name="Fault_Input_Fault" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="0" ExternalAccess="Read/Write">
<Description>
<![CDATA[Fault Input Active]]>
</Description>
</Member>
<Member Name="Fwd_Limit" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="1" ExternalAccess="Read/Write">
<Description>
<![CDATA[Forward Input Active]]>
</Description>
</Member>
<Member Name="Rev_Limit" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="2" ExternalAccess="Read/Write">
<Description>
<![CDATA[Reverse Input Active]]>
</Description>
</Member>
<Member Name="Positive_Limit" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="3" ExternalAccess="Read/Write">
<Description>
<![CDATA[Positive Software Limit Exceeded]]>
</Description>
</Member>
<Member Name="Negative_Limit" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="4" ExternalAccess="Read/Write">
<Description>
<![CDATA[Negative Software Limit Exceeded]]>
</Description>
</Member>
<Member Name="FE_Fault" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="5" ExternalAccess="Read/Write">
<Description>
<![CDATA[Following Error Fault]]>
</Description>
</Member>
<Member Name="Block_Fault" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="6" ExternalAccess="Read/Write">
<Description>
<![CDATA[Block Execution Fault]]>
</Description>
</Member>
<Member Name="Load_Complete" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Status9" BitNumber="7" ExternalAccess="Read/Write">
<Description>
<![CDATA[Command Message Successfully Loaded]]>
</Description>
</Member>
</Members>
</DataType>
<DataType Name="AKD_Control" Family="NoFamily" Class="User">
<Description>
<![CDATA[Send Explicit Message]]>
</Description>
<Members>
<Member Name="ZZZZZZZZZZAKD_Contro0" DataType="SINT" Dimension="0" Radix="Decimal" Hidden="true" ExternalAccess="Read/Write"/>
<Member Name="Load_Data_Start_Profile" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="0" ExternalAccess="Read/Write">
<Description>
<![CDATA[Load Command Data / 
Start Profile Move]]>
</Description>
</Member>
<Member Name="Start_Block" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="1" ExternalAccess="Read/Write">
<Description>
<![CDATA[Execute Command block or block chain]]>
</Description>
</Member>
<Member Name="Incremental" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="2" ExternalAccess="Read/Write">
<Description>
<![CDATA[Incremental Position (0=Absolute, 1=Incremental)]]>
</Description>
</Member>
<Member Name="Direction" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="3" ExternalAccess="Read/Write">
<Description>
<![CDATA[Direction in Velocity Mode (0=Reverse, 1=Forward)]]>
</Description>
</Member>
<Member Name="Smooth_Stop" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="4" ExternalAccess="Read/Write">
<Description>
<![CDATA[Smooth / Controlled Stop w/ Deceleration]]>
</Description>
</Member>
<Member Name="Hard_Stop" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="5" ExternalAccess="Read/Write">
<Description>
<![CDATA[Hard / Immediate Stop]]>
</Description>
</Member>
<Member Name="Reg_Arm" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="6" ExternalAccess="Read/Write">
<Description>
<![CDATA[Arm the Registration Input]]>
</Description>
</Member>
<Member Name="Enable" DataType="BIT" Dimension="0" Radix="Decimal" Hidden="false" Target="ZZZZZZZZZZAKD_Contro0" BitNumber="7" ExternalAccess="Read/Write">
<Description>
<![CDATA[Enable Output]]>
</Description>
</Member>
</Members>
</DataType>
<DataType Name="AKD_Axis" Family="NoFamily" Class="User">
<Description>
<![CDATA[Axis Data:
]]>
</Description>
<Members>
<Member Name="Control" DataType="AKD_Control" Dimension="0" Radix="NullType" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Control bits to send to the drive]]>
</Description>
</Member>
<Member Name="Status" DataType="AKD_Status" Dimension="0" Radix="NullType" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Status bits received from the drive]]>
</Description>
</Member>
<Member Name="Input" DataType="AB:ETHERNET_MODULE_SINT_64Bytes:I:0" Dimension="0" Radix="NullType" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Data from the drive]]>
</Description>
</Member>
<Member Name="Output" DataType="AB:ETHERNET_MODULE_SINT_64Bytes:O:0" Dimension="0" Radix="NullType" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Data to the drive]]>
</Description>
</Member>
<Member Name="ResponseMsgType" DataType="SINT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Response type contained in latest IO response from drive. Used to check for errors]]>
</Description>
</Member>
<Member Name="CommandTimeout" DataType="INT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Time to allow for command response from drive. Dependent on scan rate and communicaiton rate]]>
</Description>
</Member>
<Member Name="PositionFeedback" DataType="DINT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Actual Position Value]]>
</Description>
</Member>
<Member Name="VelocityFeedback" DataType="DINT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write">
<Description>
<![CDATA[Actual Velocity Value]]>
</Description>
</Member>
</Members>
<Dependencies>
<Dependency Type="DataType" Name="AKD_Control"/>
<Dependency Type="DataType" Name="AKD_Status"/>
</Dependencies>
</DataType>
</DataTypes>
<AddOnInstructionDefinitions Use="Context">
<AddOnInstructionDefinition Use="Target" Name="AKD_Set_Parameter_LINT" Revision="0.0" ExecutePrescan="true" ExecutePostscan="false" ExecuteEnableInFalse="true" CreatedDate="2011-02-23T21:41:33.886Z" CreatedBy="DMC-678852CBE2A\Administrator" EditedDate="2014-12-05T13:11:46.953Z" EditedBy="DHRMOTION\radprod075" SoftwareRevision="v19.01"
>
<Description>
<![CDATA[Set 8 byte Drive Parameter]]>
</Description>
<Parameters>
<Parameter Name="EnableIn" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Input - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="EnableOut" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Output - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="DN" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Command Successful]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="ER" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Error]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Axis" TagType="Base" DataType="AKD_Axis" Usage="InOut" Required="true" Visible="true" Constant="false"/>
<Parameter Name="Parameter_Number" TagType="Base" DataType="INT" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[See help (F1) for parameter list.]]>
</Description>
<DefaultData>00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="INT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Parameter_Value_LSB" TagType="Base" DataType="DINT" Usage="Input" Radix="Decimal" Required="true" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Parameter Value]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Parameter_Value_MSB" TagType="Base" DataType="DINT" Usage="Input" Radix="Decimal" Required="true" Visible="true" ExternalAccess="Read/Write">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
</Parameters>
<LocalTags>
<LocalTag Name="Command_Timeout" DataType="TIMER" ExternalAccess="Read/Write">
<Description>
<![CDATA[Timeout Timer]]>
</Description>
<DefaultData>00 00 00 00 10 27 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Structure DataType="TIMER">
<DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="10000"/>
<DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="TT" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
</Structure>
</DefaultData>
</LocalTag>
<LocalTag Name="Command_Message_Type" DataType="SINT" Radix="Decimal" ExternalAccess="Read/Write">
<Description>
<![CDATA[Command Message Type]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="SINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Command_Axis_Number" DataType="SINT" Radix="Decimal" ExternalAccess="Read/Write">
<Description>
<![CDATA[Command Axis Number]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="SINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Step" DataType="SINT" Radix="Decimal" ExternalAccess="Read/Write">
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="SINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Command_Bytes" DataType="SINT" Dimensions="8" Radix="Decimal" ExternalAccess="Read/Write">
<DefaultData>00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Array DataType="SINT" Dimensions="8" Radix="Decimal">
<Element Index="[0]" Value="0"/>
<Element Index="[1]" Value="0"/>
<Element Index="[2]" Value="0"/>
<Element Index="[3]" Value="0"/>
<Element Index="[4]" Value="0"/>
<Element Index="[5]" Value="0"/>
<Element Index="[6]" Value="0"/>
<Element Index="[7]" Value="0"/>
</Array>
</DefaultData>
</LocalTag>
<LocalTag Name="OS_LoadStart" DataType="BOOL" Radix="Decimal" ExternalAccess="Read/Write">
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Temp_Bytes" DataType="SINT" Dimensions="2" Radix="Decimal" ExternalAccess="Read/Write">
<Description>
<![CDATA[Temporary Bytes to Split into Command Bytes]]>
</Description>
<DefaultData>00 00</DefaultData>
<DefaultData Format="Decorated">
<Array DataType="SINT" Dimensions="2" Radix="Decimal">
<Element Index="[0]" Value="0"/>
<Element Index="[1]" Value="0"/>
</Array>
</DefaultData>
</LocalTag>
</LocalTags>
<Routines>
<Routine Name="EnableInFalse" Type="RLL">
<Description>
<![CDATA[EnableIn_False]]>
</Description>
<RLLContent>
<Rung Number="0" Type="N">
<Comment>
<![CDATA[Initialize Instruction Variables when Not Executing]]>
</Comment>
<Text>
<![CDATA[OTU(OS_LoadStart)RES(Command_Timeout)FLL(0,Command_Bytes[0],8);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
<Routine Name="Logic" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Comment>
<![CDATA[Initialize data values]]>
</Comment>
<Text>
<![CDATA[XIC(EnableIn)ONS(OS_LoadStart)[MOV(0,Step) ,OTU(DN) ,OTU(ER) ];]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Comment>
<![CDATA[Write Command Message Type (bits 0-4) to Byte 2.
Command Message Type 1F hex Position Controller Parameter]]>
</Comment>
<Text>
<![CDATA[MOV(16#1F,Command_Message_Type)MOV(Command_Message_Type,Command_Bytes[2]);]]>
</Text>
</Rung>
<Rung Number="2" Type="N">
<Comment>
<![CDATA[Write Command Axis Number (bits 5-7) to Byte 2 by copying the 3 Low Bits to the 3 High Bits.

TODO:  Add axis ID number to the AKD_Axis data type to be supplied dynamically here.]]>
</Comment>
<Text>
<![CDATA[MOV(1,Command_Axis_Number);]]>
</Text>
</Rung>
<Rung Number="3" Type="N">
<Text>
<![CDATA[XIC(Command_Axis_Number.2)OTE(Command_Bytes[2].7);]]>
</Text>
</Rung>
<Rung Number="4" Type="N">
<Text>
<![CDATA[XIC(Command_Axis_Number.1)OTE(Command_Bytes[2].6);]]>
</Text>
</Rung>
<Rung Number="5" Type="N">
<Text>
<![CDATA[XIC(Command_Axis_Number.0)OTE(Command_Bytes[2].5);]]>
</Text>
</Rung>
<Rung Number="6" Type="N">
<Comment>
<![CDATA[Write Parameter Instance Number to Command Bytes 4-5]]>
</Comment>
<Text>
<![CDATA[COP(Parameter_Number,Command_Bytes[4],2);]]>
</Text>
</Rung>
<Rung Number="7" Type="N">
<Comment>
<![CDATA[Write Get/Set Parameter Flag to byte 6
Get parameter = 0
Set parameter = 1]]>
</Comment>
<Text>
<![CDATA[MOV(1,Command_Bytes[6]);]]>
</Text>
</Rung>
<Rung Number="8" Type="N">
<Comment>
<![CDATA[Write Parameter Value to bytes 24-27]]>
</Comment>
<Text>
<![CDATA[COP(Parameter_Value_LSB,Axis.Output.Data[24],4);]]>
</Text>
</Rung>
<Rung Number="9" Type="N">
<Comment>
<![CDATA[Write Parameter Value to bytes 28-31]]>
</Comment>
<Text>
<![CDATA[COP(Parameter_Value_MSB,Axis.Output.Data[28],4);]]>
</Text>
</Rung>
<Rung Number="10" Type="N">
<Comment>
<![CDATA[


******************** Send command and do handshake *****************


Clear handshake on Load/Start b]]>
</Comment>
<Text>
<![CDATA[XIC(Axis.Status.Load_Complete)OTU(Axis.Control.Load_Data_Start_Profile);]]>
</Text>
</Rung>
<Rung Number="11" Type="N">
<Comment>
<![CDATA[Set handshake on load/start once LoadComplete has cleared (ready for new command)]]>
</Comment>
<Text>
<![CDATA[EQU(Step,0)XIO(Axis.Status.Load_Complete)OTL(Axis.Control.Load_Data_Start_Profile)MOV(1,Step);]]>
</Text>
</Rung>
<Rung Number="12" Type="N">
<Comment>
<![CDATA[Check for an error response]]>
</Comment>
<Text>
<![CDATA[EQU(Step,1)EQU(Axis.ResponseMsgType,16#14)OTL(ER)MOV(-1,Step);]]>
</Text>
</Rung>
<Rung Number="13" Type="N">
<Comment>
<![CDATA[Verify that the command successfully executes in a timely fashion.]]>
</Comment>
<Text>
<![CDATA[EQU(Step,1)TON(Command_Timeout,?,?)XIC(Command_Timeout.DN)OTL(ER)MOV(-2,Step);]]>
</Text>
</Rung>
<Rung Number="14" Type="N">
<Comment>
<![CDATA[DN bit signifies that the command completed successfully]]>
</Comment>
<Text>
<![CDATA[EQU(Step,1)XIC(Axis.Status.Load_Complete)OTL(DN)MOV(2,Step);]]>
</Text>
</Rung>
<Rung Number="15" Type="N">
<Text>
<![CDATA[XIC(ER)OTU(Axis.Control.Load_Data_Start_Profile);]]>
</Text>
</Rung>
<Rung Number="16" Type="N">
<Text>
<![CDATA[COP(Axis.Control,Command_Bytes[0],1)COP(Command_Bytes[0],Axis.Output.Data[0],8);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
<Routine Name="Prescan" Type="RLL">
<Description>
<![CDATA[Prescan]]>
</Description>
<RLLContent>
<Rung Number="0" Type="N">
<Comment>
<![CDATA[Initialize Instruction Variables Before 1st Scan]]>
</Comment>
<Text>
<![CDATA[OTU(OS_LoadStart)RES(Command_Timeout)MOV(10000,Command_Timeout.PRE)FLL(0,Command_Bytes[0],8);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
</Routines>
<Dependencies>
<Dependency Type="DataType" Name="AKD_Axis"/>
</Dependencies>
</AddOnInstructionDefinition>
</AddOnInstructionDefinitions>
</Controller>
</RSLogix5000Content>
