XPS-Q8
Tcl Manual
}
else
{
# Kill group
set
code
[catch "
GroupKill
$socketID $group"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GroupKill" $telnetOut
return
}
# 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 analog value
set
code [catch "
GPIOAnalogGet
$socketID $analogin voltage"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GPIOAnalogGet" $telnetOut
return
}
# Test if voltage is greater than 0.2 volt
while
{ $voltage >=
0.2
} {
# Get analog value
set
code [
catch
"
GPIOAnalogGet
$socketID $analogin voltage”]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code
“GPIOAnalogGet” $telnetOut
return
}
set
move1 $voltage
set
move2 [
expr
{ $voltage *
-1
} ]
puts
$telnetOut "$analogin: $voltage volt(s)"
# Force transfer to channel’s output buffer
EDH0307En1041 — 10/17
24