<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Example 2</title>
<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link REL="stylesheet" TYPE="text/css" HREF="../../TDVINTRA.CSS" VI6.0THEME="TDV">
<meta name="Microsoft Border" content="tb, default">
</head>
<body><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>
<table border="0" height="139" style="width: 747px">
<tr>
<td height="80" style="border-style: solid; width: 100%" rowspan="2">
<font face="Tahoma" size="2">
<nobr><A HREF="Default.htm" TARGET="" STYLE="{text-decoration: none;}">Up</A></nobr> | <nobr><A HREF="Setup.htm" TARGET="" STYLE="{text-decoration: none;}">Setup</A></nobr> | <nobr><A HREF="MotoCom%20Requirements.htm" TARGET="" STYLE="{text-decoration: none;}">Motocom Requirements</A></nobr> | <nobr><A HREF="Methods.htm" TARGET="" STYLE="{text-decoration: none;}">Methods</A></nobr> | <nobr><A HREF="Events.htm" TARGET="" STYLE="{text-decoration: none;}">Events</A></nobr> | <nobr><A HREF="Example1.htm" TARGET="" STYLE="{text-decoration: none;}">Example 1</A></nobr> | <nobr>Example 2</nobr> | <nobr><A HREF="Example3.htm" TARGET="" STYLE="{text-decoration: none;}">Example 3</A></nobr> | <nobr><A HREF="ReleaseNotes.htm" TARGET="" STYLE="{text-decoration: none;}">Release Notes</A></nobr></font>
<br>
<br>
<font face="Tahoma" size="2">
</font></td>
<td style="text-align: center"> <a href="../../Default.htm"><img alt="" src="../../_borders/home_space16x16.gif" width="24" height="24" style="border-width: 0; float: left;"></a></td>
<td width="20%" height="80" rowspan="2">
<p align="right">
<a href="http://www.scorpionvision.com/">
<img border="0" src="../../images/scorpionlogo_150.gif" width="150" height="36"></a>
</p>
</td>
</tr>
<tr>
<td style="text-align: center">
<a href="../../Search/default.htm">
<img alt="" src="../../_borders/search_space16x16.gif" width="29" height="27" style="border-style: solid; border-width: 0"></a> </td>
</tr>
<tr>
<td width="100%" colspan="2" height="50" style="font-size: large; text-align: left;">
<font face="Arial"><strong>
Example 2</strong></font></td>
</tr>
</table>
</td></tr><!--msnavigation--></table><!--msnavigation--><table dir="ltr" border="0" cellpadding="0" cellspacing="0" width="100%"><tr><!--msnavigation--><td valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td width="767" valign="top" >
Example 2, trigger example with additional robot information<p>This
example is as Example 1 with one exception - two values are transfered to
Scorpion before CameraTrigger.</p>
<p>MOTOMAN program:</p>
<p><font face="Courier New">0022 ...<br>
0023 ...<br>
0024 SET B014 1 'set register B014 to 1 to signal robot in position<br>
0025 SET I017 12 'set register I017 to 12 as robot
height<br>
0026 SET D024 16.23 'set register D024 to 16.23 as robot delta<br>
0027 SAVEV B014 'notify Scorpion robot in position <br>
0028 SAVEV I017 'transfer robot height<br>
0029 SAVEV D024 'transfer robot delta<br>
0030 LOADV B015 'wait for Scorpion inspection result<br>
0031 LOADV P005 'wait for Scorpion position results <br>
0032 ...<br>
0033 ...</font></p>
<p>
<b>Motoman_Trigger script</b></p>
<p>
def Handle_MOTOMAN_Trigger(value):<br>
<br>
<br>
#this is called from robot by instuction SAVEV BXXX<br>
print 'Handle_MOTOMAN_Trigger',value</p>
<p>
h=ExtractResult(MOTOMAN.GetInt('varno=17')) # reads height
value<br>
print 'Robot Height ',d<br>
SetValue('Height.Value',h) # set value to Height tool in Toolbox</p>
<p>
d=ExtractResult(MOTOMAN.GetDouble('varno=24'))<br>
print 'Robot Delta ',d<br>
SetValue('Delta.Value',d)<br>
<br>
#capture image<br>
print 'CameraTrigger',ExecuteCmd('CameraTrigger','')</p>
<p>
</p>
<p>
# this function extracts the value from the Getxxx methods<br>
def ExtractResult(str):<br>
import string<br>
<br>
res=0<br>
t0=string.split(str,';')<br>
n=len(t0)<br>
if n>0:<br>
t1=string.split(t0[n-1],'=')<br>
n=len(t1)<br>
if n==2:<br>
res=int(t1[1])<br>
return res</p>
<p> </p>
</td>
</tr>
</table>
<!--msnavigation--></td></tr><!--msnavigation--></table><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>
<hr>
<table border="0" id="table1" width="737">
<tr>
<td align="center">
<p align="center">
<a href="http://www.tordivel.no">
<img border="0" src="../../images/Tordivel_screen_black_75x53.gif" width="75" height="53"></a></p>
</td>
<td style="width: 1074px">
<font face="Verdana" size="1">Scorpion Vision
Version<span lang="no-bok"> XII </span>:
<span lang="no-bok">Build 646</span> - Date: 201<span lang="no-bok">70225<br>
</span>Scorpion Vision Software� is a registered
trademark of Tordivel AS. <br>
Copyright � 2000 - 2017 Tordivel AS. </font>
</td>
<td width="624"></td>
</tr>
</table>
</td></tr><!--msnavigation--></table></body></html>