﻿<?xml version="1.0" encoding="utf-8"?>
<product make="Custom" model="Custom with variables" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="shell.xsd">
  <info>
    <authors>
      <author>Joy Burke</author>
    </authors>
    <description>Use as example for setting custom variables with incoming messages</description>
    <version>1.0</version>
  </info>
  <hardware group="control">
    <ports>
      <port type="midi" />
      <port type="serial" />
      <port type="midi" />
      <port type="ethernet" />
    </ports>
  </hardware>
  <protocols>
    <protocol name="Custom">
      <ports>
        <port type="serial">
          <port_options>
            <port_option baud="9600" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="n" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="n" stop_bits="1" />
            <port_option baud="31250" bits="8" parity="n" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="n" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="n" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="n" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="31250" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="9600" bits="8" parity="even" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="even" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="even" stop_bits="1" />
            <port_option baud="31250" bits="8" parity="even" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="even" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="even" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="even" stop_bits="1" />
            <port_option baud="9600" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="9600" bits="7" parity="n" stop_bits="1" />
            <port_option baud="4800" bits="7" parity="n" stop_bits="1" />
            <port_option baud="19200" bits="7" parity="n" stop_bits="1" />
            <port_option baud="31250" bits="7" parity="n" stop_bits="1" />
            <port_option baud="38400" bits="7" parity="n" stop_bits="1" />
            <port_option baud="57600" bits="7" parity="n" stop_bits="1" />
            <port_option baud="115200" bits="7" parity="n" stop_bits="1" />
            <port_option baud="4800" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="19200" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="31250" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="38400" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="57600" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="115200" bits="7" parity="odd" stop_bits="1" />
            <port_option baud="9600" bits="7" parity="even" stop_bits="1" />
            <port_option baud="4800" bits="7" parity="even" stop_bits="1" />
            <port_option baud="19200" bits="7" parity="even" stop_bits="1" />
            <port_option baud="31250" bits="7" parity="even" stop_bits="1"></port_option>
            <port_option baud="38400" bits="7" parity="even" stop_bits="1" />
            <port_option baud="57600" bits="7" parity="even" stop_bits="1" />
            <port_option baud="115200" bits="7" parity="even" stop_bits="1" />
            <port_option baud="9600" bits="8" parity="n" stop_bits="1" />
          </port_options>
        </port>
        <port type="ethernet">
          <port_options>
            <port_option ip_address="192.168.0.254" eport="23" etype="tcp_client" />
            <port_option ip_address="192.168.0.254" eport="2639" etype="udp" />
            <port_option ip_address="192.168.0.254" eport="2639" etype="tcp_server" />
          </port_options>
        </port>
        <port type="midi">
          <port_options>
            <port_option baud="31250" bits="8" parity="n" stop_bits="1" />
            <port_option baud="9600" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="9600" bits="8" parity="n" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="n" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="n" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="n" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="n" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="n" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="31250" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="odd" stop_bits="1" />
            <port_option baud="9600" bits="8" parity="even" stop_bits="1" />
            <port_option baud="4800" bits="8" parity="even" stop_bits="1" />
            <port_option baud="19200" bits="8" parity="even" stop_bits="1" />
            <port_option baud="31250" bits="8" parity="even" stop_bits="1" />
            <port_option baud="38400" bits="8" parity="even" stop_bits="1" />
            <port_option baud="57600" bits="8" parity="even" stop_bits="1" />
            <port_option baud="115200" bits="8" parity="even" stop_bits="1" />
          </port_options>
        </port>
      </ports>
      <commands>
        <command name="SetVariable1" unsolicited="true" hidden="true">
          <description>Set a variable named Var1</description>
          <messages>
            <message regexp_format="VAR1\|(.+)VA\x0D" incoming="true">
              <params>
                <param name="Temp1" />
              </params>
              <operations>
                <operation name="Var1" device_var="true" result="atoi(Temp1)"></operation>
              </operations>
            </message>
          </messages>
        </command>
        <command name="SetVariable2" unsolicited="true" hidden="true">
          <description>Set a variable named Var2</description>
          <messages>
            <message regexp_format="VAR2\|(.+)VA\x0D" incoming="true">
              <params>
                <param name="Temp2" />
              </params>
              <operations>
                <operation name="Var2" device_var="true" result="atoi(Temp2)"></operation>
              </operations>
            </message>
          </messages>
        </command>
        <command name="RideStop" unsolicited="true">
          <description></description>
          <messages>
            <message regexp_format="21PL\r" incoming="true" respond_cmnd="RideStopACK"></message>
          </messages>
        </command>
        <command name="RideStopACK" hidden="true">
          <description></description>
          <messages>
            <message regexp_format="&quot;21PL ACK\r&quot;"></message>
          </messages>
        </command>
        <command name="StartSequence1" unsolicited="true">
          <description></description>
          <messages>
            <message regexp_format="1PL\r(?&lt;![1-9]1PL\r)" incoming="true" respond_cmnd="SendAckSeq1"></message>
          </messages>
        </command>
        <command name="SendAckSeq1" hidden="true">
          <description>Send whatever ACK value you want (used by StartSequence1)</description>
          <messages>
            <message format="&quot;1PL ACK\r&quot;"></message>
          </messages>
        </command>
        <command name="StartSequence2" unsolicited="true">
          <description></description>
          <messages>
            <message regexp_format="2PL\r(?&lt;![1-9]2PL\r)" incoming="true" respond_cmnd="SendAckSeq2"></message>
          </messages>
        </command>
        <command name="SendAckSeq2" hidden="true">
          <description>Send whatever ACK value you want (used by StartSequence2)</description>
          <messages>
            <message format="&quot;2PL ACK\r&quot;"></message>
          </messages>
        </command>
      </commands>
      <variables>
        <var name="Error">
          <!-- Set to true when a command fails to get a correct response -->
          <rules>
            <bool />
          </rules>
        </var>
        <var name="TCPStatus">
          <!--The current connection state: "Not Connected", "Timeout", "Connected", "Waiting on TCP", "Waiting For Response"-->
          <rules>
            <string />
          </rules>
        </var>
        <var name="MACID" init="&quot;Unknown&quot;">
          <!--String in the form "00:00:00:00:00:00". Fill using "ping" command of V16Pro-->
          <rules>
            <string />
          </rules>
        </var>
        <var name="Var1">
          <!--Example first variable-->
          <rules>
            <integer />
          </rules>
        </var>
        <var name="Var2">
          <!--Example second variable-->
          <rules>
            <integer />
          </rules>
        </var>
      </variables>
    </protocol>
  </protocols>
</product>