
proc APSAcquireSROrbit {args} {
    set output ""
    set comment "None."

    if {[APSStrictParseArguments {output comment}] || \
          ![string length $output]} {
        return -code error "APSAcquireSROrbit: bad arguments"
    }

    if [catch {APSSRSetIOCAveraging -setParameters 0 -enable 1 \
                 -BPMList {A:P1 A:P2 A:P3 A:P4 B:P5 B:P4 B:P3 B:P2 B:P1}} result] {
        return -code error "APSAcquireSROrbit: $result"
    }

    set tmpFile /tmp/[APSTmpString]
    APSAddToTempFileList $tmpFile 
    set inputDir /home/helios/oagData/sr/orbitArchive/inputFiles
    if [catch \
          {exec sddsvmonitor -steps=1 \
             -rootnames=$inputDir/SROrbit-Rootnames.vmon \
             -suffixes=$inputDir/SROrbit-BPMs.vmon \
             -scalars=$inputDir/orbitScalars.mon $tmpFile
              exec sddsconvert $tmpFile $output \
             -edit=column,*,%/:ms/ms//%/:scdu:ave_sum.VAL/sum/
              exec rm $tmpFile } result] {
        return -code error "APSAcquireSROrbit: $result"
    }
    return -code ok
}
