<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.plcopen.org/xml/tc6.xsd"
xsi:schemaLocation="http://www.plcopen.org/xml/tc6.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<fileHeader companyName="EtherlabMaster"
productName="EtherlabMaster"
creationDateTime="2012-10-22T12:12:45"/>
<contentHeader name="EtherlabMaster SDO Blocks"
modificationDateTime="2012-11-13T18:03:39">
<pou name="EtherLabSDOUpload" pouType="functionBlock">
<variable name="EXECUTE">
<variable name="SUBINDEX">
<variable name="VARTYPE">
<derived name="python_eval"/>
<derived name="python_eval"/>
<variable name="EXECUTE0">
<![CDATA[{extern int AcquireSDOLock();}
{extern int HasAnswer();}
{extern void ReleaseSDOLock();}
IF EXECUTE AND NOT EXECUTE0 THEN
{if (AcquireSDOLock()) __SET_VAR(data__->,STATE,, 2)}
{if (HasAnswer()) __SET_VAR(data__->,STATE,, 4)}
VALID := NE(VALUE, 'None');
CODE := CONCAT('EthercatSDOUpload(',
USINT_TO_STRING(SUBINDEX),
<pou name="EtherLabSDODownload" pouType="functionBlock">
<variable name="EXECUTE">
<variable name="SUBINDEX">
<variable name="VARTYPE">
<derived name="python_eval"/>
<derived name="python_eval"/>
<variable name="EXECUTE0">
<![CDATA[{extern int AcquireSDOLock();}
{extern int HasAnswer();}
{extern void ReleaseSDOLock();}
IF EXECUTE AND NOT EXECUTE0 THEN
{if (AcquireSDOLock()) __SET_VAR(data__->,STATE,, 2)}
{if (HasAnswer()) __SET_VAR(data__->,STATE,, 4)}
ERROR := EQ(PY1.RESULT, 'False');
CODE := CONCAT('EthercatSDODownload(',
USINT_TO_STRING(SUBINDEX),
<pou name="EtherLabSetTorqueLimit" pouType="functionBlock">
<variable name="Execute">
<variable name="TorqueLimitPos">
<variable name="TorqueLimitNeg">
<variable name="ErrorID">
<variable name="EtherLabSDOUpload0">
<derived name="EtherLabSDODownload"/>
<variable name="EtherLabSDOUpload1">
<derived name="EtherLabSDODownload"/>
<block localId="1" width="168" height="238" typeName="EtherLabSDODownload" instanceName="EtherLabSDOUpload0">
<position x="479" y="70"/>
<variable formalParameter="EXECUTE">
<relPosition x="0" y="38"/>
<connection refLocalId="3">
<position x="479" y="108"/>
<position x="111" y="108"/>
<variable formalParameter="POS">
<relPosition x="0" y="74"/>
<connection refLocalId="4">
<position x="479" y="144"/>
<position x="423" y="144"/>
<variable formalParameter="INDEX">
<relPosition x="0" y="110"/>
<connection refLocalId="6">
<position x="479" y="180"/>
<position x="423" y="180"/>
<variable formalParameter="SUBINDEX">
<relPosition x="0" y="146"/>
<connection refLocalId="8">
<position x="479" y="216"/>
<position x="423" y="216"/>
<variable formalParameter="VARTYPE">
<relPosition x="0" y="182"/>
<connection refLocalId="10">
<position x="479" y="252"/>
<position x="423" y="252"/>
<variable formalParameter="VALUE">
<relPosition x="0" y="218"/>
<connection refLocalId="25" formalParameter="OUT">
<position x="479" y="288"/>
<position x="450" y="288"/>
<position x="450" y="306"/>
<position x="422" y="306"/>
<variable formalParameter="ACK">
<relPosition x="168" y="38"/>
<variable formalParameter="ERROR">
<relPosition x="168" y="74"/>
<block localId="2" width="168" height="264" typeName="EtherLabSDODownload" instanceName="EtherLabSDOUpload1">
<position x="482" y="351"/>
<variable formalParameter="EXECUTE">
<relPosition x="0" y="40"/>
<connection refLocalId="3">
<position x="482" y="391"/>
<position x="131" y="391"/>
<position x="131" y="108"/>
<position x="111" y="108"/>
<variable formalParameter="POS">
<relPosition x="0" y="80"/>
<connection refLocalId="5">
<position x="482" y="431"/>
<position x="431" y="431"/>
<variable formalParameter="INDEX">
<relPosition x="0" y="120"/>
<connection refLocalId="7">
<position x="482" y="471"/>
<position x="431" y="471"/>
<variable formalParameter="SUBINDEX">
<relPosition x="0" y="160"/>
<connection refLocalId="9">
<position x="482" y="511"/>
<position x="430" y="511"/>
<variable formalParameter="VARTYPE">
<relPosition x="0" y="200"/>
<connection refLocalId="11">
<position x="482" y="551"/>
<position x="431" y="551"/>
<variable formalParameter="VALUE">
<relPosition x="0" y="240"/>
<connection refLocalId="12" formalParameter="OUT">
<position x="482" y="591"/>
<position x="456" y="591"/>
<position x="456" y="610"/>
<position x="431" y="610"/>
<variable formalParameter="ACK">
<relPosition x="168" y="40"/>
<variable formalParameter="ERROR">
<relPosition x="168" y="80"/>
<inVariable localId="3" height="27" width="63">
<position x="48" y="95"/>
<relPosition x="63" y="13"/>
<expression>Execute</expression>
<inVariable localId="4" height="27" width="35">
<position x="388" y="131"/>
<relPosition x="35" y="13"/>
<expression>Pos</expression>
<inVariable localId="5" height="27" width="35">
<position x="396" y="418"/>
<relPosition x="35" y="13"/>
<expression>Pos</expression>
<inVariable localId="6" height="27" width="68">
<position x="355" y="167"/>
<relPosition x="68" y="13"/>
<expression>16#60E0</expression>
<inVariable localId="7" height="27" width="68">
<position x="363" y="458"/>
<relPosition x="68" y="13"/>
<expression>16#60E1</expression>
<inVariable localId="8" height="27" width="33">
<position x="390" y="203"/>
<relPosition x="33" y="13"/>
<expression>0</expression>
<inVariable localId="9" height="27" width="33">
<position x="397" y="498"/>
<relPosition x="33" y="13"/>
<expression>0</expression>
<inVariable localId="10" height="27" width="60">
<position x="363" y="239"/>
<relPosition x="60" y="13"/>
<expression>'uint16'</expression>
<inVariable localId="11" height="27" width="60">
<position x="371" y="538"/>
<relPosition x="60" y="13"/>
<expression>'uint16'</expression>
<block localId="16" width="67" height="98" typeName="AND">
<position x="763" y="69"/>
<variable formalParameter="IN1">
<relPosition x="0" y="39"/>
<connection refLocalId="1" formalParameter="ACK">
<position x="763" y="108"/>
<position x="647" y="108"/>
<variable formalParameter="IN2">
<relPosition x="0" y="78"/>
<connection refLocalId="2" formalParameter="ACK">
<position x="763" y="147"/>
<position x="707" y="147"/>
<position x="707" y="391"/>
<position x="650" y="391"/>
<variable formalParameter="OUT">
<relPosition x="67" y="39"/>
<outVariable localId="17" height="27" width="45">
<position x="941" y="95"/>
<relPosition x="0" y="13"/>
<connection refLocalId="16" formalParameter="OUT">
<position x="941" y="108"/>
<position x="830" y="108"/>
<expression>Done</expression>
<block localId="18" width="67" height="111" typeName="OR">
<position x="778" y="344"/>
<variable formalParameter="IN1">
<relPosition x="0" y="42"/>
<connection refLocalId="1" formalParameter="ERROR">
<position x="778" y="386"/>
<position x="752" y="386"/>
<position x="752" y="254"/>
<position x="659" y="254"/>
<position x="659" y="144"/>
<position x="647" y="144"/>
<variable formalParameter="IN2">
<relPosition x="0" y="87"/>
<connection refLocalId="2" formalParameter="ERROR">
<position x="778" y="431"/>
<position x="650" y="431"/>
<variable formalParameter="OUT">
<relPosition x="67" y="42"/>
<block localId="19" width="67" height="98" typeName="AND">
<position x="933" y="308"/>
<variable formalParameter="IN1">
<relPosition x="0" y="39"/>
<connection refLocalId="16" formalParameter="OUT">
<position x="933" y="347"/>
<position x="886" y="347"/>
<position x="886" y="108"/>
<position x="830" y="108"/>
<variable formalParameter="IN2">
<relPosition x="0" y="78"/>
<connection refLocalId="18" formalParameter="OUT">
<position x="933" y="386"/>
<position x="845" y="386"/>
<variable formalParameter="OUT">
<relPosition x="67" y="39"/>
<outVariable localId="20" height="27" width="45">
<position x="1037" y="334"/>
<relPosition x="0" y="13"/>
<connection refLocalId="19" formalParameter="OUT">
<position x="1037" y="347"/>
<position x="1000" y="347"/>
<expression>Error</expression>
<block localId="22" width="97" height="93" typeName="RS" instanceName="RS0">
<position x="854" y="498"/>
<variable formalParameter="S">
<relPosition x="0" y="38"/>
<connection refLocalId="23">
<position x="854" y="536"/>
<position x="795" y="536"/>
<variable formalParameter="R1">
<relPosition x="0" y="74"/>
<connection refLocalId="21">
<position x="854" y="572"/>
<position x="790" y="572"/>
<variable formalParameter="Q1">
<relPosition x="97" y="38"/>
<inVariable localId="21" height="27" width="45">
<position x="745" y="559"/>
<relPosition x="45" y="13"/>
<expression>Done</expression>
<inVariable localId="23" height="27" width="63">
<position x="732" y="523"/>
<relPosition x="63" y="13"/>
<expression>Execute</expression>
<outVariable localId="24" height="27" width="41">
<position x="1006" y="523"/>
<relPosition x="0" y="13"/>
<connection refLocalId="22" formalParameter="Q1">
<position x="1006" y="536"/>
<position x="951" y="536"/>
<expression>Busy</expression>
<block localId="25" width="126" height="40" typeName="UINT_TO_STRING">
<position x="296" y="276"/>
<variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="14">
<position x="296" y="306"/>
<position x="262" y="306"/>
<variable formalParameter="OUT">
<relPosition x="126" y="30"/>
<inVariable localId="14" height="27" width="117">
<position x="145" y="293"/>
<relPosition x="117" y="13"/>
<expression>TorqueLimitPos</expression>
<block localId="12" width="126" height="40" typeName="UINT_TO_STRING">
<position x="305" y="580"/>
<variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="15">
<position x="305" y="610"/>
<position x="283" y="610"/>
<position x="283" y="611"/>
<position x="262" y="611"/>
<variable formalParameter="OUT">
<relPosition x="126" y="30"/>
<inVariable localId="15" height="27" width="119">
<position x="143" y="598"/>
<relPosition x="119" y="13"/>
<expression>TorqueLimitNeg</expression>
<pou name="EtherLabGetTorqueLimit" pouType="functionBlock">
<variable name="Execute">
<variable name="ErrorID">
<variable name="TorqueLimitPos">
<variable name="TorqueLimitNeg">
<variable name="EtherLabSDOUpload0">
<derived name="EtherLabSDOUpload"/>
<variable name="EtherLabSDOUpload1">
<derived name="EtherLabSDOUpload"/>
<block localId="1" width="149" height="203" typeName="EtherLabSDOUpload" instanceName="EtherLabSDOUpload0">
<position x="283" y="70"/>
<variable formalParameter="EXECUTE">
<relPosition x="0" y="38"/>
<connection refLocalId="3">
<position x="283" y="108"/>
<position x="111" y="108"/>
<variable formalParameter="POS">
<relPosition x="0" y="74"/>
<connection refLocalId="4">
<position x="283" y="144"/>
<position x="219" y="144"/>
<variable formalParameter="INDEX">
<relPosition x="0" y="110"/>
<connection refLocalId="6">
<position x="283" y="180"/>
<position x="219" y="180"/>
<variable formalParameter="SUBINDEX">
<relPosition x="0" y="146"/>
<connection refLocalId="8">
<position x="283" y="216"/>
<position x="219" y="216"/>
<variable formalParameter="VARTYPE">
<relPosition x="0" y="182"/>
<connection refLocalId="10">
<position x="283" y="252"/>
<position x="219" y="252"/>
<variable formalParameter="ACK">
<relPosition x="149" y="38"/>
<variable formalParameter="VALID">
<relPosition x="149" y="74"/>
<variable formalParameter="VALUE">
<relPosition x="149" y="110"/>
<block localId="2" width="149" height="228" typeName="EtherLabSDOUpload" instanceName="EtherLabSDOUpload1">
<position x="284" y="321"/>
<variable formalParameter="EXECUTE">
<relPosition x="0" y="40"/>
<connection refLocalId="3">
<position x="284" y="361"/>
<position x="131" y="361"/>
<position x="131" y="108"/>
<position x="111" y="108"/>
<variable formalParameter="POS">
<relPosition x="0" y="81"/>
<connection refLocalId="5">
<position x="284" y="402"/>
<position x="219" y="402"/>
<variable formalParameter="INDEX">
<relPosition x="0" y="122"/>
<connection refLocalId="7">
<position x="284" y="443"/>
<position x="219" y="443"/>
<variable formalParameter="SUBINDEX">
<relPosition x="0" y="163"/>
<connection refLocalId="9">
<position x="284" y="484"/>
<position x="219" y="484"/>
<variable formalParameter="VARTYPE">
<relPosition x="0" y="204"/>
<connection refLocalId="11">
<position x="284" y="525"/>
<position x="219" y="525"/>
<variable formalParameter="ACK">
<relPosition x="149" y="40"/>
<variable formalParameter="VALID">
<relPosition x="149" y="81"/>
<variable formalParameter="VALUE">
<relPosition x="149" y="122"/>
<inVariable localId="3" height="27" width="63">
<position x="48" y="95"/>
<relPosition x="63" y="13"/>
<expression>Execute</expression>
<inVariable localId="4" height="27" width="35">
<position x="184" y="131"/>
<relPosition x="35" y="13"/>
<expression>Pos</expression>
<inVariable localId="5" height="27" width="35">
<position x="184" y="389"/>
<relPosition x="35" y="13"/>
<expression>Pos</expression>
<inVariable localId="6" height="27" width="68">
<position x="151" y="167"/>
<relPosition x="68" y="13"/>
<expression>16#60E0</expression>
<inVariable localId="7" height="27" width="68">
<position x="151" y="430"/>
<relPosition x="68" y="13"/>
<expression>16#60E1</expression>
<inVariable localId="8" height="27" width="33">
<position x="186" y="203"/>
<relPosition x="33" y="13"/>
<expression>0</expression>
<inVariable localId="9" height="27" width="33">
<position x="186" y="471"/>
<relPosition x="33" y="13"/>
<expression>0</expression>
<inVariable localId="10" height="27" width="60">
<position x="159" y="239"/>
<relPosition x="60" y="13"/>
<expression>'uint16'</expression>
<inVariable localId="11" height="27" width="60">
<position x="159" y="512"/>
<relPosition x="60" y="13"/>
<expression>'uint16'</expression>
<block localId="12" width="126" height="40" typeName="STRING_TO_UINT">
<position x="492" y="150"/>
<variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="1" formalParameter="VALUE">
<position x="492" y="180"/>
<position x="432" y="180"/>
<variable formalParameter="OUT">
<relPosition x="126" y="30"/>
<block localId="13" width="126" height="40" typeName="STRING_TO_UINT">
<position x="498" y="413"/>
<variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="2" formalParameter="VALUE">
<position x="498" y="443"/>
<position x="433" y="443"/>
<variable formalParameter="OUT">
<relPosition x="126" y="30"/>
<outVariable localId="14" height="27" width="117">
<position x="673" y="167"/>
<relPosition x="0" y="13"/>
<connection refLocalId="12" formalParameter="OUT">
<position x="673" y="180"/>
<position x="618" y="180"/>
<expression>TorqueLimitPos</expression>
<outVariable localId="15" height="27" width="119">
<position x="679" y="430"/>
<relPosition x="0" y="13"/>
<connection refLocalId="13" formalParameter="OUT">
<position x="679" y="443"/>
<position x="624" y="443"/>
<expression>TorqueLimitNeg</expression>
<block localId="16" width="67" height="98" typeName="AND">
<position x="861" y="69"/>
<variable formalParameter="IN1">
<relPosition x="0" y="39"/>
<connection refLocalId="1" formalParameter="ACK">
<position x="861" y="108"/>
<position x="432" y="108"/>
<variable formalParameter="IN2">
<relPosition x="0" y="78"/>
<connection refLocalId="2" formalParameter="ACK">
<position x="861" y="147"/>
<position x="804" y="147"/>
<position x="804" y="361"/>
<position x="433" y="361"/>
<variable formalParameter="OUT">
<relPosition x="67" y="39"/>
<outVariable localId="17" height="27" width="45">
<position x="1009" y="95"/>
<relPosition x="0" y="13"/>
<connection refLocalId="16" formalParameter="OUT">
<position x="1009" y="108"/>
<position x="928" y="108"/>
<expression>Done</expression>
<block localId="18" width="67" height="111" typeName="OR">
<position x="862" y="315"/>
<variable formalParameter="IN1" negated="true">
<relPosition x="0" y="42"/>
<connection refLocalId="1" formalParameter="VALID">
<position x="862" y="357"/>
<position x="839" y="357"/>
<position x="839" y="254"/>
<position x="469" y="254"/>
<position x="469" y="144"/>
<position x="432" y="144"/>
<variable formalParameter="IN2" negated="true">
<relPosition x="0" y="87"/>
<connection refLocalId="2" formalParameter="VALID">
<position x="862" y="402"/>
<position x="433" y="402"/>
<variable formalParameter="OUT">
<relPosition x="67" y="42"/>
<block localId="19" width="67" height="98" typeName="AND">
<position x="989" y="279"/>
<variable formalParameter="IN1">
<relPosition x="0" y="39"/>
<connection refLocalId="16" formalParameter="OUT">
<position x="989" y="318"/>
<position x="958" y="318"/>
<position x="958" y="108"/>
<position x="928" y="108"/>
<variable formalParameter="IN2">
<relPosition x="0" y="78"/>
<connection refLocalId="18" formalParameter="OUT">
<position x="989" y="357"/>
<position x="929" y="357"/>
<variable formalParameter="OUT">
<relPosition x="67" y="39"/>
<outVariable localId="20" height="27" width="45">
<position x="1102" y="305"/>
<relPosition x="0" y="13"/>
<connection refLocalId="19" formalParameter="OUT">
<position x="1102" y="318"/>
<position x="1056" y="318"/>
<expression>Error</expression>
<block localId="22" width="97" height="93" typeName="RS" instanceName="RS0">
<position x="657" y="517"/>
<variable formalParameter="S">
<relPosition x="0" y="38"/>
<connection refLocalId="23">
<position x="657" y="555"/>
<position x="600" y="555"/>
<variable formalParameter="R1">
<relPosition x="0" y="74"/>
<connection refLocalId="21">
<position x="657" y="591"/>
<position x="599" y="591"/>
<variable formalParameter="Q1">
<relPosition x="97" y="38"/>
<inVariable localId="21" height="27" width="45">
<position x="554" y="578"/>
<relPosition x="45" y="13"/>
<expression>Done</expression>
<inVariable localId="23" height="27" width="63">
<position x="537" y="542"/>
<relPosition x="63" y="13"/>
<expression>Execute</expression>
<outVariable localId="24" height="27" width="41">
<position x="811" y="542"/>
<relPosition x="0" y="13"/>
<connection refLocalId="22" formalParameter="Q1">
<position x="811" y="555"/>
<position x="754" y="555"/>
<expression>Busy</expression>