<?xml version="1.0"?>
<SaveFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <terminalText />
  <logText>10/16/2020 3:32:04 PM - COMs updated: COM7, COM1, COM22, COM23, COM24
2022-11-07 3:38:47 PM - COMs updated: COM1, COM4, COM3
2023-01-31 11:29:53 AM - COMs updated: COM4, COM3, COM1, COM41
2023-04-18 4:49:16 PM - COMs updated: COM1, COM3, COM4, COM41
</logText>
  <chartXML>&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;Chart Size="861, 458"&gt;
  &lt;Series&gt;
    &lt;Series Name="Series1" Legend="Legend1" ChartType="FastLine" ChartArea="ChartArea1" BorderWidth="3"&gt;
    &lt;/Series&gt;
  &lt;/Series&gt;
  &lt;Legends&gt;
    &lt;Legend Name="Legend1"&gt;
    &lt;/Legend&gt;
  &lt;/Legends&gt;
  &lt;ChartAreas&gt;
    &lt;ChartArea Name="ChartArea1"&gt;
      &lt;AxisX Minimum="0"&gt;
      &lt;/AxisX&gt;
    &lt;/ChartArea&gt;
  &lt;/ChartAreas&gt;
&lt;/Chart&gt;</chartXML>
  <layout>&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;Layout&gt;
  &lt;Window Guid="b7dab090-611a-4aad-b930-6ae67af71076" LastFocused="133263246769659809" DockedSize="200" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="710, 710" LastOpenDockSituation="Document" LastFixedDockSituation="Document" LastFixedDockLocation="Right" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="0" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="00000000-0000-0000-0000-000000000000" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="7dcab757-5096-41cc-bd21-d869c80636f0" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="d6521b1f-a345-489c-a2eb-ab3414c03c3f" LastFocused="0" DockedSize="200" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="250, 400" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Right" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="0" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="00000000-0000-0000-0000-000000000000" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="63e56aaf-9271-4ff5-a9f2-c24a31238a83" LastFocused="130946021926247376" DockedSize="200" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="650, 650" LastOpenDockSituation="Document" LastFixedDockSituation="Document" LastFixedDockLocation="Right" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="0" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="00000000-0000-0000-0000-000000000000" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="7dcab757-5096-41cc-bd21-d869c80636f0" DocumentIndexInWindowGroup="1" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="c77763eb-c60b-4692-88c0-c6e30b85971a" LastFocused="0" DockedSize="200" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="1100, 900" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Right" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="0" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="00000000-0000-0000-0000-000000000000" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="357a77b0-310c-484a-9725-45849bd1dd26" LastFocused="0" DockedSize="400" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="400, 400" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Right" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="1" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="c9a21ffa-752e-43f0-ab93-7149a8a8a239" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="f361d7e5-9b8f-4e8b-aac6-7eae1033be2a" LastFocused="133263246759535987" DockedSize="350" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="250, 400" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Left" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="1" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="83cb4763-575d-4624-b32b-f094afc53ff1" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="4627d912-6a4f-4e29-9039-384cf1db09b2" LastFocused="0" DockedSize="100" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="250, 400" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Bottom" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="1" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="102874cf-de1f-4370-b07e-781cb466d13f" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Window Guid="d04397c4-82bb-4a20-833c-86b1b3cdcc02" LastFocused="0" DockedSize="100" PopupSize="0" FloatingLocation="-1, -1" FloatingSize="250, 400" LastOpenDockSituation="Docked" LastFixedDockSituation="Docked" LastFixedDockLocation="Bottom" LastFloatingWindowGuid="00000000-0000-0000-0000-000000000000" LastDockContainerCount="1" LastDockContainerIndex="0" DockedWorkingSize="250, 400" DockedWindowGroupGuid="9e0bceee-4c43-4367-8751-ea0f97244b85" DockedIndexInWindowGroup="0" DockedSplitPath="0" DocumentWorkingSize="250, 400" DocumentWindowGroupGuid="00000000-0000-0000-0000-000000000000" DocumentIndexInWindowGroup="0" DocumentSplitPath="0" FloatingWorkingSize="250, 400" FloatingWindowGroupGuid="00000000-0000-0000-0000-000000000000" FloatingIndexInWindowGroup="0" FloatingSplitPath="0" /&gt;
  &lt;Container Dock="2" ContentSize="100"&gt;
    &lt;SplitLayoutSystem WorkingSize="250, 400" SplitMode="1"&gt;
      &lt;ControlLayoutSystem WorkingSize="250, 400" Guid="9e0bceee-4c43-4367-8751-ea0f97244b85" Collapsed="1" SelectedControl="d04397c4-82bb-4a20-833c-86b1b3cdcc02"&gt;
        &lt;Controls&gt;
          &lt;Control Guid="d04397c4-82bb-4a20-833c-86b1b3cdcc02" /&gt;
        &lt;/Controls&gt;
      &lt;/ControlLayoutSystem&gt;
    &lt;/SplitLayoutSystem&gt;
  &lt;/Container&gt;
  &lt;Container Dock="4" ContentSize="400"&gt;
    &lt;SplitLayoutSystem WorkingSize="250, 400" SplitMode="0"&gt;
      &lt;ControlLayoutSystem WorkingSize="250, 400" Guid="c9a21ffa-752e-43f0-ab93-7149a8a8a239" Collapsed="0" SelectedControl="357a77b0-310c-484a-9725-45849bd1dd26"&gt;
        &lt;Controls&gt;
          &lt;Control Guid="357a77b0-310c-484a-9725-45849bd1dd26" /&gt;
        &lt;/Controls&gt;
      &lt;/ControlLayoutSystem&gt;
    &lt;/SplitLayoutSystem&gt;
  &lt;/Container&gt;
  &lt;Container Dock="3" ContentSize="350"&gt;
    &lt;SplitLayoutSystem WorkingSize="250, 400" SplitMode="0"&gt;
      &lt;ControlLayoutSystem WorkingSize="250, 400" Guid="83cb4763-575d-4624-b32b-f094afc53ff1" Collapsed="0" SelectedControl="f361d7e5-9b8f-4e8b-aac6-7eae1033be2a"&gt;
        &lt;Controls&gt;
          &lt;Control Guid="f361d7e5-9b8f-4e8b-aac6-7eae1033be2a" /&gt;
        &lt;/Controls&gt;
      &lt;/ControlLayoutSystem&gt;
    &lt;/SplitLayoutSystem&gt;
  &lt;/Container&gt;
  &lt;DocumentContainer Dock="5"&gt;
    &lt;SplitLayoutSystem WorkingSize="250, 400" SplitMode="0"&gt;
      &lt;ControlLayoutSystem WorkingSize="250, 400" Guid="7dcab757-5096-41cc-bd21-d869c80636f0" Collapsed="0" SelectedControl="b7dab090-611a-4aad-b930-6ae67af71076"&gt;
        &lt;Controls&gt;
          &lt;Control Guid="b7dab090-611a-4aad-b930-6ae67af71076" /&gt;
          &lt;Control Guid="63e56aaf-9271-4ff5-a9f2-c24a31238a83" /&gt;
        &lt;/Controls&gt;
      &lt;/ControlLayoutSystem&gt;
    &lt;/SplitLayoutSystem&gt;
  &lt;/DocumentContainer&gt;
&lt;/Layout&gt;</layout>
  <cmlObjects>
    <codeObject>
      <title>Point-to-Point Program (Compiled)</title>
      <code>P2.1=1
P3.1=2
P4.1=3
P5.1=4
P6.1=5
K62.1=1
K61.1=1
K79.1=0
K23.1=0
K70.1=0
K85.1=3
V1.1=0
P1.1=0
S1.1=0
A1.1=0
V0.1=0
P0.1=0
S0.1=0
A0.1=0
L1.1
V0.1!=V1.1,CL2.1,T0.1
P0.1!=P1.1,CL3.1,T0.1
A0.1!=A1.1,CL4.1,T0.1
S0.1!=S1.1,CL5.1,T0.1
END.1
L2.1
V1.1=V0.1;
V1.1==P2.1,^.1,T0.1
V1.1==P3.1,].1,T0.1
V1.1==P4.1,(.1,T0.1
V1.1==P5.1,).1,T0.1
V1.1==P6.1,|.1,T0.1
END.1
L3.1
P1.1=P0.1;
V0.1==P2.1,^.1,T0.1
END.1
L4.1
A1.1=A0.1;
A0.1=A0.1;
END.1
L5.1
S1.1=S0.1;
S0.1=S0.1;
END.1
$.1
K81=1
</code>
      <guid>63e56aaf-9271-4ff5-a9f2-c24a31238a83</guid>
      <linkedGuid>00000000-0000-0000-0000-000000000000</linkedGuid>
      <CMtype>-1</CMtype>
    </codeObject>
  </cmlObjects>
  <cmpObjects>
    <codeObject>
      <title>Point-to-Point Program</title>
      <code>

//set the logic scan rate to 1ms
K63.1=1
//set logic bank 1 to scan on power up
K62.1=1
//set the modbus register offset to 0
K78.1=0

//switch off all automatic motor event reporting
K23.1=0
//make sure carraige return is not automatic after line feed (legacy setting)
K70.1=0
//set all 32bit data to little endian
K85.1=3



/*create variables for the old/previous target
control word
position
speed
acceleration
These are used to find a change in the target
Init them to 0
*/
var old_ControlWord V1.1				//old control word
V1.1=0
var old_TargetPos P1.1		//old position
P1.1=0
var old_TargetSpd S1.1		//old speed
S1.1=0
var old_TargetAcc A1.1		//old acceleration
A1.1=0


/*create variables for the new target
control word
position
speed
acceleration
These are used to find a change in the target
Init them to 0
*/
var ControlWord V0.1				//control word
V0.1=0
var TargetPos P0.1		//position
P0.1=0
var TargetSpd S0.1		//speed
S0.1=0
var TargetAcc A0.1		//acceleration
A0.1=0 


/*
Logic L1 scans for a change in the word or any target value
if a change is detected it call the relevant logic bank
*/
L1.1
ControlWord!= old_ControlWord, CL2.1, T0.1	//scan control word
TargetPos!= old_TargetPos, CL3.1, T0.1		//scan position
TargetAcc!= old_TargetAcc, CL4.1, T0.1		//scan acceleration
TargetSpd!= old_TargetSpd, CL5.1, T0.1		//scan speed
END.1

/*
Logic L2 is called if there is a change in the control word
1) it saves the new state into the old state
2) It compares the changed value with defined values to 
execute the relavant command
*/
L2.1
old_ControlWord= ControlWord;
old_ControlWord== 1, ^.1, T0.1		//run
old_ControlWord== 2, ].1, T0.1		//stop
old_ControlWord== 3, (.1, T0.1		//enable
old_ControlWord== 4, ).1, T0.1		//disable
old_ControlWord== 5,|.1,T0.1		//home
END.1

/*
Logic L3 executes a change in position
If the control word eqauls 1 then it executes the move immediately
*/
L3.1
old_TargetPos= TargetPos;
ControlWord== 1, ^.1, T0.1	//execute move is ControlWord equals 1
END.1

/*
The following 2 logic banks set the speed and acceleration
Writing to the value through modbus only changes the register
it does not process the change.
The change must be processed through CML for it to be
executed immediately
*/

//Logic L4 sets the acceleration
L4.1
old_TargetAcc= TargetAcc;
TargetAcc= TargetAcc;
END.1

//Logic L4 sets the speed
L5.1
old_TargetSpd= TargetSpd;
TargetSpd= TargetSpd;
END.1

$.1	//save program to eeprom

K81=1	//set to modbus mode
</code>
      <guid>b7dab090-611a-4aad-b930-6ae67af71076</guid>
      <linkedGuid>63e56aaf-9271-4ff5-a9f2-c24a31238a83</linkedGuid>
      <CMtype>2</CMtype>
    </codeObject>
  </cmpObjects>
  <terminalGuid>f361d7e5-9b8f-4e8b-aac6-7eae1033be2a</terminalGuid>
  <controlGuid>357a77b0-310c-484a-9725-45849bd1dd26</controlGuid>
  <graphGuid>d6521b1f-a345-489c-a2eb-ab3414c03c3f</graphGuid>
  <parameterTreeGuid>00000000-0000-0000-0000-000000000000</parameterTreeGuid>
  <parameterPropertyGuid>00000000-0000-0000-0000-000000000000</parameterPropertyGuid>
  <terminalFontSize>8</terminalFontSize>
  <hotlistCM1 />
  <hotlistCM2>
    <string>V0</string>
  </hotlistCM2>
</SaveFile>