From e0626f4b6a0b3ccd4db86d09af30c1587dc079d9 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Thu, 26 Feb 2015 10:49:39 +1100 Subject: [PATCH] Improve response of t0_chopper_id command by working around the chopsel IO Box communications problems. --- .../instrument/bilby/config/chopper/chopper.tcl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/site_ansto/instrument/bilby/config/chopper/chopper.tcl b/site_ansto/instrument/bilby/config/chopper/chopper.tcl index ec259b3a..c6f910f1 100644 --- a/site_ansto/instrument/bilby/config/chopper/chopper.tcl +++ b/site_ansto/instrument/bilby/config/chopper/chopper.tcl @@ -5,15 +5,19 @@ namespace eval chopper { } if {$::chopper::sim_mode == false} { - MakeAsyncProtocol std - std sendterminator "0x0D0x0A0" - std replyterminator "0x0D0x0A00x20" - MakeAsyncQueue chopsel std chopsel1-bilby 30000 + MakeAsyncProtocol chopsel_ap + chopsel_ap sendterminator "0x0D0x0A0" + # Append space to reply terminator to match terminator from the 'get master chopper' reply + chopsel_ap replyterminator "0x0D0x0A00x20" + MakeAsyncQueue chopsel chopsel_ap chopsel1-bilby 30000 + # Set timeout to 100ms to improve response for all the other replies that just end with crlf + chopsel timeout 100 + # Send something to get the dopey welcome and help messages out of the way + chopsel send x } ::utility::macro::getset int t0_chopper_id {args} { if {$::chopper::sim_mode == false} { if {$args == ""} { - chopsel send {get master chopper} return "t0_chopper_id = [SplitReply [chopsel send {get master chopper}]]" } else { chopsel send "get master chopper"