From 152d63750791d915787557ba4d18a08a7a54d099 Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Mon, 30 Jul 2012 15:22:31 +1000 Subject: [PATCH] added features r3684 | jgn | 2012-07-30 15:22:31 +1000 (Mon, 30 Jul 2012) | 1 line --- .../pelican/config/beamline/sct_power.tcl | 878 ++++++++++++------ 1 file changed, 617 insertions(+), 261 deletions(-) diff --git a/site_ansto/instrument/pelican/config/beamline/sct_power.tcl b/site_ansto/instrument/pelican/config/beamline/sct_power.tcl index 1f42c272..ac266fd2 100644 --- a/site_ansto/instrument/pelican/config/beamline/sct_power.tcl +++ b/site_ansto/instrument/pelican/config/beamline/sct_power.tcl @@ -36,19 +36,6 @@ namespace eval ::scobj::ag1010 { variable CtrlGetSVER [format %02x 29] variable CtrlGetMEAS [format %02x 30] variable CtrlGetSTA [format %02x 31] - - variable CtrlShowLIMITS [format %02x 2] - variable CtrlShowPAGC [format %02x 3] - variable CtrlShowPMGC [format %02x 4] - variable CtrlShowFREQ [format %02x 5] - variable CtrlShowSKEY [format %02x 7] - variable CtrlShowBurstPar [format %02x 8] - variable CtrlShowSweepPar [format %02x 9] - variable CtrlShowSVER [format %02x 13] - variable CtrlShowMEAS [format %02x 14] - variable CtrlShowSTA [format %02x 15] - - variable CtrlREJ [format %02x 42] } @@ -63,7 +50,7 @@ namespace eval ::scobj::ag1010 { proc ::scobj::ag1010::getValue {tc_root nextState rdPara} { if {[ catch { - set HEAD 96 + set HEAD 0x96 set LEN [lindex $rdPara 0] set CTRL [lindex $rdPara 1] set DATA 0 @@ -72,9 +59,9 @@ proc ::scobj::ag1010::getValue {tc_root nextState rdPara} { if {$LEN < 2} { return -code error "Error in getValue: wrong data length provided." } elseif {$LEN > 2} { - set cmd [format %02s%02x%02x%02x%02x $HEAD $LEN $CTRL $DATA $CRC] + set cmd [format %02x%02x%02x%02x%02x $HEAD $LEN $CTRL $DATA $CRC] } else { - set cmd [format %02s%02x%02x%02x $HEAD $LEN $CTRL $CRC] + set cmd [format %02x%02x%02x%02x $HEAD $LEN $CTRL $CRC] } sct send "$cmd" } message ]} { @@ -95,8 +82,8 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { # tc_root and idx are not being used - however, don't remove so we can use the # same calling mask as for setPoint() or other $wrFunc - #set ns /sics/ag1010 - set ns [sct] + set ns /sics/ag1010 + #set ns [sct] if {[ catch { set HEAD 96 set LEN [lindex $rdPara 0] @@ -117,100 +104,126 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set FreqHz [expr $newPara % 1000] set data [format %04x%04x $Freq $FreqHz] } - "SoftOn" { set data 0x00 - if {$newPara == 1} { - set data [expr $data | 0x80] - } elseif {$newPara != 0} { + "SoftOn" { + if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for SoftKey are {0,1}." + } else { + if {$newPara == 1} { + set data 0x80 + } else { + set data 0 + } } - if {[string match -nocase "on" [hval $ns/SKEY/Key1]} { + + if {[string match -nocase "on" [hval $ns/SKEY/Key1]]} { set data [expr $data | 0x08] } - if {[string match -nocase "on" [hval $ns/SKEY/Key0]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key0]]} { set data [expr $data | 0x04] } - if {[string match -nocase "on" [hval $ns/SKEY/Key2]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key2]]} { set data [expr $data | 0x02] } - if {[string match -nocase "on" [hval $ns/SKEY/Key3]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key3]]} { set data [expr $data | 0x01] } + set data [format %02x $data] } - "Key1" { set data 0x00 - if {$newPara == 1} { - set data [expr $data | 0x08] - } elseif {$newPara != 0} { + "Key1" { if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for Key1 are {0,1}." + } else { + if {$newPara == 1} { + set data 0x08 + } else { + set data 0 + } } - if {[string match -nocase "on" [hval $ns/SKEY/SoftOn]} { + + if {[string match -nocase "Host takes" [hval $ns/SKEY/SoftOn]]} { set data [expr $data | 0x80] } - if {[string match -nocase "on" [hval $ns/SKEY/Key0]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key0]]} { set data [expr $data | 0x04] } - if {[string match -nocase "on" [hval $ns/SKEY/Key2]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key2]]} { set data [expr $data | 0x02] } - if {[string match -nocase "on" [hval $ns/SKEY/Key3]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key3]]} { set data [expr $data | 0x01] } + set data [format %02x $data] } - "Key0" { set data 0x00 - if {$newPara == 1} { - set data [expr $data | 0x04] - } elseif {$newPara != 0} { + "Key0" { if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for Key0 are {0,1}." + } else { + if {$newPara == 1} { + set data 0x04 + } else { + set data 0 + } } - if {[string match -nocase "on" [hval $ns/SKEY/SoftOn]} { + + if {[string match -nocase "Host takes" [hval $ns/SKEY/SoftOn]]} { set data [expr $data | 0x80] } - if {[string match -nocase "on" [hval $ns/SKEY/Key1]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key1]]} { set data [expr $data | 0x08] } - if {[string match -nocase "on" [hval $ns/SKEY/Key2]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key2]]} { set data [expr $data | 0x02] } - if {[string match -nocase "on" [hval $ns/SKEY/Key3]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key3]]} { set data [expr $data | 0x01] } + set data [format %02x $data] } - "Key2" { set data 0x00 - if {$newPara == 1} { - set data [expr $data | 0x02] - } elseif {$newPara != 0} { + "Key2" { if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for Key2 are {0,1}." + } else { + if {$newPara == 1} { + set data 0x02 + } else { + set data 0 + } } - if {[string match -nocase "on" [hval $ns/SKEY/SoftOn]} { + + if {[string match -nocase "Host takes" [hval $ns/SKEY/SoftOn]]} { set data [expr $data | 0x80] } - if {[string match -nocase "on" [hval $ns/SKEY/Key1]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key1]]} { set data [expr $data | 0x08] } - if {[string match -nocase "on" [hval $ns/SKEY/Key0]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key0]]} { set data [expr $data | 0x04] } - if {[string match -nocase "on" [hval $ns/SKEY/Key3]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key3]]} { set data [expr $data | 0x01] } + set data [format %02x $data] } - "Key3" { set data 0x00 - if {$newPara == 1} { - set data [expr $data | 0x01] - } elseif {$newPara != 0} { + "Key3" { if {$newPara > 1 || $newPara < 0} { return -code error "Error in setValue: only allowed input values for Key3 are {0,1}." + } else { + if {$newPara == 1} { + set data 0x01 + } else { + set data 0 + } } - if {[string match -nocase "on" [hval $ns/SKEY/SoftOn]} { + + if {[string match -nocase "Host takes" [hval $ns/SKEY/SoftOn]]} { set data [expr $data | 0x80] } - if {[string match -nocase "on" [hval $ns/SKEY/Key1]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key1]]} { set data [expr $data | 0x08] } - if {[string match -nocase "on" [hval $ns/SKEY/Key0]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key0]]} { set data [expr $data | 0x04] } - if {[string match -nocase "on" [hval $ns/SKEY/Key2]} { + if {[string match -nocase "on" [hval $ns/SKEY/Key2]]} { set data [expr $data | 0x02] } + set data [format %02x $data] } "BurstMode" { if {$newPara<0 || $newPara>3} { return -code error "Error in setValue: only allowed input values for BurstMode are {0,1,2,3}" @@ -221,31 +234,26 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set TimeOfPower [hval $ns/BurstPar/TimeOfPower] set data [format %02x%04x%04x $BurstMode $BRepTime $TimeOfPower] } - "BRepTime" { set BurstMode [hval $ns/BurstPar/BurstMode] - if {[string equal $BurstMode "OFF"]} { - set BurstMode 0 - } elseif {[string equal $BurstMode "Internal Mode ON"} { - set BurstMode 1 - } elseif {[string match "Without Changing" $BurstMode]} { - set BurstMode 2 - } elseif {[string match "External Burst" $BurstMode]} { - } else { - return -code error "Error in setValue: reading invaild BurstMode value." - } + "BRepTime" { + #set BurstMode [hval $ns/BurstPar/BurstMode] + #if {[string match -nocase $BurstMode "Mode OFF"]} { + # set BurstMode 0 + #} elseif {[string match -nocase $BurstMode "Internal Burst"} { + # set BurstMode 1 + #} elseif {[string match -nocase "Without Changing" $BurstMode]} { + # set BurstMode 2 + #} elseif {[string match "External Burst" $BurstMode]} { + # set BurstMode 3 + #} else { + # return -code error "Error in setValue: reading invaild BurstMode value." + #} + + # set mode to Changing Burst Parameters without Chanigng Burst Mode -- 2 + set BurstMode 2 set TimeOfPower [hval $ns/BurstPar/TimeOfPower] set data [format %02x%04x%04x $BurstMode $newPara $TimeOfPower] } - "BTofP" { set BurstMode [hval $ns/BurstPar/BurstMode] - if {[string equal $BurstMode "OFF"]} { - set BurstMode 0 - } elseif {[string equal $BurstMode "Internal Mode ON"} { - set BurstMode 1 - } elseif {[string match "Without Changing" $BurstMode]} { - set BurstMode 2 - } elseif {[string match "External Burst" $BurstMode]} { - } else { - return -code error "Error in setValue: reading invaild BurstMode value." - } + "BTofP" { set BurstMode 2 set BRepTime [hval $ns/BurstPar/BRepTime] set data [format %02x%04x%04x $BurstMode $BRepTime $newPara] } @@ -261,16 +269,20 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set SCyc [hval $ns/SweepPar/SCyc] set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] } - "SStrF" { set SweepMode [hval $ns/SweepPar/SweepMode] - if {[string equal $SweepMode "OFF"]} { - set SweepMode 0 - } elseif {[string equal $SweepMode "ON"} { - set SweepMode 1 - } elseif {[string match "Without Changing" $SweepMode]} { - set SweepMode 2 - } else { - return -code error "Error in setValue: reading invaild SweepMode value." - } + "SStrF" { + #set SweepMode [hval $ns/SweepPar/SweepMode] + #if {[string equal $SweepMode "OFF"]} { + # set SweepMode 0 + #} elseif {[string equal $SweepMode "ON"} { + # set SweepMode 1 + #} elseif {[string match "Without Changing" $SweepMode]} { + # set SweepMode 2 + #} else { + # return -code error "Error in setValue: reading invaild SweepMode value." + #} + + # set mode to "Changing parameters without changing mode - 2 + set SweepMode 2 set SStr [expr $newPara / 1000] set SStrHz [expr $newPara % 1000] set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] @@ -278,16 +290,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set SCyc [hval $ns/SweepPar/SCyc] set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] } - "SSteF" { set SweepMode [hval $ns/SweepPar/SweepMode] - if {[string equal $SweepMode "OFF"]} { - set SweepMode 0 - } elseif {[string equal $SweepMode "ON"} { - set SweepMode 1 - } elseif {[string match "Without Changing" $SweepMode]} { - set SweepMode 2 - } else { - return -code error "Error in setValue: reading invaild SweepMode value." - } + "SSteF" { set SweepMode 2 set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] set SStp [expr $newPara / 1000] @@ -295,16 +298,7 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { set SCyc [hval $ns/SweepPar/SCyc] set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] } - "SSCyc" { set SweepMode [hval $ns/SweepPar/SweepMode] - if {[string equal $SweepMode "OFF"]} { - set SweepMode 0 - } elseif {[string equal $SweepMode "ON"} { - set SweepMode 1 - } elseif {[string match "Without Changing" $SweepMode]} { - set SweepMode 2 - } else { - return -code error "Error in setValue: reading invaild SweepMode value." - } + "SSCyc" { set SweepMode 2 set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] @@ -331,225 +325,226 @@ proc ::scobj::ag1010::setValue {tc_root nextState rdPara wrPara} { proc ::scobj::ag1010::rdValue {} { - variable CtrlShowLIMITS - variable CtrlShowPAGC - variable CtrlShowPMGC - variable CtrlShowFREQ - variable CtrlShowSKEY - variable CtrlShowBurstPar - variable CtrlShowSweepPar - variable CtrlShowSVER - variable CtrlShowMEAS - variable CtrlShowSTA - variable CtrlREJ + ##################################### + # CTRL Codes + # CtrlShowLIMITS 2 + # CtrlShowPAGC 3 + # CtrlShowPMGC 4 + # CtrlShowFREQ 5 + # CtrlShowSKEY 7 + # CtrlShowBurstPar 8 + # CtrlShowSweepPar 9 + # CtrlShowSVER 13 + # CtrlShowMEAS 14 + # CtrlShowSTA 15 + # + # CtrlREJ 42 + ##################################### - #set ns /sics/ag1010 - set ns [sct] + set ns /sics/ag1010 + #set ns [sct] if {[ catch { set data [string trim [sct result] " "] - broadcast "Reading data in rdValue: $data" - set ctrlCode [string range $data 4 5] + set ctrlCode [format %d 0x[string range $data 4 5]] switch -glob $ctrlCode { - - $CtrlREJ { return -code error "Error in rdValue()" + 42 { return -code error "Error in rdValue()" } - $CtrlShowLIMITS { set FPLH [string range $data 6 7] + 2 { set FPLH [string range $data 6 7] set FPLL [string range $data 8 9] set RPLH [string range $data 10 11] set RPLL [string range $data 12 13] - set $ns/limits/ForwardPower [expr 0x$FPLH$FPLL] - set $ns/limits/ReversePower [expr 0x$RPLH$RPLL] + hset $ns/limits/ForwardPower [format %d [expr 0x$FPLH$FPLL]] + hset $ns/limits/ReversePower [format %d [expr 0x$RPLH$RPLL]] } - $CtrlShowPAGC { set AGCPoH [string range $data 6 7] + 3 { set AGCPoH [string range $data 6 7] set AGCPoL [string range $data 8 9] - - set $ns/PAGC [expr 0x$AGCPoH$AGCPoL] + hset $ns/AGC/PAGC [format %d [expr 0x$AGCPoH$AGCPoL]] } - $CtrlShowPMGC { set MGCPoH [string range $data 6 7] + 4 { set MGCPoH [string range $data 6 7] set MGCPoL [string range $data 8 9] - - set $ns/PMGC [expr 0x$MGCPoH$MGCPoL] + hset $ns/MGC/PMGC [format %d [expr 0x$MGCPoH$MGCPoL]] } - $CtrlShowFREQ { set FreqH [string range $data 6 7] + 5 { set FreqH [string range $data 6 7] set FreqL [string range $data 8 9] set FreqHzH [string range $data 10 11] set FreqHzL [string range $data 12 13] - - set Freq [expr 0x$FreqH$FreqL] - set FreqHz [expr 0x$FreqHzH$FreqHzL] - set $ns/FREQ [expr $Freq * 1000 + $FreqHz] + set Freq [format %d [expr 0x$FreqH$FreqL]] + set FreqHz [format %d [expr 0x$FreqHzH$FreqHzL]] + hset $ns/FRE/FREQ [expr $Freq * 1000 + $FreqHz] } - $CtrlShowSKEY { set softKey 0x[string range $data 6 7] + 7 { + set softKey 0x[string range $data 6 7] if {[expr $softKey & 0x80] == 0} { - set $ns/SKEY/SoftOn "Off" + hset $ns/SKEY/SoftOn "Controller takes over the keyboard of controller" } else { - set $ns/SKEY/SoftOn "On" + hset $ns/SKEY/SoftOn "Host takes over the keyboard of controller" } if {[expr $softKey & 0x08] == 0} { - set $ns/SKEY/Key0 "Off" + hset $ns/SKEY/Key1 "Off" } else { - set $ns/SKEY/Key0 "On" + hset $ns/SKEY/Key1 "On" } if {[expr $softKey & 0x04] == 0} { - set $ns/SKEY/Key1 "Off" + hset $ns/SKEY/Key0 "Off" } else { - set $ns/SKEY/Key1 "On" + hset $ns/SKEY/Key0 "On" } if {[expr $softKey & 0x02] == 0} { - set $ns/SKEY/Key2 "Off" + hset $ns/SKEY/Key2 "Off" } else { - set $ns/SKEY/Key2 "On" + hset $ns/SKEY/Key2 "On" } if {[expr $softKey & 0x01] == 0} { - set $ns/SKEY/Key3 "Off" + hset $ns/SKEY/Key3 "Off" } else { - set $ns/SKEY/Key3 "On" + hset $ns/SKEY/Key3 "On" } } - $CtrlShowBurstPar { set SCode [expr 0x[string range $data 6 7]] - if {SCode == 0} { - set $ns/BurstPar/BurstMode "OFF" - } elseif {SCode == 1} { - set $ns/BurstPar/BurstMode "Internal Mode ON" - } elseif {SCode == 2} { - set $ns/BurstPar/BurstMode "Change Burst Parameters Without Changing Burst On/Off" - } elseif {SCode == 3} { - set $ns/BurstPar/BurstMode "External Burst Mode Enable" + 8 { set SCode [format %02x 0x[string range $data 6 7]] + if {$SCode == 0} { + hset $ns/BurstPar/BurstMode "Burst Mode OFF" + } elseif {$SCode == 1} { + hset $ns/BurstPar/BurstMode "Internal Burst Mode ON" + } elseif {$SCode == 2} { + hset $ns/BurstPar/BurstMode "Change Burst Parameters Without Changing Burst On/Off" + } elseif {$SCode == 3} { + hset $ns/BurstPar/BurstMode "External Burst Mode ON" } - + set BRepTH [string range $data 8 9] set BRepTL [string range $data 10 11] - set $ns/BurstPar/BRepTime [expr 0x$BRepTH$BRepTL] - + hset $ns/BurstPar/BRepTime [format %d [expr 0x$BRepTH$BRepTL]] + set BOnTH [string range $data 12 13] set BOnTL [string range $data 14 15] - set $ns/BurstPar/TimeOfPower [expr 0x$BOnTH$BOnTL] + hset $ns/BurstPar/TimeOfPower [format %d [expr 0x$BOnTH$BOnTL]] } - $CtrlShowSweepPar { set SCode [expr 0x[string range $data 6 7]] - if {SCode == 0} { - set $ns/SweepPar/SweepMode "OFF" - } elseif {SCode == 1} { - set $ns/SweepPar/SweepMode "ON" - } elseif {SCode == 2} { - set $ns/SweepPar/SweepMode "Change Sweep Parameters Without Changing Sweep On/Off" + 9 { set SCode [format %02x 0x[string range $data 6 7]] + if {$SCode == 0} { + hset $ns/SweepPar/SweepMode "OFF" + } elseif {$SCode == 1} { + hset $ns/SweepPar/SweepMode "ON" + } elseif {$SCode == 2} { + hset $ns/SweepPar/SweepMode "Change Sweep Parameters Without Changing Sweep On/Off" } - set SStr [expr [string range $data 8 9]] - set SStrHz [expr [string range $data 14 15]] - set $ns/SweepPar/StartFreq [expr $SStr * 1000 + $SStrHz] + set SStr [format %d 0x[string range $data 8 9]] + set SStrHz [format %d 0x[string range $data 14 15]] + hset $ns/SweepPar/StartFreq [expr $SStr * 1000 + $SStrHz] - set SStp [expr [string range $data 10 11]] - set SStpHz [expr [string range $data 16 17]] - set $ns/SweepPar/StepFreq [expr $SStp * 1000 + $SStpHz] + set SStp [format %d 0x[string range $data 10 11]] + set SStpHz [format %d 0x[string range $data 16 17]] + hset $ns/SweepPar/StepFreq [expr $SStp * 1000 + $SStpHz] - set SCyc [expr [string range $data 12 13]] - set $ns/SweepPar/SCyc $SCyc + set SCyc [format %d 0x[string range $data 12 13]] + hset $ns/SweepPar/SCyc $SCyc } - $CtrlShowSVER { set SNH [string range $data 6 7] + 13 { set SNH [string range $data 6 7] set SNL [string range $data 8 9] - set $ns/SVER/SN "$SNH$SNL" + hset $ns/SVER/SN "$SNH$SNL" set SVerH [string range $data 10 11] set SVerL [string range $data 12 13] - set $ns/SVER/SWVersion "$SVerH$SVerL" + hset $ns/SVER/SWVersion "$SVerH$SVerL" set DVerH [string range $data 14 15] set DVerL [string range $data 16 17] - set $ns/SVER/DeviceVersion "$DVerH$DVerL" + hset $ns/SVER/DeviceVersion "$DVerH$DVerL" } - $CtrlShowMEAS { set FPH [string range $data 6 7] - set FPL [string range $data 8 9] - 0t $ns/MEAS/ForwardPower [expr 0x$FPH$FPL] + 14 { + set FPH [string range $data 6 7] + set FPL [string range $data 8 9] + hset $ns/MEAS/ForwardPower [format %d [expr 0x$FPH$FPL]] set RPH [string range $data 10 11] set RPL [string range $data 12 13] - set $ns/MEAS/ReversePower [expr 0x$RPH$RPL] + hset $ns/MEAS/ReversePower [format %d [expr 0x$RPH$RPL]] set TPH [string range $data 18 19] set TPL [string range $data 20 21] - set $ns/MEAS/Temperature [expr 0x$TPH$TPL] + hset $ns/MEAS/Temperature [format %d [expr 0x$TPH$TPL]] } - $CtrlShowSTA { set MainState [expr 0x[string range $data 6 7]] + 15 { set MainState [format %d 0x[string range $data 6 7]] switch $MainState { - "0" {set $ns/STA/MainState "Initialization"} - "1" {set $ns/STA/MainState "Controller is in safe loop"} - "2" {set $ns/STA/MainState "Controller is waiting for RFPowerOn Request in LocalMode"} - "3" {set $ns/STA/MainState "Controller is waiting for confirm of RFPowerOn in LocalMode"} - "4" {set $ns/STA/MainState "Controller is in main loop of the LocalMode"} - "5" {set $ns/STA/MainState "Controller is waiting for RFPowerOn Request in RemoteMode"} - "6" {set $ns/STA/MainState "Controller is waiting for confirm of RFPowerOn in RemoteMode"} - "7" {set $ns/STA/MainState "Controller is in main loop of the RemoteMode"} + "0" {hset $ns/STA/MainState "Initialization"} + "1" {hset $ns/STA/MainState "Controller is in safe loop"} + "2" {hset $ns/STA/MainState "Controller is waiting for RFPowerOn Request in LocalMode"} + "3" {hset $ns/STA/MainState "Controller is waiting for confirm of RFPowerOn in LocalMode"} + "4" {hset $ns/STA/MainState "Controller is in main loop of the LocalMode"} + "5" {hset $ns/STA/MainState "Controller is waiting for RFPowerOn Request in RemoteMode"} + "6" {hset $ns/STA/MainState "Controller is waiting for confirm of RFPowerOn in RemoteMode"} + "7" {hset $ns/STA/MainState "Controller is in main loop of the RemoteMode"} } - set state [string range $data 8 9] + set state 0x[string range $data 8 9] if {[expr $state & 0x80] != 0} { - set $ns/STA/State/FstRemote "RemoteMode" + hset $ns/STA/State/FstRemote "RemoteMode" } else { - set $ns/STA/State/FstRemote "LocalMode" + hset $ns/STA/State/FstRemote "LocalMode" } if {[expr $state & 0x40] != 0} { - set $ns/STA/State/FStExtBurst "External Burst mode ON" + hset $ns/STA/State/FStExtBurst "External Burst mode ON" } else { - set $ns/STA/State/FStExtBurst "External Burst mode OFF" + hset $ns/STA/State/FStExtBurst "External Burst mode OFF" } if {[expr $state & 0x20] != 0} { - set $ns/STA/State/FStRFError "RFError Detected" + hset $ns/STA/State/FStRFError "RFError Detected" } else { - set $ns/STA/State/FStRFError "RFError Not Detected" + hset $ns/STA/State/FStRFError "RFError Not Detected" } if {[expr $state & 0x10] != 0} { - set $ns/STA/State/FStSafetyLP "Error of the Safety Loop Detected" + hset $ns/STA/State/FStSafetyLP "Error of the Safety Loop Detected" } else { - set $ns/STA/State/FStSafetyLP "Error of the Safety Loop Not Detected" + hset $ns/STA/State/FStSafetyLP "Error of the Safety Loop Not Detected" } if {[expr $state & 0x04] != 0} { - set $ns/STA/State/FStExceedRP "Limited of the ReversePower Detected" + hset $ns/STA/State/FStExceedRP "Limited of the ReversePower Detected" } else { - set $ns/STA/State/FStExceedRP "Limited of the ReversePower Not Detected" + hset $ns/STA/State/FStExceedRP "Limited of the ReversePower Not Detected" } if {[expr $state & 0x02] != 0} { - set $ns/STA/State/FStExceedFP "Limited of the ForwardPower Detected" + hset $ns/STA/State/FStExceedFP "Limited of the ForwardPower Detected" } else { - set $ns/STA/State/FStExceedFP "Limited of the ForwardPower Not Detected" + hset $ns/STA/State/FStExceedFP "Limited of the ForwardPower Not Detected" } if {[expr $state & 0x01] != 0} { - set $ns/STA/State/FStExceedTmp "Temperature Error Detected" + hset $ns/STA/State/FStExceedTmp "Temperature Error Detected" } else { - set $ns/STA/State/FStExceedTmp "Temperature Error Not Detected" + hset $ns/STA/State/FStExceedTmp "Temperature Error Not Detected" } - set KeyState [string range $data 10 11] + set KeyState 0x[string range $data 10 11] if {[expr $KeyState & 0x80] != 0} { - set $ns/STA/keyState/SoftOn "Host takes over the keyboard of controller" + hset $ns/STA/keyState/SoftOn "Host takes over the keyboard of controller" } else { - set $ns/STA/keyState/SoftOn "Controller takes over the keyboard of controller" + hset $ns/STA/keyState/SoftOn "Controller takes over the keyboard of controller" } if {[expr $KeyState & 0x08] != 0} { - set $ns/STA/keyState/Key1 "On" + hset $ns/STA/keyState/Key1 "On" } else { - set $ns/STA/keyState/Key1 "Off" + hset $ns/STA/keyState/Key1 "Off" } if {[expr $KeyState & 0x04] != 0} { - set $ns/STA/keyState/Key0 "On" + hset $ns/STA/keyState/Key0 "On" } else { - set $ns/STA/keyState/Key0 "Off" + hset $ns/STA/keyState/Key0 "Off" } if {[expr $KeyState & 0x02] != 0} { - set $ns/STA/keyState/Key2 "On" + hset $ns/STA/keyState/Key2 "On" } else { - set $ns/STA/keyState/Key2 "Off" + hset $ns/STA/keyState/Key2 "Off" } if {[expr $KeyState & 0x01] != 0} { - set $ns/STA/keyState/Key3 "On" + hset $ns/STA/keyState/Key3 "On" } else { - set $ns/STA/keyState/Key3 "Off" + hset $ns/STA/keyState/Key3 "Off" } } default { return -code error "Unexpected returned values from the device in rdValue()" } } - } message ]} { + } message ]} { return -code error "Error in rdValue: $message." } return idle @@ -557,7 +552,7 @@ proc ::scobj::ag1010::rdValue {} { # function names provided -# @param scobj_hpath string variable holding the path to the object's base node in sics (/sample/tc1) +# @param scobj_hpath string variabie holding the path to the object's base node in sics (/sample/tc1) # @param sct_controller name of the ag1010 scriptcontext object (typically sct_ag1010) # @param cmdGroup subdirectory (below /sample/tc*/) in which the node is to be created # @param varName name of the actual node typically representing one device command @@ -593,22 +588,22 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p "float" {hset $nodeName 0.0} default {hset $nodeName UNKNOWN} } - if {$readable == 1} { - hsetprop $nodeName read ${ns}::getValue $scobj_hpath $rdFunc $rdPara - hsetprop $nodeName $rdFunc ${ns}::$rdFunc - if {$pollEnabled == 1} { - #if {[SplitReply [environment_simulation]]=="false"} { - $sct_controller poll $nodeName - #} + if {$readable == 1} { + hsetprop $nodeName read ${ns}::getValue $scobj_hpath $rdFunc $rdPara + hsetprop $nodeName $rdFunc ${ns}::$rdFunc + if {$pollEnabled == 1} { + if {[SplitReply [environment_simulation]]=="false"} { + $sct_controller poll $nodeName + } } - } + } if {$writable == 1} { hsetprop $nodeName write ${ns}::setValue $scobj_hpath $rdFunc $rdPara $wrPara hsetprop $nodeName $rdFunc ${ns}::$rdFunc if {$pollEnabled == 1} { - #if {[SplitReply [environment_simulation]]=="false"} { + if {[SplitReply [environment_simulation]]=="false"} { $sct_controller write $nodeName - #} + } } } if {1 < [string length $unit]} { @@ -656,12 +651,14 @@ proc ::scobj::ag1010::mkAG {argList} { #makesctcontroller sct_ag1010 rfamp $pa(IP):$pa(PORT) makesctcontroller sct_$pa(NAME) lfgen $pa(IP):$pa(PORT) + ######################################################################################################### + # # Create state machines for the following device commands # Note that drivable nodes require the index of the control loop in their call to halt() # Nodes appear in gumtree in the order in which they are created here. # # Initialise the model-dependent list of supported device commands - # RdWrPlDrIdx + # # cmdGroup subdirectory in which the node is to be created, "P" means under top-parent node # varName name of the actual node typically representing one device command # readable set to 1 if the node represents a query command, 0 if it is not @@ -675,37 +672,43 @@ proc ::scobj::ag1010::mkAG {argList} { # rdFunc nextState Function to be called after the getValue function, typically rdValue() # wrPara actual device field in write command to be sent to the device # allowedValues allowed values for the node data - does not permit other + # + ########################################################################################################### + set deviceCommandToplevel { - P limits 1 0 1 1 none {} user {2 18} {rdValue} {} {} + P limits 1 0 1 1 none {} spy {2 18} {rdValue} {} {} limits ForwardPower 0 0 0 1 int {dW} user {} {} {} {} limits ReversePower 0 0 0 1 int {dW} user {} {} {} {} - P PAGC 1 0 1 1 int {dW} user {2 19} {rdValue} {} {} - P PMGC 1 0 1 1 int {dW} user {2 20} {rdValue} {} {} - P FREQ 1 0 1 1 int {Hz} user {2 21} {rdValue} {} {} - P SKEY 1 0 1 1 int {} user {3 23} {rdValue} {} {} + P AGC 1 0 1 1 none {} user {2 19} {rdValue} {} {} + AGC PAGC 0 0 0 1 int {dW} user {} {} {} {} + P MGC 1 0 1 1 none {} user {2 20} {rdValue} {} {} + MGC PMGC 0 0 0 1 int {dW} user {} {} {} {} + P FRE 1 0 1 1 none {} user {2 21} {rdValue} {} {} + FRE FREQ 0 0 0 1 int {Hz} user {} {} {} {} + P SKEY 1 0 1 1 none {} spy {3 23} {rdValue} {} {} SKEY SoftOn 0 0 0 1 text {} user {} {} {} {} - SKEY Key1 0 0 0 1 int {} user {} {} {} {} - SKEY Key0 0 0 0 1 int {} user {} {} {} {} - SKEY Key2 0 0 0 1 int {} user {} {} {} {} - SKEY Key3 0 0 0 1 int {} user {} {} {} {} - P BurstPar 1 0 1 1 none {} user {2 24} {rdValue} {} {} - BurstPar BurstMode 0 0 0 1 int {} user {} {} {} {} + SKEY Key1 0 0 0 1 text {} user {} {} {} {} + SKEY Key0 0 0 0 1 text {} user {} {} {} {} + SKEY Key2 0 0 0 1 text {} user {} {} {} {} + SKEY Key3 0 0 0 1 text {} user {} {} {} {} + P BurstPar 1 0 1 1 none {} spy {2 24} {rdValue} {} {} + BurstPar BurstMode 0 0 0 1 text {} user {} {} {} {} BurstPar BRepTime 0 0 0 1 int {ms} user {} {} {} {} BurstPar TimeOfPower 0 0 0 1 int {us} user {} {} {} {} - P SweepPar 1 0 1 1 none {} user {2 25} {rdValue} {} {} + P SweepPar 1 0 1 1 none {} spy {2 25} {rdValue} {} {} SweepPar SweepMode 0 0 0 1 text {} user {} {} {} {} SweepPar StartFreq 0 0 0 1 int {Hz} user {} {} {} {} SweepPar StepFreq 0 0 0 1 int {Hz} user {} {} {} {} SweepPar SCyc 0 0 0 1 int {} user {} {} {} {} - P SVER 1 0 1 1 none {} user {2 29} {rdValue} {} {} + P SVER 1 0 1 1 none {} spy {2 29} {rdValue} {} {} SVER SN 0 0 0 1 text {} user {} {} {} {} SVER SWVersion 0 0 0 1 text {} user {} {} {} {} SVER DeviceVersion 0 0 0 1 text {} user {} {} {} {} - P MEAS 1 0 1 1 none {} user {2 30} {rdValue} {} {} + P MEAS 1 0 1 1 none {} spy {2 30} {rdValue} {} {} MEAS ForwardPower 0 0 0 1 int {dW} user {} {} {} {} MEAS ReversePower 0 0 0 1 int {dW} user {} {} {} {} MEAS Temperature 0 0 0 1 int {0C} user {} {} {} {} - P STA 1 0 1 1 none {} user {2 31} {rdValue} {} {} + P STA 1 0 1 1 none {} spy {2 31} {rdValue} {} {} STA MainState 0 0 0 1 text {} user {} {} {} {} STA State 0 0 0 1 int {} user {} {} {} {} STA/State FstRemote 0 0 0 1 text {} user {} {} {} {} @@ -729,12 +732,11 @@ proc ::scobj::ag1010::mkAG {argList} { P SetPAGC 0 1 1 1 int {dW} user {4 3} {rdValue} {PAGC} {} P SetPMGC 0 1 1 1 int {dW} user {4 4} {rdValue} {PMGC} {} P SetFREQ 0 1 1 1 int {Hz} user {6 5} {rdValue} {FREQ} {} - P SetSKEY 0 0 0 1 int {} user {} {} {} {} - SetSKEY SoftOn 0 1 1 1 int {} user {3 7} {rdValue} {SoftOn} {1,0} - SetSKEY Key1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0} - SetSKEY Key0 0 1 1 1 int {} user {3 7} {rdValue} {Key0} {1,0} - SetSKEY Key2 0 1 1 1 int {} user {3 7} {rdValue} {Key2} {1,0} - SetSKEY Key3 0 1 1 1 int {} user {3 7} {rdValue} {Key3} {1,0} + P SetSoftOn 0 1 1 1 int {} user {3 7} {rdValue} {SoftOn} {1,0} + P SetKey1 0 1 1 1 int {} user {3 7} {rdValue} {Key1} {1,0} + P SetKey0 0 1 1 1 int {} user {3 7} {rdValue} {Key0} {1,0} + P SetKey2 0 1 1 1 int {} user {3 7} {rdValue} {Key2} {1,0} + P SetKey3 0 1 1 1 int {} user {3 7} {rdValue} {Key3} {1,0} P SetBurstMode 0 1 1 1 int {} user {7 8} {rdValue} {BurstMode} {0,1,2,3} P SetBRepTime 0 1 1 1 int {ms} user {7 8} {rdValue} {BRepTime} {} P SetBTimeOfPower 0 1 1 1 int {us} user {7 8} {rdValue} {BTofP} {} @@ -755,6 +757,360 @@ proc ::scobj::ag1010::mkAG {argList} { } # end of namespace ::scobj::ag1010::mkAG +# SICS commands + +proc LFSetLimitsFPL {para} { + + set HEAD 0x96 + set LEN 10 + set CTRL 2 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set RPL [hval $ns/limits/ReversePower] + set data [format %04x%04x%04x%04x $newPara $RPL 0 0] + set cmdi [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Forward Power Limits to $newPara dW" + sct_ag1010 send "$cmd" +} + +proc LFSetLimitsRPL {para} { + + set HEAD 0x96 + set LEN 10 + set CTRL 2 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set FPL [hval $ns/limits/ForwardPower] + set data [format %04x%04x%04x%04x $FPL $newPara 0 0] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Reverse Power Limits to $newPara dW" + sct_ag1010 send "$cmd" +} + +proc LFSetPAGC {para} { + + set HEAD 0x96 + set LEN 4 + set CTRL 3 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set data [format %04x $newPara] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Power Level for AGC mode to $newPara dW" + sct_ag1010 send "$cmd" +} + +proc LFSetPMGC {para} { + + set HEAD 0x96 + set LEN 4 + set CTRL 4 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set data [format %04x $newPara] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Power Level for MGC mode to $newPara dW" + sct_ag1010 send "$cmd" +} + +proc LFSetFREQ {para} { + + set HEAD 0x96 + set LEN 6 + set CTRL 5 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set Freq [expr $newPara / 1000] + set FreqHz [expr $newPara % 1000] + set data [format %04x%04x $Freq $FreqHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Frequency to $newPara Hz" + sct_ag1010 send "$cmd" +} + +proc LFSetBurstMode {para} { + + set HEAD 0x96 + set LEN 7 + set CTRL 8 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + if {$newPara<0 || $newPara>3} { + return -code error "Error in setValue: only allowed input values for BurstMode are {0,1,2,3}" + } else { + set BurstMode $newPara + } + set BRepTime [hval $ns/BurstPar/BRepTime] + set TimeOfPower [hval $ns/BurstPar/TimeOfPower] + set data [format %02x%04x%04x $BurstMode $BRepTime $TimeOfPower] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + if {$BurstMode == 0} { + set mode "Set Burst Mode to OFF" + } elseif {$BurstMode == 1} { + set mode "Set Burtst Mode to Internal Mode" + } elseif {$BurstMode == 2} { + set mode "Set Burst Mode to Change Burst Parameters without Changing Burst On/Off" + } else { + set mode "Set Burst Mode to External Mode" + } + + broadcast "$mode" + sct_ag1010 send "$cmd" +} + +proc LFSetBRepTime {para} { + + set HEAD 0x96 + set LEN 7 + set CTRL 8 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set BurstMode 2 + set TimeOfPower [hval $ns/BurstPar/TimeOfPower] + set data [format %02x%04x%04x $BurstMode $newPara $TimeOfPower] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Repetition Period Burst Cycle to $newPara ms" + sct_ag1010 send "$cmd" +} + +proc LFSetBTimeOfPower {para} { + + set HEAD 0x96 + set LEN 7 + set CTRL 8 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + + set BurstMode 2 + set BRepTime [hval $ns/BurstPar/BRepTime] + set data [format %02x%04x%04x $BurstMode $BRepTime $newPara] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Time of Power in Burst Cycle to $newPara us" + sct_ag1010 send "$cmd" +} + +proc LFSetSweep {startF stepF scyc {mode 2} args} { + + if {$mode<0 || $mode>2} { + return -code error "Error in setValue: only allowed input values for SweepMode are {0,1,2}" + } else { + set SweepMode $mode + } + + set HEAD 0x96 + set LEN 13 + set CTRL 9 + set CRC 0 + + set SStr [expr $startF / 1000] + set SStrHz [expr $startF % 1000] + set SStp [expr $stepF / 1000] + set SStpHz [expr $stepF % 1000] + set SCyc $scyc + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Starting Frequency at $startF Hz, step at $stepF Hz and $SCyc steps in full sweep cycle under Sweep mode $SweepMode" + sct_ag1010 send "$cmd" +} + +proc LFSetSweepMode {para} { + + set HEAD 0x96 + set LEN 13 + set CTRL 9 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + if {$newPara<0 || $newPara>2} { + return -code error "Error in setValue: only allowed input values for SweepMode are {0,1,2}" + } else { + set SweepMode $newPara + } + + set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] + set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] + set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] + set SStpHz [expr [hval $ns/SweepPar/StepFreq] % 1000] + set SCyc [hval $ns/SweepPar/SCyc] + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + if {$SweepMode == 0} { + set mode "Turn Off Sweep Mode" + } elseif {$SweepMode == 1} { + set mode "Turn On Sweep Mode" + } else { + set mode "Set Sweep Mode to Change Sweep Mode Parameters Without Changing Sweep Mode On/Off" + } + + broadcast "$mode" + sct_ag1010 send "$cmd" +} + +proc LFSetSStartFreq {para} { + + set HEAD 0x96 + set LEN 13 + set CTRL 9 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + set SweepMode 2 + set SStr [expr $newPara / 1000] + set SStrHz [expr $newPara % 1000] + set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] + set SStpHz [expr [hval $ns/SweepPar/StepFreq] % 1000] + set SCyc [hval $ns/SweepPar/SCyc] + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Start Frequency in Sweep Mode to $newPara Hz" + sct_ag1010 send "$cmd" +} + +proc LFSetSStepFreq {para} { + + set HEAD 0x96 + set LEN 13 + set CTRL 9 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + set SweepMode 2 + set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] + set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] + set SStp [expr $newPara / 1000] + set SStpHz [expr $newPara % 1000] + set SCyc [hval $ns/SweepPar/SCyc] + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Step Frequency in Sweep Mode to $newPara Hz" + sct_ag1010 send "$cmd" +} + +proc LFSetSSCyc {para} { + + set HEAD 0x96 + set LEN 13 + set CTRL 9 + set CRC 0 + + set ns /sics/ag1010 + set newPara [string trim $para " "] + set SweepMode 2 + set SStr [expr [hval $ns/SweepPar/StartFreq] / 1000] + set SStrHz [expr [hval $ns/SweepPar/StartFreq] % 1000] + set SStp [expr [hval $ns/SweepPar/StepFreq] / 1000] + set SStpHz [expr [hval $ns/SweepPar/StepFreq] % 1000] + set SCyc $newPara + set data [format %02x%02x%02x%02x%02x%02x $SweepMode $SStr $SStp $SCyc $SStrHz $SStpHz] + set cmd [format %02x%02x%02x%s%02x $HEAD $LEN $CTRL $data $CRC] + + broadcast "Set Number of Steps in Full Sweep Cycle to $newPara" + sct_ag1010 send "$cmd" +} + +proc LFGetLimits {} { + + broadcast "[hget /sics/ag1010/limits/ForwardPower]" + broadcast "[hget /sics/ag1010/limits/ReversePower]" +} + +proc LFGetPAGC {} { + + broadcast "[hget /sics/ag1010/AGC/PAGC] dW" +} + +proc LFGetPMGC {} { + + broadcast "[hget /sics/ag1010/MGC/PMGC] dW" +} + +proc LFGetFREQ {} { + + broadcast "[hget /sics/ag1010/FRE/FREQ] Hz" +} + +proc LFGetBurstPar {} { + + broadcast "[hget /sics/ag1010/BurstPar/BurstMode]" + broadcast "[hget /sics/ag1010/BurstPar/BRepTime] ms" + broadcast "[hget /sics/ag1010/BurstPar/TimeOfPower] us" +} + +proc LFGetSweepPar {} { + + broadcast "[hget /sics/ag1010/SweepPar/SweepMode]" + broadcast "[hget /sics/ag1010/SweepPar/StartFreq] Hz" + broadcast "[hget /sics/ag1010/SweepPar/StepFreq] Hz" + broadcast "[hget /sics/ag1010/SweepPar/SCyc]" +} + +proc LFGetMEAS {} { + + broadcast "[hget /sics/ag1010/MEAS/ForwardPower]" + broadcast "[hget /sics/ag1010/MEAS/ReversePower]" + broadcast "[hget /sics/ag1010/MEAS/Temperature]" +} + +publish LFSetLimitsFPL user +publish LFSetLimitsRPL user +publish LFSetPAGC user +publish LFSetPMGC user +publish LFSetFREQ user +publish LFSetBurstMode user +publish LFSetBRepTime user +publish LFSetBTimeOfPower user +publish LFSetSweep user +publish LFSetSweepMode user +publish LFSetSStartFreq user +publish LFSetSStepFreq user +publish LFSetSSCyc user + +publish LFGetLimits user +publish LFGetPAGC user +publish LFGetPMGC user +publish LFGetFREQ user +publish LFGetBurstPar user +publish LFGetSweepPar user +publish LFGetMEAS user + + # Main process call # @param name short name for the AG1010 Amplifier/Generator # @param IP IP address of the device (e.g. IP of moxabox that hooks up to the AG1010) @@ -762,11 +1118,11 @@ proc ::scobj::ag1010::mkAG {argList} { # @param turning if the parameter is turnable and can be set from the Gumtree # @internal time internal in polling the nodes -# IP 137.157.202.215 +# IP 137.157.202.219 ::scobj::ag1010::mkAG { name "ag1010" - IP localhost - PORT 50001 + IP 137.157.202.219 + PORT 4001 tuning 1 interval 5 }