XPS-Q8
Tcl Manual
# Initialize group
set
code [catch "
GroupInitialize
$socketID $group"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GroupInitialize" $telnetOut
return
}
# Home group
set
code [
catch
"
GroupHomeSearch
$socketID $group"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GroupHomeSearch" $telnetOut
return
}
# Move group with 5 relative units
for
{ set var
0
} { $var <=
5
} { incr var } {
set
code [
catch
"
GroupMoveRelative
$socketID
$group
1
1
”]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GroupMoveRelative"
$telnetOut
return
}
}
# Get digital value
set
code [
catch
"
GPIODigitalGet
$socketID $digitalin value"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GPIODigitalGet" $telnetOut
return
}
# Test if value of GPIO1.DI is different from 255
while
{ $value !=
255
} {
# Get digital value
set
code [
catch
"
GPIODigitalGet
$socketID
digitalin value”]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code
"GPIODigitalGet" $telnetOut
return
}
puts
$telnetOut "$digitalin: $value"
flush
$telnetOut
if
{ $value ==
1
} {
puts
$telnetOut " move axis1:
1
"
flush
$telnetOut
puts
$telnetOut " move axis2:
-1
"
flush
$telnetOut
# Move axis 1
set
code [
catch
"
GroupMoveAbsolute
$socketID
$axis1
1
"]
if
{$code !=
0
} {
EDH0307En1041 — 10/17
27