Mentalix Logo


Pixel!FX 2000

Maintenance
Options

Fed Submit
Application Note
Index

Pixel!FX Application
Note Index

Links by Subject
Links by Platform
Links by Scanner

Y2K Compliance

Pixel!FX 2000
Release Info

View Guided
Product Tours

Site Index




Mentalix Application Note #10046
Sample Pixel!ENGINE Script
Example 1: Bell+Howell Copiscan II 6338 Scan function

#################################################################
#                                                               #
# This script allows you to perform scans with the Bell+Howell  #
# Copiscan II 6338 scanner.                                     #
#                                                               #
# Note that this script also uses the procedure doCommand()     #
# to check for errors that occur in commands to bail out        #
# properly.                                                     #
#                                                               #
#################################################################
 
proc doCommand { body } {
 global errorInfo errorCode
 set code [catch {uplevel $body} string]
 if {$code == 1} {
puts "errorInfo $errorCode"
puts [concat "in doCommand : errorInfo :" $errorInfo ";" $errorCode ]
  return -code error -errorinfo $errorInfo -errorcode $errorCode $string
 } elseif {$code == 2} {
puts "error code 2"
  return -code return $string
 } elseif {$code == 3} {
puts "error code 3"
  return 
 } elseif {$code >= 4} {
puts "error code 4"
  return -code $code $string
 }
}


proc calcsec { microsec } {
 scan $microsec %d timem
 return [expr $timem/1000000.]
}

 
doCommand {set s [scanner bh]}
doCommand {$s open}
doCommand {$s setdpi 200 200}
doCommand {$s settimeout 20 2}
doCommand {$s setduplex 1}
doCommand {$s setmode 1 0 0 0}
doCommand {$s setlimits 1.6 0.0 8.5 11 }
doCommand {$s lock}
doCommand {set pageNum 0}
while {$pageNum >= 0} {
 doCommand { set pageready($pageNum) [time {set adf [$s pageready $pageNum] } ] }
 puts "adf = $adf"
 if {$adf == 1}  {
  doCommand { set scantime($pageNum) [time { set i [$s scanPage Ximage] } ] }
  doCommand { set fname [format "/tmp/hfile%d.tif" $pageNum] }
  doCommand { set savetime($pageNum) [time { $i save $fname tiff CCITT4 } ] }
  doCommand { $i destroy }
  doCommand { incr pageNum 1 }
 } else {
  break
 }
}
set totscanTime 0
set totsaveTime 0
set totprTime 0
for {set i 0} {$i < $pageNum} { incr i} {
 set totscanTime [expr $totscanTime + [calcsec $scantime($i)]]
 set totsaveTime [expr $totsaveTime + [calcsec $savetime($i)]]
 set totprTime [expr $totprTime + [calcsec $pageready($i)]]
 puts "page $i scan time = [calcsec $scantime($i)] save time= [calcsec $savetime($i)] pageready = [calcsec $pageready($i)] "
}
puts "total scan time = $totscanTime seconds"
puts "total save time = $totsaveTime seconds"
puts "total pageready time = $totprTime seconds"

For additional information or assistance, please call Mentalix Technical Support at (972) 423-9377 Ext. 33.