<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="20.01" TargetName="T2UU" TargetType="AddOnInstructionDefinition" TargetRevision="1.0 " TargetLastEdited="2015-04-29T16:02:50.627Z" ContainsContext="true" Owner="Exlar, Exlar" ExportDate="Mon May 04 14:50:21 2015" ExportOptions="References DecoratedData Context Dependencies ForceProtectedEncoding AllProjDocTrans">
<Controller Use="Context" Name="Exlar_AOI_Sample_Project_v1_0">
<DataTypes Use="Context">
</DataTypes>
<AddOnInstructionDefinitions Use="Context">
<AddOnInstructionDefinition Use="Target" Name="T2UU" Revision="1.0" Vendor="Exlar Corporation" ExecutePrescan="false" ExecutePostscan="false" ExecuteEnableInFalse="false" CreatedDate="2014-04-17T17:34:17.109Z" CreatedBy="INT\jalvarez" EditedDate="2015-04-29T16:02:50.627Z" EditedBy="INT\jalvarez"
 SoftwareRevision="v20.01">
<AdditionalHelpText>
<![CDATA[Use the Tritex 2 User Units (T2UU) instruction to calculate user units. User units are easy-to-understand units of measurement that simplify your programming tasks. You define user units via parameters DistUUPerRev, VelTimeScale and CurrentScale.

Configured for Exlar EIP AOI. 07/01/2014

----------------------------------------------------------------------------------------------------------------------------
Parameters Bit Definition
----------------------------------------------------------------------------------------------------------------------------

VelTimeScale:  (Input) Select the units you want for velocity.
                         This will also effect acceleration           
------------------------------------------------------------------
     VelTimeScale = 0:     Seconds  (Velocity: Units/S,  Acceleration:  Units/S/S)
     VelTimeScale = 1:     Minutes    (Velocity: Units/M, Acceleration:  Units/S/M)


CurrentScale:  (Input) Select the units you want for Current      
------------------------------------------------------------------
     CurrentScale = 0:     AMPS 
     CurrentScale = 1:     % of Current Limit (Modbus ID 5108)
]]>
</AdditionalHelpText>
<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="DistUUPerRev" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Distance User Units Per Rev]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="VelTimeScale" TagType="Base" DataType="INT" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Velocity Scale]]>
</Description>
<DefaultData>00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="INT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="CurrentScale" TagType="Base" DataType="INT" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Current Scale]]>
</Description>
<DefaultData>00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="INT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Units" TagType="Base" DataType="REAL" Dimensions="4" Usage="InOut" Radix="Float" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Units Scale Results]]>
</Description>
<Comments>
<Comment Operand="[0]">
<![CDATA[T2UU Instruction Error Active]]>
</Comment>
<Comment Operand="[1]">
<![CDATA[Current Scale]]>
</Comment>
<Comment Operand="[2]">
<![CDATA[Velocity Scale]]>
</Comment>
<Comment Operand="[3]">
<![CDATA[User Units per Rev]]>
</Comment>
</Comments>
</Parameter>
<Parameter Name="ER" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[A Instruction error is Active]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
</Parameters>
<LocalTags/>
<Routines>
<Routine Name="Logic" Type="ST">
<STContent>
<Line Number="0">
<![CDATA[(***********************************************)]]>
</Line>
<Line Number="1">
<![CDATA[(*   Exlar Tritex 2 User Units                 *)]]>
</Line>
<Line Number="2">
<![CDATA[(*                                             *)]]>
</Line>
<Line Number="3">
<![CDATA[(***********************************************)]]>
</Line>
<Line Number="4">
<![CDATA[	]]>
</Line>
<Line Number="5">
<![CDATA[]]>
</Line>
<Line Number="6">
<![CDATA[]]>
</Line>
<Line Number="7">
<![CDATA[(* Check for Error *)]]>
</Line>
<Line Number="8">
<![CDATA[	if DistUUPerRev = 0 then]]>
</Line>
<Line Number="9">
<![CDATA[		ER := 1;]]>
</Line>
<Line Number="10">
<![CDATA[		Units[0] := 1;]]>
</Line>
<Line Number="11">
<![CDATA[	else]]>
</Line>
<Line Number="12">
<![CDATA[		ER := 0;]]>
</Line>
<Line Number="13">
<![CDATA[		Units[0] := 0;	]]>
</Line>
<Line Number="14">
<![CDATA[	End_if;]]>
</Line>
<Line Number="15">
<![CDATA[]]>
</Line>
<Line Number="16">
<![CDATA[(* Load Global Units       *)]]>
</Line>
<Line Number="17">
<![CDATA[	(* Current Scale       *)]]>
</Line>
<Line Number="18">
<![CDATA[	(*       0: AMPs       *)]]>
</Line>
<Line Number="19">
<![CDATA[	(*       1: % of Rated *)]]>
</Line>
<Line Number="20">
<![CDATA[   	Units[1] := CurrentScale AND 16#1;  ]]>
</Line>
<Line Number="21">
<![CDATA[]]>
</Line>
<Line Number="22">
<![CDATA[	(* Velocity Scale     *)]]>
</Line>
<Line Number="23">
<![CDATA[	(*       0: Seconds   *)]]>
</Line>
<Line Number="24">
<![CDATA[	(*       1: Minutes   *)]]>
</Line>
<Line Number="25">
<![CDATA[	(* Acceleration is base on Velocity Scaling *)]]>
</Line>
<Line Number="26">
<![CDATA[	(* If Velocity is seconds Acceleration are in Per Seconds*)]]>
</Line>
<Line Number="27">
<![CDATA[	Units[2] := VelTimeScale AND 16#1; ]]>
</Line>
<Line Number="28">
<![CDATA[]]>
</Line>
<Line Number="29">
<![CDATA[	(* Distance User Units per Rev *) ]]>
</Line>
<Line Number="30">
<![CDATA[	Units[3] := DistUUPerRev;]]>
</Line>
<Line Number="31">
<![CDATA[]]>
</Line>
</STContent>
</Routine>
</Routines>
</AddOnInstructionDefinition>
</AddOnInstructionDefinitions>
</Controller>
</RSLogix5000Content>
