<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="20.01" TargetName="T2JOG" TargetType="AddOnInstructionDefinition" TargetRevision="1.1 " TargetLastEdited="2015-04-29T16:03:08.798Z" ContainsContext="true" Owner="Exlar, Exlar" ExportDate="Mon May 04 14:49:58 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="T2JOG" Revision="1.1" Vendor="Exlar Corporation" ExecutePrescan="false" ExecutePostscan="false" ExecuteEnableInFalse="false" CreatedDate="2014-04-17T12:34:55.650Z" CreatedBy="INT\jalvarez" EditedDate="2015-04-29T16:03:08.798Z" EditedBy="INT\jalvarez"
 SoftwareRevision="v20.01">
<AdditionalHelpText>
<![CDATA[Use the Tritex 2 Jog (T2JOG) instruction to move an a drive at a constant speed until you tell it to stop.
Jog commands includes enabling Jog Positive or Negative.  The instruction allow user to select profile velocity and acceleration in user units.

Configured for Exlar EIP AOI. 07/01/2014

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

Direction:  (Input) Command Jog Direction      
------------------------------------------------------------------
     Direction.0:     Jog Plus
     Direction.1:     Jog Minus


Active:  (Output) Jog status information      
------------------------------------------------------------------
     Active.0:     Jog Plus active
     Active.1:     Jog Minus active
     Active.2:     Ready]]>
</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="ModuleInputs" TagType="Base" DataType="INT" Dimensions="101" Usage="InOut" Radix="Decimal" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Module Input Array]]>
</Description>
</Parameter>
<Parameter Name="ModuleOutputs" TagType="Base" DataType="INT" Dimensions="101" Usage="InOut" Radix="Decimal" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Module Outputs Array]]>
</Description>
</Parameter>
<Parameter Name="Units" TagType="Base" DataType="REAL" Dimensions="4" Usage="InOut" Radix="Float" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[User Units Configuration]]>
</Description>
</Parameter>
<Parameter Name="Direction" TagType="Base" DataType="INT" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Jog Control]]>
</Description>
<DefaultData>00 00</DefaultData>
<Comments>
<Comment Operand=".0">
<![CDATA[JOGP]]>
</Comment>
<Comment Operand=".1">
<![CDATA[JOGN]]>
</Comment>
</Comments>
<DefaultData Format="Decorated">
<DataValue DataType="INT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Velocity" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Speed to move the drive in Speed Units.]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Acceleration" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Acceleration rate of the drive in Accel Units.]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="DF" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[A Drive Fault is active]]>
</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[A Instruction error is Active]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Active" TagType="Base" DataType="INT" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Jog Active States]]>
</Description>
<DefaultData>00 00</DefaultData>
<Comments>
<Comment Operand=".0">
<![CDATA[JOGP]]>
</Comment>
<Comment Operand=".1">
<![CDATA[JOGN]]>
</Comment>
<Comment Operand=".2">
<![CDATA[STOPPED]]>
</Comment>
<Comment Operand=".3">
<![CDATA[READY]]>
</Comment>
</Comments>
<DefaultData Format="Decorated">
<DataValue DataType="INT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
</Parameters>
<LocalTags>
<LocalTag Name="dintResults" DataType="DINT" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="realResults" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
</LocalTags>
<Routines>
<Routine Name="Logic" Type="ST">
<STContent>
<Line Number="0">
<![CDATA[(***********************************************)]]>
</Line>
<Line Number="1">
<![CDATA[(*   Exlar Tritex 2 Jog                        *)]]>
</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[(*********** INPUTS ***********)]]>
</Line>
<Line Number="8">
<![CDATA[]]>
</Line>
<Line Number="9">
<![CDATA[(* Direction *)]]>
</Line>
<Line Number="10">
<![CDATA[	(* 4317.4 Jog Positive *)]]>
</Line>
<Line Number="11">
<![CDATA[	If Direction.0 Then]]>
</Line>
<Line Number="12">
<![CDATA[		ModuleOutputs[3].4 := 1;]]>
</Line>
<Line Number="13">
<![CDATA[	else]]>
</Line>
<Line Number="14">
<![CDATA[		ModuleOutputs[3].4 := 0;]]>
</Line>
<Line Number="15">
<![CDATA[	end_if;]]>
</Line>
<Line Number="16">
<![CDATA[]]>
</Line>
<Line Number="17">
<![CDATA[	(* 4317.5 Jog Minus *)]]>
</Line>
<Line Number="18">
<![CDATA[	If Direction.1 Then]]>
</Line>
<Line Number="19">
<![CDATA[		ModuleOutputs[3].5 := 1;]]>
</Line>
<Line Number="20">
<![CDATA[	else]]>
</Line>
<Line Number="21">
<![CDATA[		ModuleOutputs[3].5 := 0;]]>
</Line>
<Line Number="22">
<![CDATA[	end_if;]]>
</Line>
<Line Number="23">
<![CDATA[]]>
</Line>
<Line Number="24">
<![CDATA[(*********** OUTPUTS  ***********)]]>
</Line>
<Line Number="25">
<![CDATA[]]>
</Line>
<Line Number="26">
<![CDATA[(* Drive Faults Active *)]]>
</Line>
<Line Number="27">
<![CDATA[	(* 104.03 Fault *)]]>
</Line>
<Line Number="28">
<![CDATA[	If ModuleInputs[1].03 then]]>
</Line>
<Line Number="29">
<![CDATA[ 		DF := 1;]]>
</Line>
<Line Number="30">
<![CDATA[	Else]]>
</Line>
<Line Number="31">
<![CDATA[		DF := 0;]]>
</Line>
<Line Number="32">
<![CDATA[	End_If;]]>
</Line>
<Line Number="33">
<![CDATA[]]>
</Line>
<Line Number="34">
<![CDATA[(* Active States  *)]]>
</Line>
<Line Number="35">
<![CDATA[	(* 105.3 JOG Positive *)]]>
</Line>
<Line Number="36">
<![CDATA[	If ModuleInputs[3].3 Then]]>
</Line>
<Line Number="37">
<![CDATA[		Active.0 := 1;]]>
</Line>
<Line Number="38">
<![CDATA[	else]]>
</Line>
<Line Number="39">
<![CDATA[		Active.0 := 0;]]>
</Line>
<Line Number="40">
<![CDATA[	end_if;]]>
</Line>
<Line Number="41">
<![CDATA[]]>
</Line>
<Line Number="42">
<![CDATA[	(* 105.4 JOG Minus *)]]>
</Line>
<Line Number="43">
<![CDATA[	If ModuleInputs[3].4 Then]]>
</Line>
<Line Number="44">
<![CDATA[		Active.1 := 1;]]>
</Line>
<Line Number="45">
<![CDATA[	else]]>
</Line>
<Line Number="46">
<![CDATA[		Active.1 := 0;]]>
</Line>
<Line Number="47">
<![CDATA[	end_if;]]>
</Line>
<Line Number="48">
<![CDATA[]]>
</Line>
<Line Number="49">
<![CDATA[]]>
</Line>
<Line Number="50">
<![CDATA[	(* 105.0 STOPPED *)]]>
</Line>
<Line Number="51">
<![CDATA[	If ModuleInputs[3].0 Then]]>
</Line>
<Line Number="52">
<![CDATA[		Active.2 := 1;]]>
</Line>
<Line Number="53">
<![CDATA[	else]]>
</Line>
<Line Number="54">
<![CDATA[		Active.2 := 0;]]>
</Line>
<Line Number="55">
<![CDATA[	end_if;]]>
</Line>
<Line Number="56">
<![CDATA[]]>
</Line>
<Line Number="57">
<![CDATA[	(* 104.2 Ready *)]]>
</Line>
<Line Number="58">
<![CDATA[	If ModuleInputs[1].2 Then]]>
</Line>
<Line Number="59">
<![CDATA[		Active.3 := 1;]]>
</Line>
<Line Number="60">
<![CDATA[	else]]>
</Line>
<Line Number="61">
<![CDATA[		Active.3 := 0;]]>
</Line>
<Line Number="62">
<![CDATA[	end_if;]]>
</Line>
<Line Number="63">
<![CDATA[]]>
</Line>
<Line Number="64">
<![CDATA[]]>
</Line>
<Line Number="65">
<![CDATA[(* Convert Units *)	]]>
</Line>
<Line Number="66">
<![CDATA[	IF Units[0] > 0 THEN]]>
</Line>
<Line Number="67">
<![CDATA[		ER	:= 1;]]>
</Line>
<Line Number="68">
<![CDATA[	else]]>
</Line>
<Line Number="69">
<![CDATA[		ER  := 0;]]>
</Line>
<Line Number="70">
<![CDATA[]]>
</Line>
<Line Number="71">
<![CDATA[		(* Velocity in Seconds ? *)]]>
</Line>
<Line Number="72">
<![CDATA[		if Units[2] = 0 then 	]]>
</Line>
<Line Number="73">
<![CDATA[			(* Jog.SlowVelovity : ModuleOutputs[14],ModuleOutputs[13] *)]]>
</Line>
<Line Number="74">
<![CDATA[			ModuleOutputs[14] := (Velocity / Units[3]) *255;]]>
</Line>
<Line Number="75">
<![CDATA[]]>
</Line>
<Line Number="76">
<![CDATA[			(* Jog.Acceleration: ModuleOutputs[16],ModuleOutputs[15] *)]]>
</Line>
<Line Number="77">
<![CDATA[			dintResults := ((Acceleration / Units[3]) * 16#100000);]]>
</Line>
<Line Number="78">
<![CDATA[			cps(dintResults, ModuleOutputs[15],2);]]>
</Line>
<Line Number="79">
<![CDATA[		else]]>
</Line>
<Line Number="80">
<![CDATA[			(* Velocity in Minutes ? *)]]>
</Line>
<Line Number="81">
<![CDATA[			if Units[2] = 1 then]]>
</Line>
<Line Number="82">
<![CDATA[				(* Jog.SlowVelovity: ModuleOutputs[14],ModuleOutputs[13] *)]]>
</Line>
<Line Number="83">
<![CDATA[				ModuleOutputs[14] := ((Velocity / Units[3])/60)*255;]]>
</Line>
<Line Number="84">
<![CDATA[]]>
</Line>
<Line Number="85">
<![CDATA[				(* Jog.Acceleration: ModuleOutputs[16],ModuleOutputs[15]  *)]]>
</Line>
<Line Number="86">
<![CDATA[				dintResults := ((Acceleration / Units[3]) * 16#100000)/60;]]>
</Line>
<Line Number="87">
<![CDATA[				cps(dintResults, ModuleOutputs[15],2);]]>
</Line>
<Line Number="88">
<![CDATA[			end_if;]]>
</Line>
<Line Number="89">
<![CDATA[		end_if;]]>
</Line>
<Line Number="90">
<![CDATA[]]>
</Line>
<Line Number="91">
<![CDATA[		(* Set Velocity lower word to zero *)]]>
</Line>
<Line Number="92">
<![CDATA[		(* Jog.SlowVelocity[Low]:  ModuleOutputs[13] *)]]>
</Line>
<Line Number="93">
<![CDATA[		ModuleOutputs[13]  :=0;	]]>
</Line>
<Line Number="94">
<![CDATA[	end_if;]]>
</Line>
</STContent>
</Routine>
</Routines>
</AddOnInstructionDefinition>
</AddOnInstructionDefinitions>
</Controller>
</RSLogix5000Content>
