Hi Dennis.
There are 3 problems with your attached code:
1. The "Start" button is throwing an error because the timer IDs are case sensitive and you have a lowercase "c" in your script and and uppercase "C" in your timer's ID (Period.Clock)
2. You've taken the script to send the RossTalk command and put the whole thing in quotes. You have:
ogscript.debug("rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'Dashboard.host'), parseInt(ogscript.getPrivateString('hosts', 'Dashboard.port')), 'SEQI 399:0');");
What you probably want is:
rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'Dashboard.host'), parseInt(ogscript.getPrivateString('hosts', 'Dashboard.port')), 'SEQI 399:0');
3. Your code is referencing a lookup table that contains the host/port information. It looks like you copied the button code but not the lookup table with the actual values.
I generally recommend selecting the "Create Parameter" option when adding new devices to Visual Logic because it is easier to modify your device settings in the future.
Overall, the code would become:
<abs contexttype="opengear">
<meta>
<lookup id="hosts">
<entry key="XPression.scriptport">true</entry>
<entry key="XPression.color">-1145302</entry>
<entry key="XPression.port">params.getValue('XPression_RossTalkPort', 0)</entry>
<entry key="XPression.host">params.getValue('XPression_IPAddress', 0)</entry>
<entry key="XPression.scripthost">true</entry>
<entry key="XPression.devicetype">XPression</entry>
</lookup>
<params>
<param access="1" maxlength="0" name="Period.Clock" oid="0x2" type="STRING" value="RUN AMIMATION!" widget="label"/>
<param access="1" maxlength="0" name="XPression_IPAddress" oid="XPression_IPAddress" type="STRING" value="" widget="0"/>
<param access="1" maxlength="0" name="XPression_RossTalkPort" oid="XPression_RossTalkPort" type="STRING" value="7788" widget="0"/>
</params>
</meta>
<timer autostart="false" id="Period.Clock" pattern="mm:ss" rate="1" start="12:00" stop="00:00">
<timertask tasktype="ogparamset">params.setValue('0x2', 0, event.getDisplay());</timertask>
<timertask tasktype="ogscript">if (event.getCurrentValue() == 0)
{
rosstalk.sendMessage(params.getValue('XPression_IPAddress', 0), params.getValue('XPression_RossTalkPort', 0), "SEQI " + 399 + ":" + 0);
params.setValue('0x2', 0, 'RUN AMIMATION!');
}</timertask>
</timer>
<param expand="true" height="76" left="25" oid="0x2" style="style:timerLabel" top="26" width="394"/>
<simplegrid height="48" left="27" rows="1" top="109" width="394">
<button buttontype="push" name="Start">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.clock').startTimer(false);</task>
</button>
<button buttontype="push" name="Stop">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.Clock').stopTimer(false);</task>
</button>
<button buttontype="push" name="Reset">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.Clock').resetTimer();</task>
</button>
</simplegrid>
<table height="117" left="635" style="bg#dark;bdr:etched;" top="30" width="338">
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="XPression Host: " rowspan="1" style="txt-align:east;" weighty="1.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="XPression_IPAddress" rowspan="1" weightx="1.0" weighty="1.0" widget="3"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="XPression Port: " rowspan="1" style="txt-align:east;" weighty="1.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="XPression_RossTalkPort" rowspan="1" weightx="1.0" weighty="1.0" widget="3"/>
</tr>
</table>
</abs>
The last thing to consider would be having the code attached to a button and having the timer code "press" the button:
<abs contexttype="opengear">
<meta>
<lookup id="hosts">
<entry key="XPression.scriptport">true</entry>
<entry key="XPression.color">-1145302</entry>
<entry key="XPression.port">params.getValue('XPression_RossTalkPort', 0)</entry>
<entry key="XPression.host">params.getValue('XPression_IPAddress', 0)</entry>
<entry key="XPression.scripthost">true</entry>
<entry key="XPression.devicetype">XPression</entry>
</lookup>
<params>
<param access="1" maxlength="0" name="Period.Clock" oid="0x2" type="STRING" value="12:00" widget="label"/>
<param access="1" maxlength="0" name="XPression_IPAddress" oid="XPression_IPAddress" type="STRING" value="" widget="0"/>
<param access="1" maxlength="0" name="XPression_RossTalkPort" oid="XPression_RossTalkPort" type="STRING" value="7788" widget="0"/>
</params>
</meta>
<timer autostart="false" id="Period.Clock" pattern="mm:ss" rate="1" start="12:00" stop="00:00">
<timertask tasktype="ogparamset">params.setValue('0x2', 0, event.getDisplay());</timertask>
<timertask tasktype="ogscript">if (event.getCurrentValue() == 0)
{
ogscript.fireGPI('RunAnimation', null, false);
params.setValue('0x2', 0, 'RUN AMIMATION!');
}</timertask>
</timer>
<param expand="true" height="76" left="25" oid="0x2" style="style:timerLabel" top="26" width="394"/>
<simplegrid height="48" left="27" rows="1" top="109" width="394">
<button buttontype="push" name="Start">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.Clock').startTimer(false);</task>
</button>
<button buttontype="push" name="Stop">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.Clock').stopTimer(false);</task>
</button>
<button buttontype="push" name="Reset">
<task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Period.Clock').resetTimer();</task>
</button>
</simplegrid>
<button buttontype="push" gpi="RunAnimation" height="125" left="421" name="Run Animation" top="26" width="210">
<task tasktype="ogscript">
/*! block id=1002 !*/
ogscript.debug("Press button");
/*! block id=1000 !*/
rosstalk.sendMessage(params.getValue('XPression_IPAddress', 0), params.getValue('XPression_RossTalkPort', 0), "SEQI " + 399 + ":" + 0);
/*!!
<block id="1002" type="ogscript_debug" x="7" y="21" w="243" MESSAGE="Press button" next="ID:1000" />
<block id="1000" type="XPression_xpression_seqilayer" x="10" y="100" w="243" color="#ee862a" TAKEID="399" LAYER="0" />
!!*/
/*!!<checksum>96064eb7857be08aa4e00cac303703bf</checksum>!!*/</task>
</button>
<table height="117" left="635" style="bg#dark;bdr:etched;" top="30" width="338">
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="XPression Host: " rowspan="1" style="txt-align:east;" weighty="1.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="XPression_IPAddress" rowspan="1" weightx="1.0" weighty="1.0" widget="3"/>
</tr>
<tr>
<label colspan="1" fill="both" insets="2,2,2,2" name="XPression Port: " rowspan="1" style="txt-align:east;" weighty="1.0"/>
<param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="XPression_RossTalkPort" rowspan="1" weightx="1.0" weighty="1.0" widget="3"/>
</tr>
</table>
</abs>
The important parts are:
<button buttontype="push" gpi="RunAnimation" height="125" left="421" name="Run Animation" top="26" width="210">
<task tasktype="ogscript">
/*! block id=1002 !*/
ogscript.debug("Press button");
/*! block id=1000 !*/
rosstalk.sendMessage(params.getValue('XPression_IPAddress', 0), params.getValue('XPression_RossTalkPort', 0), "SEQI " + 399 + ":" + 0);
/*!!
<block id="1002" type="ogscript_debug" x="7" y="21" w="243" MESSAGE="Press button" next="ID:1000" />
<block id="1000" type="XPression_xpression_seqilayer" x="10" y="100" w="243" color="#ee862a" TAKEID="399" LAYER="0" />
!!*/
/*!!<checksum>96064eb7857be08aa4e00cac303703bf</checksum>!!*/</task>
</button>
And, in the timer task:
"‹if (event.getCurrentValue() == 0)
{
ogscript.fireGPI('RunAnimation', null, false);
params.setValue('0x2', 0, 'RUN AMIMATION!');
}
#DashBoard