S1F1RAre You Online? Sent by Host and Equipment

    # S1F1R Tcl Receive message - add next line to setup
    $spname whenever S1F1 [list recv_S1F1R $spname]

# receive procedure 
proc recv_S1F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S1F1R

S1F2On Line Data Different Host and Equipment Use

    # S1F2 Tcl Parse Equipment reply 
    set reply [secs_xact $spname S1F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 MDLN SOFTREV
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MDLN SOFTREV}
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        return ;# finished ok
        } ;# end while(ok)
    # S1F2 Tcl Parse Host reply
    set reply [secs_xact $spname S1F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:0
        if {$TSN_data ne "L:0"} {set ok 0; break}
        # single token data such as L:0 or U4:0 has been received as expected
        return ;# finished ok
        } ;# end while(ok)

S1F3RSelected Equipment Status Request Sent by Host Only

    # S1F3R Tcl Receive message - add next line to setup
    $spname whenever S1F3 [list recv_S1F3R $spname]

# receive procedure 
proc recv_S1F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n SVID
        # SVID U4:1 (varies)  status variable ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach SVID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $SVID 0] :] {typeSVID lengthSVID}
            set SVID [lindex $SVID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F3R

S1F4Selected Equipment Status Data Sent by Equipment Only

    # S1F4 Tcl Parse reply
    set reply [secs_xact $spname S1F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n SV
        # SV A:n (varies)  status variable value
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach SV [lreplace $TSN_data 0 0] {
            #vset [split [lindex $SV 0] :] {typeSV lengthSV}
            set SV [lindex $SV 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F5RFormatted Status Request Sent by Host Only

    # S1F5R Tcl Receive message - add next line to setup
    $spname whenever S1F5 [list recv_S1F5R $spname]

# receive procedure 
proc recv_S1F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect SFCD
        # SFCD B:1 (always)  status form code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set SFCD [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F5R

S1F6Formatted Status Data Sent by Equipment Only

    # S1F6 Tcl Parse reply
    set reply [secs_xact $spname S1F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n SV
        # SV A:n (varies)  status variable value
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach SV [lreplace $TSN_data 0 0] {
            #vset [split [lindex $SV 0] :] {typeSV lengthSV}
            set SV [lindex $SV 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F7Fixed Form Request Sent by Host Only

    # S1F7 Tcl Receive message - add next line to setup
    $spname whenever S1F7 [list recv_S1F7 $spname]

# receive procedure 
proc recv_S1F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect SFCD
        # SFCD B:1 (always)  status form code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set SFCD [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F7

S1F8Fixed Form Data Sent by Equipment Only

    # S1F8 Tcl Parse reply
    set reply [secs_xact $spname S1F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:2 SVNAME SV0}
        # SVNAME A:n (always)  status variable name
        # SV0 A:0 (varies)  Zero length value used to convey format type
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {SVNAME SV0}
            if {[string first "A:" [lindex $SVNAME 0]] != 0} {set ok 0; break}
            set SVNAME [lindex $SVNAME 1]
            #vset [split [lindex $SV0 0] :] {typeSV0 lengthSV0}
            set SV0 [lindex $SV0 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F9RMaterial Transfer Status Request Sent by Host Only

    # S1F9R Tcl Receive message - add next line to setup
    $spname whenever S1F9 [list recv_S1F9R $spname]

# receive procedure 
proc recv_S1F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F9R

S1F10Material Transfer Status Data Sent by Equipment Only

    # S1F10 Tcl Parse reply
    set reply [secs_xact $spname S1F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TSIP TSOP
        # TSIP (list)B:n (always)  transfer status of input ports
        # TSOP (list)B:n (always)  transfer status of output ports
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TSIP TSOP}
        if {[string first "B:" [lindex $TSIP 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set TSIP {}; foreach v [lreplace $TSIP 0 0] {lappend TSIP [expr {$v}]}
        if {[string first "B:" [lindex $TSOP 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set TSOP {}; foreach v [lreplace $TSOP 0 0] {lappend TSOP [expr {$v}]}
        return ;# finished ok
        } ;# end while(ok)

S1F11RStatus Variable Namelist Request Sent by Host Only

    # S1F11R Tcl Receive message - add next line to setup
    $spname whenever S1F11 [list recv_S1F11R $spname]

# receive procedure 
proc recv_S1F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n SVID
        # SVID U4:1 (varies)  status variable ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach SVID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $SVID 0] :] {typeSVID lengthSVID}
            set SVID [lindex $SVID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F11R

S1F12Status Variable Namelist Reply Sent by Equipment Only

    # S1F12 Tcl Parse reply
    set reply [secs_xact $spname S1F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 SVID SVNAME UNITS}
        # SVID U4:1 (varies)  status variable ID
        # SVNAME A:n (always)  status variable name
        # UNITS A:n (always)  units identifier (see E5 Section 9)
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {SVID SVNAME UNITS}
            #vset [split [lindex $SVID 0] :] {typeSVID lengthSVID}
            set SVID [lindex $SVID 1]
            if {[string first "A:" [lindex $SVNAME 0]] != 0} {set ok 0; break}
            set SVNAME [lindex $SVNAME 1]
            if {[string first "A:" [lindex $UNITS 0]] != 0} {set ok 0; break}
            set UNITS [lindex $UNITS 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F13REstablish Communications Request Different Host and Equipment Use

    # S1F13R Tcl Receive Equipment message - add next line to setupn
    $spname whenever S1F13 [list recv_S1F13R $spname]

# receive procedure 
proc recv_S1F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MDLN SOFTREV
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MDLN SOFTREV}
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S1F13R
    # S1F13R Tcl Receive Host message - add next line to setup
    $spname whenever S1F13 [list recv_S1F13R $spname]

# receive procedure 
proc recv_S1F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:0
        if {$TSN_data ne "L:0"} {set ok 0; break}
        # single token data such as L:0 or U4:0 has been received as expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F13R

S1F14Establish Communications Request Acknowledge Different Host and Equipment Use

    # S1F14 Tcl Parse Equipment reply 
    set reply [secs_xact $spname S1F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 COMMACK {L:2 MDLN SOFTREV}
        # COMMACK B:1 (always)  establish communications acknowledgement code
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {COMMACK L2}
        if {[lindex $COMMACK 0] != "B:1"} {set ok 0; break}
        set COMMACK [expr [lindex $COMMACK 1]]  ;# expr converts 0xhh to int
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {MDLN SOFTREV}
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        return ;# finished ok
        } ;# end while(ok)
    # S1F14 Tcl Parse Host reply
    set reply [secs_xact $spname S1F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 COMMACK L:0
        # COMMACK B:1 (always)  establish communications acknowledgement code
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {COMMACK L0}
        if {[lindex $COMMACK 0] != "B:1"} {set ok 0; break}
        set COMMACK [expr [lindex $COMMACK 1]]  ;# expr converts 0xhh to int
        if {$L0 ne "L:0"} {set ok 0; break}
        # single token data such as L:0 or U4:0 has been received as expected
        return ;# finished ok
        } ;# end while(ok)

S1F15RRequest OFF-LINE Sent by Host Only

    # S1F15R Tcl Receive message - add next line to setup
    $spname whenever S1F15 [list recv_S1F15R $spname]

# receive procedure 
proc recv_S1F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F15R

S1F16OFF-LINE Acknowledge Sent by Equipment Only

    # S1F16 Tcl Parse reply
    set reply [secs_xact $spname S1F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect OFLACK
        # OFLACK B:1 (always)  offline acknowledge, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set OFLACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S1F17RRequest ON-LINE Sent by Host Only

    # S1F17R Tcl Receive message - add next line to setup
    $spname whenever S1F17 [list recv_S1F17R $spname]

# receive procedure 
proc recv_S1F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F17R

S1F18ON-LINE Acknowledge Sent by Equipment Only

    # S1F18 Tcl Parse reply
    set reply [secs_xact $spname S1F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ONLACK
        # ONLACK B:1 (always)  online acknowledge, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ONLACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S1F19RGet Attribute Sent by Host and Equipment

    # S1F19R Tcl Receive message - add next line to setup
    $spname whenever S1F19 [list recv_S1F19R $spname]

# receive procedure 
proc recv_S1F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 OBJTYPE {L:m OBJID} {L:n ATTRID}
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # OBJID A:80 (varies)  E39 object identifier 1-80 chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJTYPE Lm Ln_n1}
        #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
        set OBJTYPE [lindex $OBJTYPE 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach OBJID [lreplace $Lm 0 0] {
            #vset [split [lindex $OBJID 0] :] {typeOBJID lengthOBJID}
            set OBJID [lindex $OBJID 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Ln_n1 0]] != 0} {set ok 0; break}
        foreach ATTRID [lreplace $Ln_n1 0 0] {
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S1F19R

S1F20Attribute Data Sent by Host and Equipment

    # S1F20 Tcl Parse reply
    set reply [secs_xact $spname S1F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:m {L:n ATTRDATA}} {L:p {L:2 ERRCODE ERRTEXT}}
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm Lp_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach Ln_1 [lreplace $Lm 0 0] {
            if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
            foreach ATTRDATA [lreplace $Ln_1 0 0] {
                #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
                set ATTRDATA [lindex $ATTRDATA 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {[string first L: [lindex $Lp_n1 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp_n1 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F21RData Variable Namelist Request Sent by Host Only

    # S1F21R Tcl Receive message - add next line to setup
    $spname whenever S1F21 [list recv_S1F21R $spname]

# receive procedure 
proc recv_S1F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n VID
        # VID A:n (varies)  A variable ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach VID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F21R

S1F22Data Variable Namelist Reply Sent by Equipment Only

    # S1F22 Tcl Parse reply
    set reply [secs_xact $spname S1F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 VID DVVALNAME UNITS}
        # VID A:n (varies)  A variable ID
        # DVVALNAME A:n (always)  a descriptive name for a Data Value variable (DVVAL)
        # UNITS A:n (always)  units identifier (see E5 Section 9)
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {VID DVVALNAME UNITS}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            if {[string first "A:" [lindex $DVVALNAME 0]] != 0} {set ok 0; break}
            set DVVALNAME [lindex $DVVALNAME 1]
            if {[string first "A:" [lindex $UNITS 0]] != 0} {set ok 0; break}
            set UNITS [lindex $UNITS 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S1F23RCollection Event Namelist Request Sent by Host Only

    # S1F23R Tcl Receive message - add next line to setup
    $spname whenever S1F23 [list recv_S1F23R $spname]

# receive procedure 
proc recv_S1F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n CEID
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach CEID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
            set CEID [lindex $CEID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S1F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S1F23R

S1F24Collection Event Namelist Reply Sent by Equipment Only

    # S1F24 Tcl Parse reply
    set reply [secs_xact $spname S1F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 CEID CENAME {L:a VID}}
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # CENAME A:n (always)  a descriptive name for a Data Collection Event
        # VID A:n (varies)  A variable ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {CEID CENAME La_1}
            #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
            set CEID [lindex $CEID 1]
            if {[string first "A:" [lindex $CENAME 0]] != 0} {set ok 0; break}
            set CENAME [lindex $CENAME 1]
            if {[string first L: [lindex $La_1 0]] != 0} {set ok 0; break}
            foreach VID [lreplace $La_1 0 0] {
                #vset [split [lindex $VID 0] :] {typeVID lengthVID}
                set VID [lindex $VID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F13REquipment Constant Request Sent by Host Only

    # S2F13R Tcl Receive message - add next line to setup
    $spname whenever S2F13 [list recv_S2F13R $spname]

# receive procedure 
proc recv_S2F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n ECID
        # ECID U4:1 (varies)  equipment constant ID, GEM requires U4
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach ECID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $ECID 0] :] {typeECID lengthECID}
            set ECID [lindex $ECID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F13R

S2F14Equipment Constant Data Sent by Equipment Only

    # S2F14 Tcl Parse reply
    set reply [secs_xact $spname S2F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n ECV
        # ECV A:n (varies)  equipment constant value, any scalar type (constant is a misnomer)
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach ECV [lreplace $TSN_data 0 0] {
            #vset [split [lindex $ECV 0] :] {typeECV lengthECV}
            set ECV [lindex $ECV 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F15RNew Equipment Constant Send Sent by Host Only

    # S2F15R Tcl Receive message - add next line to setup
    $spname whenever S2F15 [list recv_S2F15R $spname]

# receive procedure 
proc recv_S2F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n {L:2 ECID ECV}
        # ECID U4:1 (varies)  equipment constant ID, GEM requires U4
        # ECV A:n (varies)  equipment constant value, any scalar type (constant is a misnomer)
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {ECID ECV}
            #vset [split [lindex $ECID 0] :] {typeECID lengthECID}
            set ECID [lindex $ECID 1]
            #vset [split [lindex $ECV 0] :] {typeECV lengthECV}
            set ECV [lindex $ECV 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F15R

S2F16New Equipment Constant Ack Sent by Equipment Only

    # S2F16 Tcl Parse reply
    set reply [secs_xact $spname S2F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect EAC
        # EAC B:1 (always)  equipment acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set EAC [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F17RDate and Time Request Sent by Host and Equipment

    # S2F17R Tcl Receive message - add next line to setup
    $spname whenever S2F17 [list recv_S2F17R $spname]

# receive procedure 
proc recv_S2F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S2F17R

S2F18Date and Time Data Sent by Host and Equipment

    # S2F18 Tcl Parse reply
    set reply [secs_xact $spname S2F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect TIME
        # TIME A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set TIME [lindex $TSN_data 1]
        return ;# finished ok
        } ;# end while(ok)

S2F19RReset/Initialize Send Sent by Host Only

    # S2F19R Tcl Receive message - add next line to setup
    $spname whenever S2F19 [list recv_S2F19R $spname]

# receive procedure 
proc recv_S2F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RIC
        # RIC U1:1 (varies)  reset code, 1 means power up reset
        #vset [split [lindex $TSN_data 0] :] {typeRIC lengthRIC}
        set RIC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F19R

S2F20Reset Acknowledge Sent by Equipment Only

    # S2F20 Tcl Parse reply
    set reply [secs_xact $spname S2F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect RAC
        # RAC U1:1 (varies)  reset acknowledge
        #vset [split [lindex $TSN_data 0] :] {typeRAC lengthRAC}
        set RAC [lindex $TSN_data 1]
        return ;# finished ok
        } ;# end while(ok)

S2F21[R]Remote Command Send Sent by Host Only

    # S2F21 Tcl Receive message - add next line to setup
    $spname whenever S2F21 [list recv_S2F21 $spname]

# receive procedure 
proc recv_S2F21 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RCMD
        # RCMD A:n (varies)  remote command, GEM requires a maximum length of 20 printable characters, taken from hex 21-7E (no spaces)
        #vset [split [lindex $TSN_data 0] :] {typeRCMD lengthRCMD}
        set RCMD [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F21

S2F22Remote Command Acknowledge Sent by Equipment Only

    # S2F22 Tcl Parse reply
    set reply [secs_xact $spname S2F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect CMDA
        # CMDA B:1 (always)  command acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set CMDA [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F23RTrace Initialize Send Sent by Host Only

    # S2F23R Tcl Receive message - add next line to setup
    $spname whenever S2F23 [list recv_S2F23R $spname]

# receive procedure 
proc recv_S2F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 TRID DSPER TOTSMP REPGSZ {L:n SVID}
        # TRID A:n (varies)  trace request ID
        # DSPER A:6 (varies)  data sample period, hhmmss is always supported, A:8 hhmmsscc may be supported
        # TOTSMP U4:1 (varies)  total samples to be made, should be an even multiple of REPGSZ
        # REPGSZ U4:1 (varies)  reporting group size, TOTSMP modulo REPGSZ should be 0
        # SVID U4:1 (varies)  status variable ID
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRID DSPER TOTSMP REPGSZ Ln}
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        #vset [split [lindex $DSPER 0] :] {typeDSPER lengthDSPER}
        set DSPER [lindex $DSPER 1]
        #vset [split [lindex $TOTSMP 0] :] {typeTOTSMP lengthTOTSMP}
        set TOTSMP [lindex $TOTSMP 1]
        #vset [split [lindex $REPGSZ 0] :] {typeREPGSZ lengthREPGSZ}
        set REPGSZ [lindex $REPGSZ 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach SVID [lreplace $Ln 0 0] {
            #vset [split [lindex $SVID 0] :] {typeSVID lengthSVID}
            set SVID [lindex $SVID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F23R

S2F24Trace Initialize Acknowledge Sent by Equipment Only

    # S2F24 Tcl Parse reply
    set reply [secs_xact $spname S2F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect TIAACK
        # TIAACK B:1 (always)  trace acknowledgement code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set TIAACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F25RLoopback Diagnostic Request Sent by Host and Equipment

    # S2F25R Tcl Receive message - add next line to setup
    $spname whenever S2F25 [list recv_S2F25R $spname]

# receive procedure 
proc recv_S2F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect ABS
        # ABS (list)B:n (always)  any binary string 
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set ABS {}; foreach v [lreplace $TSN_data 0 0] {lappend ABS [expr {$v}]}
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S2F25R

S2F26Loopback Diagnostic Data Sent by Host and Equipment

    # S2F26 Tcl Parse reply
    set reply [secs_xact $spname S2F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ABS
        # ABS (list)B:n (always)  any binary string 
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set ABS {}; foreach v [lreplace $TSN_data 0 0] {lappend ABS [expr {$v}]}
        return ;# finished ok
        } ;# end while(ok)

S2F27RInitiate Processing Request Sent by Host Only

    # S2F27R Tcl Receive message - add next line to setup
    $spname whenever S2F27 [list recv_S2F27R $spname]

# receive procedure 
proc recv_S2F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 LOC PPID {L:n MID}
        # LOC B:1 (always)  material location code
        # PPID A:80 (varies)  process program ID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {LOC PPID Ln}
        if {[lindex $LOC 0] != "B:1"} {set ok 0; break}
        set LOC [expr [lindex $LOC 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach MID [lreplace $Ln 0 0] {
            #vset [split [lindex $MID 0] :] {typeMID lengthMID}
            set MID [lindex $MID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F27R

S2F28Initiate Processing Acknowledge Sent by Equipment Only

    # S2F28 Tcl Parse reply
    set reply [secs_xact $spname S2F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect CMDA
        # CMDA B:1 (always)  command acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set CMDA [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F29REquipment Constant Namelist Request Sent by Host Only

    # S2F29R Tcl Receive message - add next line to setup
    $spname whenever S2F29 [list recv_S2F29R $spname]

# receive procedure 
proc recv_S2F29R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n ECID
        # ECID U4:1 (varies)  equipment constant ID, GEM requires U4
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach ECID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $ECID 0] :] {typeECID lengthECID}
            set ECID [lindex $ECID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F29R

S2F30Equipment Constant Namelist Sent by Equipment Only

    # S2F30 Tcl Parse reply
    set reply [secs_xact $spname S2F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:6 ECID ECNAME ECMIN ECMAX ECDEF UNITS}
        # ECID U4:1 (varies)  equipment constant ID, GEM requires U4
        # ECNAME A:n (always)  equipment constant name
        # ECMIN A:n (varies)  equipment constant minimum value, any scalar type
        # ECMAX A:n (varies)  equipment constant maximum value, any scalar type
        # ECDEF A:n (varies)  equipment constant default value
        # UNITS A:n (always)  units identifier (see E5 Section 9)
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L6 [lreplace $TSN_data 0 0] {
            if { [lindex $L6 0] != "L:6" } {set ok 0; break}
            vset [lreplace $L6 0 0] {ECID ECNAME ECMIN ECMAX ECDEF UNITS}
            #vset [split [lindex $ECID 0] :] {typeECID lengthECID}
            set ECID [lindex $ECID 1]
            if {[string first "A:" [lindex $ECNAME 0]] != 0} {set ok 0; break}
            set ECNAME [lindex $ECNAME 1]
            #vset [split [lindex $ECMIN 0] :] {typeECMIN lengthECMIN}
            set ECMIN [lindex $ECMIN 1]
            #vset [split [lindex $ECMAX 0] :] {typeECMAX lengthECMAX}
            set ECMAX [lindex $ECMAX 1]
            #vset [split [lindex $ECDEF 0] :] {typeECDEF lengthECDEF}
            set ECDEF [lindex $ECDEF 1]
            if {[string first "A:" [lindex $UNITS 0]] != 0} {set ok 0; break}
            set UNITS [lindex $UNITS 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F31RDate and Time Set Request Sent by Host Only

    # S2F31R Tcl Receive message - add next line to setup
    $spname whenever S2F31 [list recv_S2F31R $spname]

# receive procedure 
proc recv_S2F31R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TIME
        # TIME A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set TIME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F32 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F31R

S2F32Date and Time Set Acknowledge Sent by Equipment Only

    # S2F32 Tcl Parse reply
    set reply [secs_xact $spname S2F31R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect TIACK
        # TIACK B:1 (always)  time set acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set TIACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F33RDefine Report Sent by Host Only

    # S2F33R Tcl Receive message - add next line to setup
    $spname whenever S2F33 [list recv_S2F33R $spname]

# receive procedure 
proc recv_S2F33R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID {L:a {L:2 RPTID {L:b VID}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RPTID U4:1 (varies)  report ID
        # VID A:n (varies)  A variable ID
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lb_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach VID [lreplace $Lb_2 0 0] {
                #vset [split [lindex $VID 0] :] {typeVID lengthVID}
                set VID [lindex $VID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F34 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F33R

S2F34Define Report Acknowledge Sent by Equipment Only

    # S2F34 Tcl Parse reply
    set reply [secs_xact $spname S2F33R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect DRACK
        # DRACK B:1 (always)  define report acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set DRACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F35RLink Event Report Sent by Host Only

    # S2F35R Tcl Receive message - add next line to setup
    $spname whenever S2F35 [list recv_S2F35R $spname]

# receive procedure 
proc recv_S2F35R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID {L:a {L:2 CEID {L:b RPTID}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CEID Lb_2}
            #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
            set CEID [lindex $CEID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach RPTID [lreplace $Lb_2 0 0] {
                #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
                set RPTID [lindex $RPTID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F36 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F35R

S2F36Link Event Report Acknowledge Sent by Equipment Only

    # S2F36 Tcl Parse reply
    set reply [secs_xact $spname S2F35R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect LRACK
        # LRACK B:1 (always)  link report acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set LRACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F37REnable/Disable Event Report Sent by Host Only

    # S2F37R Tcl Receive message - add next line to setup
    $spname whenever S2F37 [list recv_S2F37R $spname]

# receive procedure 
proc recv_S2F37R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 CEED {L:n CEID}
        # CEED TF:1 (always)  collection event or trace enablement, true is enabled
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CEED Ln}
        if {[lindex $CEED 0] != "TF:1"} {set ok 0; break}
        set CEED [lindex $CEED 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach CEID [lreplace $Ln 0 0] {
            #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
            set CEID [lindex $CEID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F38 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F37R

S2F38Enable/Disable Event Report Acknowledge Sent by Equipment Only

    # S2F38 Tcl Parse reply
    set reply [secs_xact $spname S2F37R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ERACK
        # ERACK B:1 (always)  enable/disable event report acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ERACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F39RMulti-block Inquire Sent by Host Only

    # S2F39R Tcl Receive message - add next line to setup
    $spname whenever S2F39 [list recv_S2F39R $spname]

# receive procedure 
proc recv_S2F39R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F40 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F39R

S2F40Multi-block Grant Sent by Equipment Only

    # S2F40 Tcl Parse reply
    set reply [secs_xact $spname S2F39R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S2F41RHost Command Send Sent by Host Only

    # S2F41R Tcl Receive message - add next line to setup
    $spname whenever S2F41 [list recv_S2F41R $spname]

# receive procedure 
proc recv_S2F41R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 RCMD {L:n {L:2 CPNAME CPVAL}}
        # RCMD A:n (varies)  remote command, GEM requires a maximum length of 20 printable characters, taken from hex 21-7E (no spaces)
        # CPNAME A:n (varies)  command parameter name
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCMD Ln}
        #vset [split [lindex $RCMD 0] :] {typeRCMD lengthRCMD}
        set RCMD [lindex $RCMD 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CPVAL}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
            set CPVAL [lindex $CPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F42 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F41R

S2F42Host Command Acknowledge Sent by Equipment Only

    # S2F42 Tcl Parse reply
    set reply [secs_xact $spname S2F41R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 HCACK {L:n {L:2 CPNAME CPACK}}
        # HCACK B:1 (always)  remote command acknowledge
        # CPNAME A:n (varies)  command parameter name
        # CPACK B:1 (always)  remote command parameter acknowledge, only received if error
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HCACK Ln}
        if {[lindex $HCACK 0] != "B:1"} {set ok 0; break}
        set HCACK [expr [lindex $HCACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CPACK}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            if {[lindex $CPACK 0] != "B:1"} {set ok 0; break}
            set CPACK [expr [lindex $CPACK 1]]  ;# expr converts 0xhh to int
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F43RConfigure Spooling Sent by Host Only

    # S2F43R Tcl Receive message - add next line to setup
    $spname whenever S2F43 [list recv_S2F43R $spname]

# receive procedure 
proc recv_S2F43R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:m {L:2 STRID {L:n FCNID}}
        # STRID U1:1 (always)  stream value
        # FCNID U1:1 (always)  message type function value
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {STRID Ln_1}
            if {[lindex $STRID 0] != "U1:1"} {set ok 0; break}
            set STRID [lindex $STRID 1]
            if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
            foreach FCNID [lreplace $Ln_1 0 0] {
                if {[lindex $FCNID 0] != "U1:1"} {set ok 0; break}
                set FCNID [lindex $FCNID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F44 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F43R

S2F44Configure Spooling Acknowledge Sent by Equipment Only

    # S2F44 Tcl Parse reply
    set reply [secs_xact $spname S2F43R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RSPACK {L:m {L:3 STRID STRACK {L:n FCNID}}}
        # RSPACK B:1 (always)  spooling response
        # STRID U1:1 (always)  stream value
        # STRACK B:1 (always)  spooling stream acknowledge
        # FCNID U1:1 (always)  message type function value
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RSPACK Lm}
        if {[lindex $RSPACK 0] != "B:1"} {set ok 0; break}
        set RSPACK [expr [lindex $RSPACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {STRID STRACK Ln_2}
            if {[lindex $STRID 0] != "U1:1"} {set ok 0; break}
            set STRID [lindex $STRID 1]
            if {[lindex $STRACK 0] != "B:1"} {set ok 0; break}
            set STRACK [expr [lindex $STRACK 1]]  ;# expr converts 0xhh to int
            if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
            foreach FCNID [lreplace $Ln_2 0 0] {
                if {[lindex $FCNID 0] != "U1:1"} {set ok 0; break}
                set FCNID [lindex $FCNID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F45RDefine Variable Limit Attributes Sent by Host Only

    # S2F45R Tcl Receive message - add next line to setup
    $spname whenever S2F45 [list recv_S2F45R $spname]

# receive procedure 
proc recv_S2F45R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID {L:m {L:2 VID {L:n {L:2 LIMITID {L:2* UPPERDB LOWERDB}}}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # VID A:n (varies)  A variable ID
        # LIMITID B:1 (always)  identifies a specific limit
        # UPPERDB F4:1 (varies)  the upper bound of a deadband limit
        # LOWERDB F4:1 (varies)  the lower bound of a deadband limit
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID Lm}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {VID Ln_2}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Ln_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {LIMITID L2opt_4}
                if {[lindex $LIMITID 0] != "B:1"} {set ok 0; break}
                set LIMITID [expr [lindex $LIMITID 1]]  ;# expr converts 0xhh to int
                if { [lindex $L2opt_4 0] == "L:2" } {  ;# 2 optional items found
                    vset [lreplace $L2opt_4 0 0] {UPPERDB LOWERDB}
                    #vset [split [lindex $UPPERDB 0] :] {typeUPPERDB lengthUPPERDB}
                    set UPPERDB [lindex $UPPERDB 1]
                    #vset [split [lindex $LOWERDB 0] :] {typeLOWERDB lengthLOWERDB}
                    set LOWERDB [lindex $LOWERDB 1]
                    }
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F46 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F45R

S2F46Define Variable Limit Attributes Acknowledge Sent by Equipment Only

    # S2F46 Tcl Parse reply
    set reply [secs_xact $spname S2F45R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 VLAACK {L:m {L:3 VID LVACK {L:2* LIMITID LIMITACK}}}
        # VLAACK B:1 (always)  variable limit attribute acknowledge
        # VID A:n (varies)  A variable ID
        # LVACK B:1 (always)  variable limit error code
        # LIMITID B:1 (always)  identifies a specific limit
        # LIMITACK B:1 (always)  variable limit value error code
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {VLAACK Lm}
        if {[lindex $VLAACK 0] != "B:1"} {set ok 0; break}
        set VLAACK [expr [lindex $VLAACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {VID LVACK L2opt_2}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            if {[lindex $LVACK 0] != "B:1"} {set ok 0; break}
            set LVACK [expr [lindex $LVACK 1]]  ;# expr converts 0xhh to int
            if { [lindex $L2opt_2 0] == "L:2" } {  ;# 2 optional items found
                vset [lreplace $L2opt_2 0 0] {LIMITID LIMITACK}
                if {[lindex $LIMITID 0] != "B:1"} {set ok 0; break}
                set LIMITID [expr [lindex $LIMITID 1]]  ;# expr converts 0xhh to int
                if {[lindex $LIMITACK 0] != "B:1"} {set ok 0; break}
                set LIMITACK [expr [lindex $LIMITACK 1]]  ;# expr converts 0xhh to int
                }
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F47RVariable Limit Attribute Request Sent by Host Only

    # S2F47R Tcl Receive message - add next line to setup
    $spname whenever S2F47 [list recv_S2F47R $spname]

# receive procedure 
proc recv_S2F47R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:m VID
        # VID A:n (varies)  A variable ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach VID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F48 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F47R

S2F48Variable Limit Attribute Send Sent by Equipment Only

    # S2F48 Tcl Parse reply
    set reply [secs_xact $spname S2F47R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:m {L:2 VID {L:4* UNITS LIMITMIN LIMITMAX {L:n {L:3 LIMITID UPPERDB LOWERDB}}}}
        # VID A:n (varies)  A variable ID
        # UNITS A:n (always)  units identifier (see E5 Section 9)
        # LIMITMIN F4:1 (varies)  The minimum value allowed for the lower dead band limit
        # LIMITMAX F4:1 (varies)  The maximum value allowed for the upper dead band limit
        # LIMITID B:1 (always)  identifies a specific limit
        # UPPERDB F4:1 (varies)  the upper bound of a deadband limit
        # LOWERDB F4:1 (varies)  the lower bound of a deadband limit
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {VID L4opt_1}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            if { [lindex $L4opt_1 0] == "L:4" } {  ;# 4 optional items found
                vset [lreplace $L4opt_1 0 0] {UNITS LIMITMIN LIMITMAX Ln_2}
                if {[string first "A:" [lindex $UNITS 0]] != 0} {set ok 0; break}
                set UNITS [lindex $UNITS 1]
                #vset [split [lindex $LIMITMIN 0] :] {typeLIMITMIN lengthLIMITMIN}
                set LIMITMIN [lindex $LIMITMIN 1]
                #vset [split [lindex $LIMITMAX 0] :] {typeLIMITMAX lengthLIMITMAX}
                set LIMITMAX [lindex $LIMITMAX 1]
                if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
                foreach L3_3 [lreplace $Ln_2 0 0] {
                    if { [lindex $L3_3 0] != "L:3" } {set ok 0; break}
                    vset [lreplace $L3_3 0 0] {LIMITID UPPERDB LOWERDB}
                    if {[lindex $LIMITID 0] != "B:1"} {set ok 0; break}
                    set LIMITID [expr [lindex $LIMITID 1]]  ;# expr converts 0xhh to int
                    #vset [split [lindex $UPPERDB 0] :] {typeUPPERDB lengthUPPERDB}
                    set UPPERDB [lindex $UPPERDB 1]
                    #vset [split [lindex $LOWERDB 0] :] {typeLOWERDB lengthLOWERDB}
                    set LOWERDB [lindex $LOWERDB 1]
                    }
                if {!$ok} break
                }
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S2F49REnhanced Remote Command Sent by Host Only

    # S2F49R Tcl Receive message - add next line to setup
    $spname whenever S2F49 [list recv_S2F49R $spname]

# receive procedure 
proc recv_S2F49R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID OBJSPEC RCMD {L:m {L:2 CPNAME CEPVAL}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # RCMD A:n (varies)  remote command, GEM requires a maximum length of 20 printable characters, taken from hex 21-7E (no spaces)
        # CPNAME A:n (varies)  command parameter name
        # CEPVAL A:n (varies)  an enhanced parameter value, may be a scalar of any type, a list of values of the same type, or a list of possibly nested {L:2 CPNAME CEPVAL}
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC RCMD Lm}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $RCMD 0] :] {typeRCMD lengthRCMD}
        set RCMD [lindex $RCMD 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CEPVAL}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            #vset [split [lindex $CEPVAL 0] :] {typeCEPVAL lengthCEPVAL}
            set CEPVAL [lindex $CEPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S2F50 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S2F49R

S2F50Enhanced Remote Command Acknowledge Sent by Equipment Only

    # S2F50 Tcl Parse reply
    set reply [secs_xact $spname S2F49R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 HCACK {L:n {L:2 CPNAME CEPACK}}
        # HCACK B:1 (always)  remote command acknowledge
        # CPNAME A:n (varies)  command parameter name
        # CEPACK B:1 (always)  command enhanced parameter acknowledge, may be a list or nested list structure to mirror the input structure of a CEPVAL
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HCACK Ln}
        if {[lindex $HCACK 0] != "B:1"} {set ok 0; break}
        set HCACK [expr [lindex $HCACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CEPACK}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            if {[lindex $CEPACK 0] != "B:1"} {set ok 0; break}
            set CEPACK [expr [lindex $CEPACK 1]]  ;# expr converts 0xhh to int
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F1RMaterial Status Request Sent by Host Only

    # S3F1R Tcl Receive message - add next line to setup
    $spname whenever S3F1 [list recv_S3F1R $spname]

# receive procedure 
proc recv_S3F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F1R

S3F2Material Status Data Sent by Equipment Only

    # S3F2 Tcl Parse reply
    set reply [secs_xact $spname S3F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 MF {L:m {L:3 LOC QUA MID}} 
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # LOC B:1 (always)  material location code
        # QUA B:1 (always)  quantity (format limits max to 255!)
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MF Lm}
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {LOC QUA MID}
            if {[lindex $LOC 0] != "B:1"} {set ok 0; break}
            set LOC [expr [lindex $LOC 1]]  ;# expr converts 0xhh to int
            if {[lindex $QUA 0] != "B:1"} {set ok 0; break}
            set QUA [expr [lindex $QUA 1]]  ;# expr converts 0xhh to int
            #vset [split [lindex $MID 0] :] {typeMID lengthMID}
            set MID [lindex $MID 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F3RTime to Completion Data Sent by Host Only

    # S3F3R Tcl Receive message - add next line to setup
    $spname whenever S3F3 [list recv_S3F3R $spname]

# receive procedure 
proc recv_S3F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F3R

S3F4Time to Completion Data Sent by Equipment Only

    # S3F4 Tcl Parse reply
    set reply [secs_xact $spname S3F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 MF {L:m {L:3 TTC QUA MID}}
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # TTC U4:1 (varies)  time to completion, standard does not specify units, in seconds??
        # QUA B:1 (always)  quantity (format limits max to 255!)
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MF Lm}
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {TTC QUA MID}
            #vset [split [lindex $TTC 0] :] {typeTTC lengthTTC}
            set TTC [lindex $TTC 1]
            if {[lindex $QUA 0] != "B:1"} {set ok 0; break}
            set QUA [expr [lindex $QUA 1]]  ;# expr converts 0xhh to int
            #vset [split [lindex $MID 0] :] {typeMID lengthMID}
            set MID [lindex $MID 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F5[R]Material Found Send Sent by Equipment Only

    # S3F5 Tcl Receive message - add next line to setup
    $spname whenever S3F5 [list recv_S3F5 $spname]

# receive procedure 
proc recv_S3F5 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MF QUA
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # QUA B:1 (always)  quantity (format limits max to 255!)
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MF QUA}
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[lindex $QUA 0] != "B:1"} {set ok 0; break}
        set QUA [expr [lindex $QUA 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F5

S3F6Material Found Acknowledge Sent by Host Only

    # S3F6 Tcl Parse reply
    set reply [secs_xact $spname S3F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC3
        # ACKC3 B:1 (always)  acknowledge code, 0 ok 
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC3 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S3F7[R]Material Lost Send Sent by Equipment Only

    # S3F7 Tcl Receive message - add next line to setup
    $spname whenever S3F7 [list recv_S3F7 $spname]

# receive procedure 
proc recv_S3F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 MF QUA MID
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # QUA B:1 (always)  quantity (format limits max to 255!)
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MF QUA MID}
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[lindex $QUA 0] != "B:1"} {set ok 0; break}
        set QUA [expr [lindex $QUA 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F7

S3F8Material Lost Ack Sent by Host Only

    # S3F8 Tcl Parse reply
    set reply [secs_xact $spname S3F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC3
        # ACKC3 B:1 (always)  acknowledge code, 0 ok 
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC3 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S3F9RMatl ID Equate Send Sent by Equipment Only

    # S3F9R Tcl Receive message - add next line to setup
    $spname whenever S3F9 [list recv_S3F9R $spname]

# receive procedure 
proc recv_S3F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MID EMID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # EMID A:16 (varies)  equivalent material ID
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID EMID}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        #vset [split [lindex $EMID 0] :] {typeEMID lengthEMID}
        set EMID [lindex $EMID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F9R

S3F10Matl ID Equate Ack Sent by Host Only

    # S3F10 Tcl Parse reply
    set reply [secs_xact $spname S3F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC3
        # ACKC3 B:1 (always)  acknowledge code, 0 ok 
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC3 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S3F11RMatl ID Request Sent by Equipment Only

    # S3F11R Tcl Receive message - add next line to setup
    $spname whenever S3F11 [list recv_S3F11R $spname]

# receive procedure 
proc recv_S3F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect PTN
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        #vset [split [lindex $TSN_data 0] :] {typePTN lengthPTN}
        set PTN [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F11R

S3F12Matl ID Request Ack Sent by Host Only

    # S3F12 Tcl Parse reply
    set reply [secs_xact $spname S3F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 PTN MIDRA MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MIDRA B:1 (always)  material ID Ack code
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MIDRA MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        if {[lindex $MIDRA 0] != "B:1"} {set ok 0; break}
        set MIDRA [expr [lindex $MIDRA 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        return ;# finished ok
        } ;# end while(ok)

S3F13RMatl ID Send Sent by Host Only

    # S3F13R Tcl Receive message - add next line to setup
    $spname whenever S3F13 [list recv_S3F13R $spname]

# receive procedure 
proc recv_S3F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F13R

S3F14Matl ID Ack Sent by Equipment Only

    # S3F14 Tcl Parse reply
    set reply [secs_xact $spname S3F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect MIDAC
        # MIDAC B:1 (always)  material ID ack
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set MIDAC [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S3F15RMatls Multi-block Inquire Sent by Host Only

    # S3F15R Tcl Receive message - add next line to setup
    $spname whenever S3F15 [list recv_S3F15R $spname]

# receive procedure 
proc recv_S3F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F15R

S3F16Matls Multi-block Grant Sent by Equipment Only

    # S3F16 Tcl Parse reply
    set reply [secs_xact $spname S3F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S3F17RCarrier Action Request Sent by Host Only

    # S3F17R Tcl Receive message - add next line to setup
    $spname whenever S3F17 [list recv_S3F17R $spname]

# receive procedure 
proc recv_S3F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID CARRIERACTION CARRIERID PTN {L:n {L:2 CATTRID CATTRDATA}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CARRIERACTION A:n (always)  carrier action request
        # CARRIERID A:n (always)  carrier ID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # CATTRID A:n (varies)  carrier attribute identifier, E87 requires text per E39.1, Sec 6
        # CATTRDATA A:n (varies)  carrier attribute value (any data type)
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CARRIERACTION CARRIERID PTN Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $CARRIERACTION 0]] != 0} {set ok 0; break}
        set CARRIERACTION [lindex $CARRIERACTION 1]
        if {[string first "A:" [lindex $CARRIERID 0]] != 0} {set ok 0; break}
        set CARRIERID [lindex $CARRIERID 1]
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CATTRID CATTRDATA}
            #vset [split [lindex $CATTRID 0] :] {typeCATTRID lengthCATTRID}
            set CATTRID [lindex $CATTRID 1]
            #vset [split [lindex $CATTRDATA 0] :] {typeCATTRDATA lengthCATTRDATA}
            set CATTRDATA [lindex $CATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F17R

S3F18Carrier Action Ack Sent by Equipment Only

    # S3F18 Tcl Parse reply
    set reply [secs_xact $spname S3F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F19RCancel All Carrier Out Req Sent by Host Only

    # S3F19R Tcl Receive message - add next line to setup
    $spname whenever S3F19 [list recv_S3F19R $spname]

# receive procedure 
proc recv_S3F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F19R

S3F20Cancel All Carrier Out Ack Sent by Equipment Only

    # S3F20 Tcl Parse reply
    set reply [secs_xact $spname S3F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F21RPort Group Defn Sent by Host Only

    # S3F21R Tcl Receive message - add next line to setup
    $spname whenever S3F21 [list recv_S3F21R $spname]

# receive procedure 
proc recv_S3F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 PORTGRPNAME ACCESSMODE {L:n PTN}
        # PORTGRPNAME A:n (always)  name of a group of ports
        # ACCESSMODE U1:1 (always)  load port access mode
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PORTGRPNAME ACCESSMODE Ln}
        if {[string first "A:" [lindex $PORTGRPNAME 0]] != 0} {set ok 0; break}
        set PORTGRPNAME [lindex $PORTGRPNAME 1]
        if {[lindex $ACCESSMODE 0] != "U1:1"} {set ok 0; break}
        set ACCESSMODE [lindex $ACCESSMODE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach PTN [lreplace $Ln 0 0] {
            #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
            set PTN [lindex $PTN 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F21R

S3F22Port Group Defn Ack Sent by Equipment Only

    # S3F22 Tcl Parse reply
    set reply [secs_xact $spname S3F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F23RPort Group Action Req Sent by Host Only

    # S3F23R Tcl Receive message - add next line to setup
    $spname whenever S3F23 [list recv_S3F23R $spname]

# receive procedure 
proc recv_S3F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 PGRPACTION PORTGRPNAME {L:m {L:2 PARAMNAME PARAMVAL}}
        # PGRPACTION A:n (always)  port group command
        # PORTGRPNAME A:n (always)  name of a group of ports
        # PARAMNAME A:n (always)  argument name
        # PARAMVAL A:n (varies)  argument value, can be a list of single type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PGRPACTION PORTGRPNAME Lm}
        if {[string first "A:" [lindex $PGRPACTION 0]] != 0} {set ok 0; break}
        set PGRPACTION [lindex $PGRPACTION 1]
        if {[string first "A:" [lindex $PORTGRPNAME 0]] != 0} {set ok 0; break}
        set PORTGRPNAME [lindex $PORTGRPNAME 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {PARAMNAME PARAMVAL}
            if {[string first "A:" [lindex $PARAMNAME 0]] != 0} {set ok 0; break}
            set PARAMNAME [lindex $PARAMNAME 1]
            #vset [split [lindex $PARAMVAL 0] :] {typePARAMVAL lengthPARAMVAL}
            set PARAMVAL [lindex $PARAMVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F23R

S3F24Port Group Action Ack Sent by Equipment Only

    # S3F24 Tcl Parse reply
    set reply [secs_xact $spname S3F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F25RPort Action Req Sent by Host Only

    # S3F25R Tcl Receive message - add next line to setup
    $spname whenever S3F25 [list recv_S3F25R $spname]

# receive procedure 
proc recv_S3F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 PORTACTION PTN {L:m {L:2 PARAMNAME PARAMVAL}}
        # PORTACTION A:n (always)  action command for a port
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # PARAMNAME A:n (always)  argument name
        # PARAMVAL A:n (varies)  argument value, can be a list of single type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PORTACTION PTN Lm}
        if {[string first "A:" [lindex $PORTACTION 0]] != 0} {set ok 0; break}
        set PORTACTION [lindex $PORTACTION 1]
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {PARAMNAME PARAMVAL}
            if {[string first "A:" [lindex $PARAMNAME 0]] != 0} {set ok 0; break}
            set PARAMNAME [lindex $PARAMNAME 1]
            #vset [split [lindex $PARAMVAL 0] :] {typePARAMVAL lengthPARAMVAL}
            set PARAMVAL [lindex $PARAMVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F25R

S3F26Port Action Ack Sent by Equipment Only

    # S3F26 Tcl Parse reply
    set reply [secs_xact $spname S3F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F27RChange Access Sent by Host Only

    # S3F27R Tcl Receive message - add next line to setup
    $spname whenever S3F27 [list recv_S3F27R $spname]

# receive procedure 
proc recv_S3F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 ACCESSMODE {L:n PTN}
        # ACCESSMODE U1:1 (always)  load port access mode
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACCESSMODE Ln}
        if {[lindex $ACCESSMODE 0] != "U1:1"} {set ok 0; break}
        set ACCESSMODE [lindex $ACCESSMODE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach PTN [lreplace $Ln 0 0] {
            #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
            set PTN [lindex $PTN 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F27R

S3F28Change Access Ack Sent by Equipment Only

    # S3F28 Tcl Parse reply
    set reply [secs_xact $spname S3F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:3 PTN ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {PTN ERRCODE ERRTEXT}
            #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
            set PTN [lindex $PTN 1]
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F29RCarrier Tag Read Req Sent by Host Only

    # S3F29R Tcl Receive message - add next line to setup
    $spname whenever S3F29 [list recv_S3F29R $spname]

# receive procedure 
proc recv_S3F29R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 LOCID CARRIERSPEC DATASEG DATALENGTH
        # LOCID A:n (varies)  logical ID of carrier location, E87 requires text
        # CARRIERSPEC A:n (always)  carrier object specifier (OBJSPEC)
        # DATASEG A:n (varies)  identifies data requested, E87 requires text
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {LOCID CARRIERSPEC DATASEG DATALENGTH}
        #vset [split [lindex $LOCID 0] :] {typeLOCID lengthLOCID}
        set LOCID [lindex $LOCID 1]
        if {[string first "A:" [lindex $CARRIERSPEC 0]] != 0} {set ok 0; break}
        set CARRIERSPEC [lindex $CARRIERSPEC 1]
        #vset [split [lindex $DATASEG 0] :] {typeDATASEG lengthDATASEG}
        set DATASEG [lindex $DATASEG 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F29R

S3F30Carrier Tag Read Data Sent by Equipment Only

    # S3F30 Tcl Parse reply
    set reply [secs_xact $spname S3F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 DATA {L:2 CAACK {L:s {L:2 ERRCODE ERRTEXT}}}
        # DATA A:n (varies)  unformatted data
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATA L2}
        #vset [split [lindex $DATA 0] :] {typeDATA lengthDATA}
        set DATA [lindex $DATA 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {CAACK Ls_1}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ls_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ls_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F31RCarrier Tag Write Data Sent by Host Only

    # S3F31R Tcl Receive message - add next line to setup
    $spname whenever S3F31 [list recv_S3F31R $spname]

# receive procedure 
proc recv_S3F31R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 LOCID CARRIERSPEC DATASEG DATALENGTH DATA
        # LOCID A:n (varies)  logical ID of carrier location, E87 requires text
        # CARRIERSPEC A:n (always)  carrier object specifier (OBJSPEC)
        # DATASEG A:n (varies)  identifies data requested, E87 requires text
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        # DATA A:n (varies)  unformatted data
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {LOCID CARRIERSPEC DATASEG DATALENGTH DATA}
        #vset [split [lindex $LOCID 0] :] {typeLOCID lengthLOCID}
        set LOCID [lindex $LOCID 1]
        if {[string first "A:" [lindex $CARRIERSPEC 0]] != 0} {set ok 0; break}
        set CARRIERSPEC [lindex $CARRIERSPEC 1]
        #vset [split [lindex $DATASEG 0] :] {typeDATASEG lengthDATASEG}
        set DATASEG [lindex $DATASEG 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        #vset [split [lindex $DATA 0] :] {typeDATA lengthDATA}
        set DATA [lindex $DATA 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F32 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S3F31R

S3F32Carrier Tag Write Ack Sent by Equipment Only

    # S3F32 Tcl Parse reply
    set reply [secs_xact $spname S3F31R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:s {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ls}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ls 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ls 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F33Cancel All Pod Out Req Sent by Host and Equipment

    # S3F33 Tcl Receive message - add next line to setup
    $spname whenever S3F33 [list recv_S3F33 $spname]

# receive procedure 
proc recv_S3F33 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F34 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F33

S3F34Cancel All Pod Out Ack Sent by Host and Equipment

    # S3F34 Tcl Parse reply
    set reply [secs_xact $spname S3F33R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 CAACK {L:n {L:2 ERRCODE ERRTEXT}}
        # CAACK U1:1 (always)  carrier action acknowledge 
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CAACK Ln}
        if {[lindex $CAACK 0] != "U1:1"} {set ok 0; break}
        set CAACK [lindex $CAACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S3F35Reticle Transfer Job Req Sent by Host and Equipment

    # S3F35 Tcl Receive message - add next line to setup
    $spname whenever S3F35 [list recv_S3F35 $spname]

# receive procedure 
proc recv_S3F35 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:7 JOBACTION PODID INPTN OUTPTN {L:n {L:2 ATTRID ATTRDATA}} {L:m {L:3 RETICLEID RETREMOVEINSTR {L:r {L:2 ATTRID ATTRDATA}}}} {L:k {L:2 RETICLEID2 RETPLACEINSTR}}
        # JOBACTION A:n (always)  reticle transfer command
        # PODID A:n (always)  OBJSPEC for a Pod instance
        # INPTN B:1 (always)  input material port number
        # OUTPTN B:1 (varies)  output port (PTN)
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # RETICLEID A:n (always)  OBJSPEC value for a reticle
        # RETREMOVEINSTR U1:1 (always)  pod slot reticle remove instruction
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # RETICLEID2 A:n (always)  OBJSPEC value for a second reticle
        # RETPLACEINSTR U1:1 (always)  pod slot reticle place instruction
        if { [lindex $TSN_data 0] != "L:7" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {JOBACTION PODID INPTN OUTPTN Ln Lm_n1 Lk_n2}
        if {[string first "A:" [lindex $JOBACTION 0]] != 0} {set ok 0; break}
        set JOBACTION [lindex $JOBACTION 1]
        if {[string first "A:" [lindex $PODID 0]] != 0} {set ok 0; break}
        set PODID [lindex $PODID 1]
        if {[lindex $INPTN 0] != "B:1"} {set ok 0; break}
        set INPTN [expr [lindex $INPTN 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $OUTPTN 0] :] {typeOUTPTN lengthOUTPTN}
        set OUTPTN [lindex $OUTPTN 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lm_n1 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm_n1 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {RETICLEID RETREMOVEINSTR Lr_2}
            if {[string first "A:" [lindex $RETICLEID 0]] != 0} {set ok 0; break}
            set RETICLEID [lindex $RETICLEID 1]
            if {[lindex $RETREMOVEINSTR 0] != "U1:1"} {set ok 0; break}
            set RETREMOVEINSTR [lindex $RETREMOVEINSTR 1]
            if {[string first L: [lindex $Lr_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Lr_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {ATTRID ATTRDATA}
                #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
                set ATTRID [lindex $ATTRID 1]
                #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
                set ATTRDATA [lindex $ATTRDATA 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {[string first L: [lindex $Lk_n2 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lk_n2 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RETICLEID2 RETPLACEINSTR}
            if {[string first "A:" [lindex $RETICLEID2 0]] != 0} {set ok 0; break}
            set RETICLEID2 [lindex $RETICLEID2 1]
            if {[lindex $RETPLACEINSTR 0] != "U1:1"} {set ok 0; break}
            set RETPLACEINSTR [lindex $RETPLACEINSTR 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S3F36 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S3F35

S3F36Reticle Transfer Job Ack Sent by Host and Equipment

    # S3F36 Tcl Parse reply
    set reply [secs_xact $spname S3F35R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RPMACK {L:n {L:2 ERRCODE ERRTEXT}}
        # RPMACK U1:1 (always)  reticle pod management ack code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RPMACK Ln}
        if {[lindex $RPMACK 0] != "U1:1"} {set ok 0; break}
        set RPMACK [lindex $RPMACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S4F1RReady to Send Materials Sent by Host and Equipment

    # S4F1R Tcl Receive message - add next line to setup
    $spname whenever S4F1 [list recv_S4F1R $spname]

# receive procedure 
proc recv_S4F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F1R

S4F2Ready to Send Ack Sent by Host and Equipment

    # S4F2 Tcl Parse reply
    set reply [secs_xact $spname S4F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect RSACK
        # RSACK B:1 (always)  ready to send acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set RSACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S4F3Send Material Sent by Host and Equipment

    # S4F3 Tcl Receive message - add next line to setup
    $spname whenever S4F3 [list recv_S4F3 $spname]

# receive procedure 
proc recv_S4F3 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F3

S4F5Handshake Complete Sent by Host and Equipment

    # S4F5 Tcl Receive message - add next line to setup
    $spname whenever S4F5 [list recv_S4F5 $spname]

# receive procedure 
proc recv_S4F5 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F5

S4F7Not Ready to Send Sent by Host and Equipment

    # S4F7 Tcl Receive message - add next line to setup
    $spname whenever S4F7 [list recv_S4F7 $spname]

# receive procedure 
proc recv_S4F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F7

S4F9Stuck in Sender Sent by Host and Equipment

    # S4F9 Tcl Receive message - add next line to setup
    $spname whenever S4F9 [list recv_S4F9 $spname]

# receive procedure 
proc recv_S4F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F9

S4F11Stuck in Receiver Sent by Host and Equipment

    # S4F11 Tcl Receive message - add next line to setup
    $spname whenever S4F11 [list recv_S4F11 $spname]

# receive procedure 
proc recv_S4F11 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F11

S4F13Send Incomplete Timeout Sent by Host and Equipment

    # S4F13 Tcl Receive message - add next line to setup
    $spname whenever S4F13 [list recv_S4F13 $spname]

# receive procedure 
proc recv_S4F13 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F13

S4F15Material Received Sent by Host and Equipment

    # S4F15 Tcl Receive message - add next line to setup
    $spname whenever S4F15 [list recv_S4F15 $spname]

# receive procedure 
proc recv_S4F15 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F15

S4F17RRequest to Receive Sent by Host and Equipment

    # S4F17R Tcl Receive message - add next line to setup
    $spname whenever S4F17 [list recv_S4F17R $spname]

# receive procedure 
proc recv_S4F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PTN MID
        # PTN U1:1 (varies)  material port number, E87 shows type U1:1 with data 1-255
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PTN MID}
        #vset [split [lindex $PTN 0] :] {typePTN lengthPTN}
        set PTN [lindex $PTN 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F17R

S4F18Request to Receive Ack Sent by Host and Equipment

    # S4F18 Tcl Parse reply
    set reply [secs_xact $spname S4F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect RRACK
        # RRACK B:1 (always)  request to receive acknowledge
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set RRACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S4F19RTransfer Job Create Sent by Host Only

    # S4F19R Tcl Receive message - add next line to setup
    $spname whenever S4F19 [list recv_S4F19R $spname]

# receive procedure 
proc recv_S4F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID {L:2 TRJOBNAME {L:n {L:12 TRLINK TRPORT TROBJNAME TROBJTYPE TRROLE TRRCP TRPTNR TRPTPORT TRDIR TRTYPE TRLOCATION TRAUTOSTART}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # TRJOBNAME A:80 (always)  host assigned id for transfer job
        # TRLINK U4:1 (varies)  task identifier correlation value
        # TRPORT U4:1 (varies)  port identifier
        # TROBJNAME A:n (varies)  identifies material to be transferred
        # TROBJTYPE U4:1 (varies)  identifies type of object to be transferred
        # TRROLE U1:1 (always)  indicates equipment transfer role
        # TRRCP A:80 (always)  name of transfer recipe for this handoff
        # TRPTNR A:n (always)  EQNAME of transfer partner equipment
        # TRPTPORT U4:1 (varies)  transfer partner port
        # TRDIR U1:1 (always)  transfer direction
        # TRTYPE U1:1 (always)  equipment is active or passive transfer participant
        # TRLOCATION U4:1 (varies)  material transfer location
        # TRAUTOSTART TF:1 (always)  if true material transfer is initiated by the primary when ready
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID L2}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {TRJOBNAME Ln_1}
        if {[string first "A:" [lindex $TRJOBNAME 0]] != 0} {set ok 0; break}
        set TRJOBNAME [lindex $TRJOBNAME 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L12_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L12_2 0] != "L:12" } {set ok 0; break}
            vset [lreplace $L12_2 0 0] {TRLINK TRPORT TROBJNAME TROBJTYPE TRROLE TRRCP TRPTNR TRPTPORT TRDIR TRTYPE TRLOCATION TRAUTOSTART}
            #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
            set TRLINK [lindex $TRLINK 1]
            #vset [split [lindex $TRPORT 0] :] {typeTRPORT lengthTRPORT}
            set TRPORT [lindex $TRPORT 1]
            #vset [split [lindex $TROBJNAME 0] :] {typeTROBJNAME lengthTROBJNAME}
            set TROBJNAME [lindex $TROBJNAME 1]
            #vset [split [lindex $TROBJTYPE 0] :] {typeTROBJTYPE lengthTROBJTYPE}
            set TROBJTYPE [lindex $TROBJTYPE 1]
            if {[lindex $TRROLE 0] != "U1:1"} {set ok 0; break}
            set TRROLE [lindex $TRROLE 1]
            if {[string first "A:" [lindex $TRRCP 0]] != 0} {set ok 0; break}
            set TRRCP [lindex $TRRCP 1]
            if {[string first "A:" [lindex $TRPTNR 0]] != 0} {set ok 0; break}
            set TRPTNR [lindex $TRPTNR 1]
            #vset [split [lindex $TRPTPORT 0] :] {typeTRPTPORT lengthTRPTPORT}
            set TRPTPORT [lindex $TRPTPORT 1]
            if {[lindex $TRDIR 0] != "U1:1"} {set ok 0; break}
            set TRDIR [lindex $TRDIR 1]
            if {[lindex $TRTYPE 0] != "U1:1"} {set ok 0; break}
            set TRTYPE [lindex $TRTYPE 1]
            #vset [split [lindex $TRLOCATION 0] :] {typeTRLOCATION lengthTRLOCATION}
            set TRLOCATION [lindex $TRLOCATION 1]
            if {[lindex $TRAUTOSTART 0] != "TF:1"} {set ok 0; break}
            set TRAUTOSTART [lindex $TRAUTOSTART 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S4F19R

S4F20Transfer Job Acknowledge Sent by Equipment Only

    # S4F20 Tcl Parse reply
    set reply [secs_xact $spname S4F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TRJOBID {L:m TRATOMCID} {L:2 TRACK {L:n {L:2 ERRCODE ERRTEXT}}}
        # TRJOBID B:1 (always)  assigned identifier for transfer job
        # TRATOMCID U4:1 (varies)  assigned identifier for atomic transfer
        # TRACK TF:1 (always)  transfer activity success flag
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRJOBID Lm L2_n1}
        if {[lindex $TRJOBID 0] != "B:1"} {set ok 0; break}
        set TRJOBID [expr [lindex $TRJOBID 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach TRATOMCID [lreplace $Lm 0 0] {
            #vset [split [lindex $TRATOMCID 0] :] {typeTRATOMCID lengthTRATOMCID}
            set TRATOMCID [lindex $TRATOMCID 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {TRACK Ln_1}
        if {[lindex $TRACK 0] != "TF:1"} {set ok 0; break}
        set TRACK [lindex $TRACK 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S4F21RTransfer Job Command Sent by Host Only

    # S4F21R Tcl Receive message - add next line to setup
    $spname whenever S4F21 [list recv_S4F21R $spname]

# receive procedure 
proc recv_S4F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 TRJOBID TRCMDNAME {L:n {L:2 CPNAME CPVAL}}
        # TRJOBID B:1 (always)  assigned identifier for transfer job
        # TRCMDNAME A:n (always)  text enum, CANCEL, PAUSE, RESUME, ABORT, STOP, STARTHANDOFF
        # CPNAME A:n (varies)  command parameter name
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRJOBID TRCMDNAME Ln}
        if {[lindex $TRJOBID 0] != "B:1"} {set ok 0; break}
        set TRJOBID [expr [lindex $TRJOBID 1]]  ;# expr converts 0xhh to int
        if {[string first "A:" [lindex $TRCMDNAME 0]] != 0} {set ok 0; break}
        set TRCMDNAME [lindex $TRCMDNAME 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CPVAL}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
            set CPVAL [lindex $CPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S4F21R

S4F22Transfer Job Command Ack Sent by Equipment Only

    # S4F22 Tcl Parse reply
    set reply [secs_xact $spname S4F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TRACK {L:n {L:2 ERRCODE ERRTEXT}}
        # TRACK TF:1 (always)  transfer activity success flag
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRACK Ln}
        if {[lindex $TRACK 0] != "TF:1"} {set ok 0; break}
        set TRACK [lindex $TRACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S4F23[R]Transfer Command Alert Sent by Equipment Only

    # S4F23 Tcl Receive message - add next line to setup
    $spname whenever S4F23 [list recv_S4F23 $spname]

# receive procedure 
proc recv_S4F23 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TRJOBID TRJOBNAME TRJOBMS {L:2 TRACK {L:n {L:2 ERRCODE  ERRTEXT}}}
        # TRJOBID B:1 (always)  assigned identifier for transfer job
        # TRJOBNAME A:80 (always)  host assigned id for transfer job
        # TRJOBMS U1:1 (always)  transfer job milestone
        # TRACK TF:1 (always)  transfer activity success flag
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRJOBID TRJOBNAME TRJOBMS L2}
        if {[lindex $TRJOBID 0] != "B:1"} {set ok 0; break}
        set TRJOBID [expr [lindex $TRJOBID 1]]  ;# expr converts 0xhh to int
        if {[string first "A:" [lindex $TRJOBNAME 0]] != 0} {set ok 0; break}
        set TRJOBNAME [lindex $TRJOBNAME 1]
        if {[lindex $TRJOBMS 0] != "U1:1"} {set ok 0; break}
        set TRJOBMS [lindex $TRJOBMS 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {TRACK Ln_1}
        if {[lindex $TRACK 0] != "TF:1"} {set ok 0; break}
        set TRACK [lindex $TRACK 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F23

S4F24Transfer Alert Ack Sent by Host Only

    # S4F24 Tcl Parse reply
    set reply [secs_xact $spname S4F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S4F25RMulti-block Inquire Sent by Host Only

    # S4F25R Tcl Receive message - add next line to setup
    $spname whenever S4F25 [list recv_S4F25R $spname]

# receive procedure 
proc recv_S4F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S4F25R

S4F26Multi-block Grant Sent by Equipment Only

    # S4F26 Tcl Parse reply
    set reply [secs_xact $spname S4F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S4F27Handoff Ready Sent by Host and Equipment

    # S4F27 Tcl Receive message - add next line to setup
    $spname whenever S4F27 [list recv_S4F27 $spname]

# receive procedure 
proc recv_S4F27 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 EQNAME {L:11 TRLINK TRPORT TROBJNAME TROBJTYPE TRROLE TRPTNR TRPTPORT TRDIR TRTYPE TRLOCATION}
        # EQNAME A:80 (always)  factory assigned equipment identifier
        # TRLINK U4:1 (varies)  task identifier correlation value
        # TRPORT U4:1 (varies)  port identifier
        # TROBJNAME A:n (varies)  identifies material to be transferred
        # TROBJTYPE U4:1 (varies)  identifies type of object to be transferred
        # TRROLE U1:1 (always)  indicates equipment transfer role
        # TRPTNR A:n (always)  EQNAME of transfer partner equipment
        # TRPTPORT U4:1 (varies)  transfer partner port
        # TRDIR U1:1 (always)  transfer direction
        # TRTYPE U1:1 (always)  equipment is active or passive transfer participant
        # TRLOCATION U4:1 (varies)  material transfer location
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EQNAME L11}
        if {[string first "A:" [lindex $EQNAME 0]] != 0} {set ok 0; break}
        set EQNAME [lindex $EQNAME 1]
        if { [lindex $L11 0] != "L:11" } {set ok 0; break}
        vset [lreplace $L11 0 0] {TRLINK TRPORT TROBJNAME TROBJTYPE TRROLE TRPTNR TRPTPORT TRDIR TRTYPE TRLOCATION}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        #vset [split [lindex $TRPORT 0] :] {typeTRPORT lengthTRPORT}
        set TRPORT [lindex $TRPORT 1]
        #vset [split [lindex $TROBJNAME 0] :] {typeTROBJNAME lengthTROBJNAME}
        set TROBJNAME [lindex $TROBJNAME 1]
        #vset [split [lindex $TROBJTYPE 0] :] {typeTROBJTYPE lengthTROBJTYPE}
        set TROBJTYPE [lindex $TROBJTYPE 1]
        if {[lindex $TRROLE 0] != "U1:1"} {set ok 0; break}
        set TRROLE [lindex $TRROLE 1]
        if {[string first "A:" [lindex $TRPTNR 0]] != 0} {set ok 0; break}
        set TRPTNR [lindex $TRPTNR 1]
        #vset [split [lindex $TRPTPORT 0] :] {typeTRPTPORT lengthTRPTPORT}
        set TRPTPORT [lindex $TRPTPORT 1]
        if {[lindex $TRDIR 0] != "U1:1"} {set ok 0; break}
        set TRDIR [lindex $TRDIR 1]
        if {[lindex $TRTYPE 0] != "U1:1"} {set ok 0; break}
        set TRTYPE [lindex $TRTYPE 1]
        #vset [split [lindex $TRLOCATION 0] :] {typeTRLOCATION lengthTRLOCATION}
        set TRLOCATION [lindex $TRLOCATION 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F27

S4F29Handoff Command Sent by Host and Equipment

    # S4F29 Tcl Receive message - add next line to setup
    $spname whenever S4F29 [list recv_S4F29 $spname]

# receive procedure 
proc recv_S4F29 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TRLINK MCINDEX HOCMDNAME {L:n {L:2 CPNAME CPVAL}}
        # TRLINK U4:1 (varies)  task identifier correlation value
        # MCINDEX U4:1 (varies)  correlation value for handoff command 
        # HOCMDNAME A:n (varies)  handoff command identifier
        # CPNAME A:n (varies)  command parameter name
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRLINK MCINDEX HOCMDNAME Ln}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        #vset [split [lindex $MCINDEX 0] :] {typeMCINDEX lengthMCINDEX}
        set MCINDEX [lindex $MCINDEX 1]
        #vset [split [lindex $HOCMDNAME 0] :] {typeHOCMDNAME lengthHOCMDNAME}
        set HOCMDNAME [lindex $HOCMDNAME 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CPVAL}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
            set CPVAL [lindex $CPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F29

S4F31Handoff Command Complete Sent by Host and Equipment

    # S4F31 Tcl Receive message - add next line to setup
    $spname whenever S4F31 [list recv_S4F31 $spname]

# receive procedure 
proc recv_S4F31 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 TRLINK MCINDEX {L:2 HOACK {L:n {L:2 ERRCODE ERRTEXT}}}
        # TRLINK U4:1 (varies)  task identifier correlation value
        # MCINDEX U4:1 (varies)  correlation value for handoff command 
        # HOACK TF:1 (always)  handoff success flag
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRLINK MCINDEX L2}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        #vset [split [lindex $MCINDEX 0] :] {typeMCINDEX lengthMCINDEX}
        set MCINDEX [lindex $MCINDEX 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {HOACK Ln_1}
        if {[lindex $HOACK 0] != "TF:1"} {set ok 0; break}
        set HOACK [lindex $HOACK 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F32 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F31

S4F33Handoff Verified Sent by Host and Equipment

    # S4F33 Tcl Receive message - add next line to setup
    $spname whenever S4F33 [list recv_S4F33 $spname]

# receive procedure 
proc recv_S4F33 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TRLINK {L:2 HOACK {L:n ERRCODE ERRTEXT}} 
        # TRLINK U4:1 (varies)  task identifier correlation value
        # HOACK TF:1 (always)  handoff success flag
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRLINK L2}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {HOACK Ln_1}
        if {[lindex $HOACK 0] != "TF:1"} {set ok 0; break}
        set HOACK [lindex $HOACK 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach {ERRCODE ERRTEXT} [lreplace $Ln_1 0 0] {
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F34 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F33

S4F35Handoff Cancel Ready Sent by Host and Equipment

    # S4F35 Tcl Receive message - add next line to setup
    $spname whenever S4F35 [list recv_S4F35 $spname]

# receive procedure 
proc recv_S4F35 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TRLINK
        # TRLINK U4:1 (varies)  task identifier correlation value
        #vset [split [lindex $TSN_data 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F36 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F35

S4F37Handoff Cancel Ready Ack Sent by Host and Equipment

    # S4F37 Tcl Receive message - add next line to setup
    $spname whenever S4F37 [list recv_S4F37 $spname]

# receive procedure 
proc recv_S4F37 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TRLINK HOCANCELACK
        # TRLINK U4:1 (varies)  task identifier correlation value
        # HOCANCELACK U1:1 (always)  hand off cancel ack
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRLINK HOCANCELACK}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        if {[lindex $HOCANCELACK 0] != "U1:1"} {set ok 0; break}
        set HOCANCELACK [lindex $HOCANCELACK 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F38 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F37

S4F39Handoff Halt Sent by Host and Equipment

    # S4F39 Tcl Receive message - add next line to setup
    $spname whenever S4F39 [list recv_S4F39 $spname]

# receive procedure 
proc recv_S4F39 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TRLINK
        # TRLINK U4:1 (varies)  task identifier correlation value
        #vset [split [lindex $TSN_data 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F40 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F39

S4F41Handoff Halt Ack Sent by Host and Equipment

    # S4F41 Tcl Receive message - add next line to setup
    $spname whenever S4F41 [list recv_S4F41 $spname]

# receive procedure 
proc recv_S4F41 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TRLINK HOHALTACK
        # TRLINK U4:1 (varies)  task identifier correlation value
        # HOHALTACK U1:1 (always)  hand off halt ack
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRLINK HOHALTACK}
        #vset [split [lindex $TRLINK 0] :] {typeTRLINK lengthTRLINK}
        set TRLINK [lindex $TRLINK 1]
        if {[lindex $HOHALTACK 0] != "U1:1"} {set ok 0; break}
        set HOHALTACK [lindex $HOHALTACK 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S4F42 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S4F41

S5F1[R]Alarm Report Send Sent by Equipment Only

    # S5F1 Tcl Receive message - add next line to setup
    $spname whenever S5F1 [list recv_S5F1 $spname]

# receive procedure 
proc recv_S5F1 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 ALCD ALID ALTX
        # ALCD B:1 (always)  alarm code byte, >= 128 alarm is set, bit field use is deprecated
        # ALID U4:1 (varies)  Alarm type ID
        # ALTX A:120 (always)  alarm text, the length limit was recently raised from 40
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ALCD ALID ALTX}
        if {[lindex $ALCD 0] != "B:1"} {set ok 0; break}
        set ALCD [expr [lindex $ALCD 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $ALID 0] :] {typeALID lengthALID}
        set ALID [lindex $ALID 1]
        if {[string first "A:" [lindex $ALTX 0]] != 0} {set ok 0; break}
        set ALTX [lindex $ALTX 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S5F1

S5F2Alarm Report Ack Sent by Host Only

    # S5F2 Tcl Parse reply
    set reply [secs_xact $spname S5F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC5
        # ACKC5 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC5 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S5F3[R]Enable/Disable Alarm Send Sent by Host Only

    # S5F3 Tcl Receive message - add next line to setup
    $spname whenever S5F3 [list recv_S5F3 $spname]

# receive procedure 
proc recv_S5F3 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 ALED ALID
        # ALED B:1 (always)  enable/disable alarm, 128 means enable, 0 disable
        # ALID U4:1 (varies)  Alarm type ID
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ALED ALID}
        if {[lindex $ALED 0] != "B:1"} {set ok 0; break}
        set ALED [expr [lindex $ALED 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $ALID 0] :] {typeALID lengthALID}
        set ALID [lindex $ALID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S5F3

S5F4Enable/Disable Alarm Ack Sent by Equipment Only

    # S5F4 Tcl Parse reply
    set reply [secs_xact $spname S5F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC5
        # ACKC5 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC5 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S5F5RList Alarms Request Sent by Host Only

    # S5F5R Tcl Receive message - add next line to setup
    $spname whenever S5F5 [list recv_S5F5R $spname]

# receive procedure 
proc recv_S5F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect ALIDVECTOR
        # ALIDVECTOR (list)U4:n (varies)  alarm ID vector
        #vset [split [lindex $TSN_data 0] :] {typeALIDVECTOR lengthALIDVECTOR}
        set ALIDVECTOR [lreplace $TSN_data 0 0]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S5F5R

S5F6List Alarm Data Sent by Equipment Only

    # S5F6 Tcl Parse reply
    set reply [secs_xact $spname S5F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 ALCD ALID ALTX}
        # ALCD B:1 (always)  alarm code byte, >= 128 alarm is set, bit field use is deprecated
        # ALID U4:1 (varies)  Alarm type ID
        # ALTX A:120 (always)  alarm text, the length limit was recently raised from 40
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {ALCD ALID ALTX}
            if {[lindex $ALCD 0] != "B:1"} {set ok 0; break}
            set ALCD [expr [lindex $ALCD 1]]  ;# expr converts 0xhh to int
            #vset [split [lindex $ALID 0] :] {typeALID lengthALID}
            set ALID [lindex $ALID 1]
            if {[string first "A:" [lindex $ALTX 0]] != 0} {set ok 0; break}
            set ALTX [lindex $ALTX 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S5F7RList Enabled Alarm Request Sent by Host Only

    # S5F7R Tcl Receive message - add next line to setup
    $spname whenever S5F7 [list recv_S5F7R $spname]

# receive procedure 
proc recv_S5F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S5F7R

S5F8List Enabled Alarm Data Sent by Equipment Only

    # S5F8 Tcl Parse reply
    set reply [secs_xact $spname S5F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 ALCD ALID ALTX}
        # ALCD B:1 (always)  alarm code byte, >= 128 alarm is set, bit field use is deprecated
        # ALID U4:1 (varies)  Alarm type ID
        # ALTX A:120 (always)  alarm text, the length limit was recently raised from 40
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {ALCD ALID ALTX}
            if {[lindex $ALCD 0] != "B:1"} {set ok 0; break}
            set ALCD [expr [lindex $ALCD 1]]  ;# expr converts 0xhh to int
            #vset [split [lindex $ALID 0] :] {typeALID lengthALID}
            set ALID [lindex $ALID 1]
            if {[string first "A:" [lindex $ALTX 0]] != 0} {set ok 0; break}
            set ALTX [lindex $ALTX 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S5F9[R]Exception Post Notify Sent by Equipment Only

    # S5F9 Tcl Receive message - add next line to setup
    $spname whenever S5F9 [list recv_S5F9 $spname]

# receive procedure 
proc recv_S5F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 TIMESTAMP EXID EXTYPE EXMESSAGE {L:n EXRECVRA}
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # EXID A:20 (always)  exception identifier
        # EXTYPE A:5 (always)  exception type, "ALARM" or "ERROR"
        # EXMESSAGE A:n (always)  exception description
        # EXRECVRA A:40 (always)  exception recovery action description
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TIMESTAMP EXID EXTYPE EXMESSAGE Ln}
        if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
        set TIMESTAMP [lindex $TIMESTAMP 1]
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if {[string first "A:" [lindex $EXTYPE 0]] != 0} {set ok 0; break}
        set EXTYPE [lindex $EXTYPE 1]
        if {[string first "A:" [lindex $EXMESSAGE 0]] != 0} {set ok 0; break}
        set EXMESSAGE [lindex $EXMESSAGE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach EXRECVRA [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $EXRECVRA 0]] != 0} {set ok 0; break}
            set EXRECVRA [lindex $EXRECVRA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S5F9

S5F10Exception Post Confirm Sent by Host Only

    # S5F10 Tcl Parse reply
    set reply [secs_xact $spname S5F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S5F11[R]Exception Clear Notify Sent by Equipment Only

    # S5F11 Tcl Receive message - add next line to setup
    $spname whenever S5F11 [list recv_S5F11 $spname]

# receive procedure 
proc recv_S5F11 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TIMESTAMP EXID EXTYPE EXMESSAGE
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # EXID A:20 (always)  exception identifier
        # EXTYPE A:5 (always)  exception type, "ALARM" or "ERROR"
        # EXMESSAGE A:n (always)  exception description
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TIMESTAMP EXID EXTYPE EXMESSAGE}
        if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
        set TIMESTAMP [lindex $TIMESTAMP 1]
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if {[string first "A:" [lindex $EXTYPE 0]] != 0} {set ok 0; break}
        set EXTYPE [lindex $EXTYPE 1]
        if {[string first "A:" [lindex $EXMESSAGE 0]] != 0} {set ok 0; break}
        set EXMESSAGE [lindex $EXMESSAGE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S5F11

S5F12Exception Clear Confirm Sent by Host Only

    # S5F12 Tcl Parse reply
    set reply [secs_xact $spname S5F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S5F13RException Recover Request Sent by Host Only

    # S5F13R Tcl Receive message - add next line to setup
    $spname whenever S5F13 [list recv_S5F13R $spname]

# receive procedure 
proc recv_S5F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 EXID EXRECVRA
        # EXID A:20 (always)  exception identifier
        # EXRECVRA A:40 (always)  exception recovery action description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EXID EXRECVRA}
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if {[string first "A:" [lindex $EXRECVRA 0]] != 0} {set ok 0; break}
        set EXRECVRA [lindex $EXRECVRA 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S5F13R

S5F14Exception Recover Acknowledge Sent by Equipment Only

    # S5F14 Tcl Parse reply
    set reply [secs_xact $spname S5F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 EXID {L:2 ACKA {L:2* ERRCODE ERRTEXT}}
        # EXID A:20 (always)  exception identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EXID L2}
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA L2opt_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if { [lindex $L2opt_1 0] == "L:2" } {  ;# 2 optional items found
            vset [lreplace $L2opt_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        return ;# finished ok
        } ;# end while(ok)

S5F15[R]Exception Recovery Complete Notify Sent by Equipment Only

    # S5F15 Tcl Receive message - add next line to setup
    $spname whenever S5F15 [list recv_S5F15 $spname]

# receive procedure 
proc recv_S5F15 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 TIMESTAMP EXID {L:2 ACKA {L:2* ERRCODE ERRTEXT}}
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # EXID A:20 (always)  exception identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TIMESTAMP EXID L2}
        if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
        set TIMESTAMP [lindex $TIMESTAMP 1]
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA L2opt_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if { [lindex $L2opt_1 0] == "L:2" } {  ;# 2 optional items found
            vset [lreplace $L2opt_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S5F15

S5F16Exception Recovery Complete Confirm Sent by Host Only

    # S5F16 Tcl Parse reply
    set reply [secs_xact $spname S5F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S5F17RException Recovery Abort Request Sent by Host Only

    # S5F17R Tcl Receive message - add next line to setup
    $spname whenever S5F17 [list recv_S5F17R $spname]

# receive procedure 
proc recv_S5F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect EXID
        # EXID A:20 (always)  exception identifier
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set EXID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S5F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S5F17R

S5F18Exception Recovery Abort Ack Sent by Equipment Only

    # S5F18 Tcl Parse reply
    set reply [secs_xact $spname S5F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 EXID {L:2 ACKA {L:2* ERRCODE ERRTEXT}}
        # EXID A:20 (always)  exception identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EXID L2}
        if {[string first "A:" [lindex $EXID 0]] != 0} {set ok 0; break}
        set EXID [lindex $EXID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA L2opt_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if { [lindex $L2opt_1 0] == "L:2" } {  ;# 2 optional items found
            vset [lreplace $L2opt_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        return ;# finished ok
        } ;# end while(ok)

S6F1[R]Trace Data Send Sent by Equipment Only

    # S6F1 Tcl Receive message - add next line to setup
    $spname whenever S6F1 [list recv_S6F1 $spname]

# receive procedure 
proc recv_S6F1 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TRID SMPLN STIME {L:n SV}
        # TRID A:n (varies)  trace request ID
        # SMPLN U4:1 (varies)  sample number
        # STIME A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # SV A:n (varies)  status variable value
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRID SMPLN STIME Ln}
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        #vset [split [lindex $SMPLN 0] :] {typeSMPLN lengthSMPLN}
        set SMPLN [lindex $SMPLN 1]
        if {[string first "A:" [lindex $STIME 0]] != 0} {set ok 0; break}
        set STIME [lindex $STIME 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach SV [lreplace $Ln 0 0] {
            #vset [split [lindex $SV 0] :] {typeSV lengthSV}
            set SV [lindex $SV 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F1

S6F2Trace Data Ack Sent by Host Only

    # S6F2 Tcl Parse reply
    set reply [secs_xact $spname S6F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F3[R]Discrete Variable Data Send Sent by Equipment Only

    # S6F3 Tcl Receive message - add next line to setup
    $spname whenever S6F3 [list recv_S6F3 $spname]

# receive procedure 
proc recv_S6F3 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID CEID {L:n DSID {L:m {L:2 DVNAME DVVAL}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # DSID A:n (varies)  data set ID, akin to a report type
        # DVNAME U4:1 (varies)  data value name, generically a VID, therefore GEM requires Un type
        # DVVAL A:n (varies)  data value, any format including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach {DSID Lm_1} [lreplace $Ln 0 0] {
            #vset [split [lindex $DSID 0] :] {typeDSID lengthDSID}
            set DSID [lindex $DSID 1]
            if {[string first L: [lindex $Lm_1 0]] != 0} {set ok 0; break}
            foreach L2_2 [lreplace $Lm_1 0 0] {
                if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_2 0 0] {DVNAME DVVAL}
                #vset [split [lindex $DVNAME 0] :] {typeDVNAME lengthDVNAME}
                set DVNAME [lindex $DVNAME 1]
                #vset [split [lindex $DVVAL 0] :] {typeDVVAL lengthDVVAL}
                set DVVAL [lindex $DVVAL 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F3

S6F4Discrete Variable Data Send Ack Sent by Host Only

    # S6F4 Tcl Parse reply
    set reply [secs_xact $spname S6F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F5RMulti-block Data Send Inquire Sent by Equipment Only

    # S6F5R Tcl Receive message - add next line to setup
    $spname whenever S6F5 [list recv_S6F5R $spname]

# receive procedure 
proc recv_S6F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F5R

S6F6Multi-block Grant Sent by Host Only

    # S6F6 Tcl Parse reply
    set reply [secs_xact $spname S6F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT6
        # GRANT6 B:1 (always)  multblock permission grant
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F7RData Transfer Request Sent by Host Only

    # S6F7R Tcl Receive message - add next line to setup
    $spname whenever S6F7 [list recv_S6F7R $spname]

# receive procedure 
proc recv_S6F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DATAID
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        #vset [split [lindex $TSN_data 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F7R

S6F8Data Transfer Data Sent by Equipment Only

    # S6F8 Tcl Parse reply
    set reply [secs_xact $spname S6F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 DATAID CEID {L:n DSID {L:m {L:2 DVNAME DVVAL}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # DSID A:n (varies)  data set ID, akin to a report type
        # DVNAME U4:1 (varies)  data value name, generically a VID, therefore GEM requires Un type
        # DVVAL A:n (varies)  data value, any format including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach {DSID Lm_1} [lreplace $Ln 0 0] {
            #vset [split [lindex $DSID 0] :] {typeDSID lengthDSID}
            set DSID [lindex $DSID 1]
            if {[string first L: [lindex $Lm_1 0]] != 0} {set ok 0; break}
            foreach L2_2 [lreplace $Lm_1 0 0] {
                if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_2 0 0] {DVNAME DVVAL}
                #vset [split [lindex $DVNAME 0] :] {typeDVNAME lengthDVNAME}
                set DVNAME [lindex $DVNAME 1]
                #vset [split [lindex $DVVAL 0] :] {typeDVVAL lengthDVVAL}
                set DVVAL [lindex $DVVAL 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S6F9[R]Formatted Variable Send Sent by Equipment Only

    # S6F9 Tcl Receive message - add next line to setup
    $spname whenever S6F9 [list recv_S6F9 $spname]

# receive procedure 
proc recv_S6F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 PFCD DATAID CEID {L:n {L:2 DSID {L:m DVVAL}}}
        # PFCD B:1 (always)  predefined form selector
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # DSID A:n (varies)  data set ID, akin to a report type
        # DVVAL A:n (varies)  data value, any format including list
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PFCD DATAID CEID Ln}
        if {[lindex $PFCD 0] != "B:1"} {set ok 0; break}
        set PFCD [expr [lindex $PFCD 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {DSID Lm_2}
            #vset [split [lindex $DSID 0] :] {typeDSID lengthDSID}
            set DSID [lindex $DSID 1]
            if {[string first L: [lindex $Lm_2 0]] != 0} {set ok 0; break}
            foreach DVVAL [lreplace $Lm_2 0 0] {
                #vset [split [lindex $DVVAL 0] :] {typeDVVAL lengthDVVAL}
                set DVVAL [lindex $DVVAL 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F9

S6F10Formatted Variable Ack Sent by Host Only

    # S6F10 Tcl Parse reply
    set reply [secs_xact $spname S6F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F11REvent Report Send Sent by Equipment Only

    # S6F11R Tcl Receive message - add next line to setup
    $spname whenever S6F11 [list recv_S6F11R $spname]

# receive procedure 
proc recv_S6F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID CEID {L:a {L:2 RPTID {L:b V}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lb_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach V [lreplace $Lb_2 0 0] {
                #vset [split [lindex $V 0] :] {typeV lengthV}
                set V [lindex $V 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F11R

S6F12Event Report Ack Sent by Host Only

    # S6F12 Tcl Parse reply
    set reply [secs_xact $spname S6F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F13RAnnotated Event Report Send Sent by Equipment Only

    # S6F13R Tcl Receive message - add next line to setup
    $spname whenever S6F13 [list recv_S6F13R $spname]

# receive procedure 
proc recv_S6F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID CEID {L:a {L:2 RPTID {L:b {L:2 VID V}}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        # VID A:n (varies)  A variable ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lb_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Lb_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {VID V}
                #vset [split [lindex $VID 0] :] {typeVID lengthVID}
                set VID [lindex $VID 1]
                #vset [split [lindex $V 0] :] {typeV lengthV}
                set V [lindex $V 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F13R

S6F14Annotated Event Report Ack Sent by Host Only

    # S6F14 Tcl Parse reply
    set reply [secs_xact $spname S6F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F15REvent Report Request Sent by Host Only

    # S6F15R Tcl Receive message - add next line to setup
    $spname whenever S6F15 [list recv_S6F15R $spname]

# receive procedure 
proc recv_S6F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect CEID
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        #vset [split [lindex $TSN_data 0] :] {typeCEID lengthCEID}
        set CEID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F15R

S6F16Event Report Data Sent by Equipment Only

    # S6F16 Tcl Parse reply
    set reply [secs_xact $spname S6F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 DATAID CEID {L:a {L:2 RPTID {L:b V}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lb_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach V [lreplace $Lb_2 0 0] {
                #vset [split [lindex $V 0] :] {typeV lengthV}
                set V [lindex $V 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S6F17RAnnotated Event Report Request Sent by Host Only

    # S6F17R Tcl Receive message - add next line to setup
    $spname whenever S6F17 [list recv_S6F17R $spname]

# receive procedure 
proc recv_S6F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect CEID
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        #vset [split [lindex $TSN_data 0] :] {typeCEID lengthCEID}
        set CEID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F17R

S6F18Annotated Event Report Data Sent by Equipment Only

    # S6F18 Tcl Parse reply
    set reply [secs_xact $spname S6F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 DATAID CEID {L:a {L:2 RPTID {L:b {L:2 VID V}}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        # VID A:n (varies)  A variable ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID CEID La}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lb_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lb_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Lb_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {VID V}
                #vset [split [lindex $VID 0] :] {typeVID lengthVID}
                set VID [lindex $VID 1]
                #vset [split [lindex $V 0] :] {typeV lengthV}
                set V [lindex $V 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S6F19RIndividual Report Request Sent by Host Only

    # S6F19R Tcl Receive message - add next line to setup
    $spname whenever S6F19 [list recv_S6F19R $spname]

# receive procedure 
proc recv_S6F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RPTID
        # RPTID U4:1 (varies)  report ID
        #vset [split [lindex $TSN_data 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F19R

S6F20Individual Report Data Sent by Equipment Only

    # S6F20 Tcl Parse reply
    set reply [secs_xact $spname S6F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n V
        # V A:n (varies)  variable value, any type including list
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach V [lreplace $TSN_data 0 0] {
            #vset [split [lindex $V 0] :] {typeV lengthV}
            set V [lindex $V 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S6F21RAnnotated Individual Report Request Sent by Host Only

    # S6F21R Tcl Receive message - add next line to setup
    $spname whenever S6F21 [list recv_S6F21R $spname]

# receive procedure 
proc recv_S6F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RPTID
        # RPTID U4:1 (varies)  report ID
        #vset [split [lindex $TSN_data 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F21R

S6F22Annotated Individual Report Data Sent by Equipment Only

    # S6F22 Tcl Parse reply
    set reply [secs_xact $spname S6F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:2 VID V}
        # VID A:n (varies)  A variable ID
        # V A:n (varies)  variable value, any type including list
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {VID V}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            #vset [split [lindex $V 0] :] {typeV lengthV}
            set V [lindex $V 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S6F23RRequest or Purge Spooled Data Sent by Host Only

    # S6F23R Tcl Receive message - add next line to setup
    $spname whenever S6F23 [list recv_S6F23R $spname]

# receive procedure 
proc recv_S6F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RSDC
        # RSDC U1:1 (always)  spool request code
        if {[lindex $TSN_data 0] != "U1:1"} {set ok 0; break}
        set RSDC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F23R

S6F24Request or Purge Spooled Data Ack Sent by Equipment Only

    # S6F24 Tcl Parse reply
    set reply [secs_xact $spname S6F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect RSDA
        # RSDA B:1 (always)  spool request reply
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set RSDA [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F25[R]Notification Report Send Sent by Host and Equipment

    # S6F25 Tcl Receive message - add next line to setup
    $spname whenever S6F25 [list recv_S6F25 $spname]

# receive procedure 
proc recv_S6F25 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:7 DATAID OPID LINKID RCPSPEC RMCHGSTAT {L:m {L:2 RCPATTRID RCPATTRDATA}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OPID U4:1 (varies)  operation identifier
        # LINKID U4:1 (always)  correlates the RMOPID value in a request to a completion report
        # RCPSPEC A:n (always)  recipe specifier
        # RMCHGSTAT U4:1 (varies)  object change type
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:7" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OPID LINKID RCPSPEC RMCHGSTAT Lm L2_n1}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[lindex $LINKID 0] != "U4:1"} {set ok 0; break}
        set LINKID [lindex $LINKID 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        #vset [split [lindex $RMCHGSTAT 0] :] {typeRMCHGSTAT lengthRMCHGSTAT}
        set RMCHGSTAT [lindex $RMCHGSTAT 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F25

S6F26Notification Report Send Ack Sent by Host and Equipment

    # S6F26 Tcl Parse reply
    set reply [secs_xact $spname S6F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC6
        # ACKC6 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC6 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S6F27[R]Trace Report Send Sent by Equipment Only

    # S6F27 Tcl Receive message - add next line to setup
    $spname whenever S6F27 [list recv_S6F27 $spname]

# receive procedure 
proc recv_S6F27 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID TRID {L:n {L:p {L:2 RPTID {L:m V}}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # TRID A:n (varies)  trace request ID
        # RPTID U4:1 (varies)  report ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID TRID Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach Lp_1 [lreplace $Ln 0 0] {
            if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
            foreach L2_2 [lreplace $Lp_1 0 0] {
                if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_2 0 0] {RPTID Lm_3}
                #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
                set RPTID [lindex $RPTID 1]
                if {[string first L: [lindex $Lm_3 0]] != 0} {set ok 0; break}
                foreach V [lreplace $Lm_3 0 0] {
                    #vset [split [lindex $V 0] :] {typeV lengthV}
                    set V [lindex $V 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S6F27

S6F28Trace Report Send Ack Sent by Host Only

    # S6F28 Tcl Parse reply
    set reply [secs_xact $spname S6F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect TRID
        # TRID A:n (varies)  trace request ID
        #vset [split [lindex $TSN_data 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TSN_data 1]
        return ;# finished ok
        } ;# end while(ok)

S6F29RTrace Report Request Sent by Host Only

    # S6F29R Tcl Receive message - add next line to setup
    $spname whenever S6F29 [list recv_S6F29R $spname]

# receive procedure 
proc recv_S6F29R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TRID
        # TRID A:n (varies)  trace request ID
        #vset [split [lindex $TSN_data 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S6F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S6F29R

S6F30Trace Report Data Sent by Equipment Only

    # S6F30 Tcl Parse reply
    set reply [secs_xact $spname S6F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TRID {L:n {L:2 RPTID {L:m V}}}
        # TRID A:n (varies)  trace request ID
        # RPTID U4:1 (varies)  report ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRID Ln}
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RPTID Lm_2}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            if {[string first L: [lindex $Lm_2 0]] != 0} {set ok 0; break}
            foreach V [lreplace $Lm_2 0 0] {
                #vset [split [lindex $V 0] :] {typeV lengthV}
                set V [lindex $V 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S7F1RProcess Program Load Inquire Sent by Host and Equipment

    # S7F1R Tcl Receive message - add next line to setup
    $spname whenever S7F1 [list recv_S7F1R $spname]

# receive procedure 
proc recv_S7F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PPID LENGTH
        # PPID A:80 (varies)  process program ID
        # LENGTH U4:1 (always)  program length in bytes
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID LENGTH}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[lindex $LENGTH 0] != "U4:1"} {set ok 0; break}
        set LENGTH [lindex $LENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F1R

S7F2Process Program Load Grant Sent by Host and Equipment

    # S7F2 Tcl Parse reply
    set reply [secs_xact $spname S7F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect PPGNT
        # PPGNT B:1 (always)  process program transfer grant status
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set PPGNT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F3RProcess Program Send Sent by Host and Equipment

    # S7F3R Tcl Receive message - add next line to setup
    $spname whenever S7F3 [list recv_S7F3R $spname]

# receive procedure 
proc recv_S7F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PPID PPBODY
        # PPID A:80 (varies)  process program ID
        # PPBODY (list)B:n (varies)  process program data, any non-list type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID PPBODY}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        #vset [split [lindex $PPBODY 0] :] {typePPBODY lengthPPBODY}
        # convert list of type B 0xhh to int using expr
        set PPBODY {}; foreach v [lreplace $PPBODY 0 0] {lappend PPBODY [expr {$v}]}
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F3R

S7F4Process Program Send Acknowledge Sent by Host and Equipment

    # S7F4 Tcl Parse reply
    set reply [secs_xact $spname S7F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F5RProcess Program Request Sent by Host and Equipment

    # S7F5R Tcl Receive message - add next line to setup
    $spname whenever S7F5 [list recv_S7F5R $spname]

# receive procedure 
proc recv_S7F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect PPID
        # PPID A:80 (varies)  process program ID
        #vset [split [lindex $TSN_data 0] :] {typePPID lengthPPID}
        set PPID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F5R

S7F6Process Program Data Sent by Host and Equipment

    # S7F6 Tcl Parse reply
    set reply [secs_xact $spname S7F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 PPID PPBODY
        # PPID A:80 (varies)  process program ID
        # PPBODY (list)B:n (varies)  process program data, any non-list type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID PPBODY}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        #vset [split [lindex $PPBODY 0] :] {typePPBODY lengthPPBODY}
        # convert list of type B 0xhh to int using expr
        set PPBODY {}; foreach v [lreplace $PPBODY 0 0] {lappend PPBODY [expr {$v}]}
        return ;# finished ok
        } ;# end while(ok)

S7F7RProcess Program ID Request Sent by Equipment Only

    # S7F7R Tcl Receive message - add next line to setup
    $spname whenever S7F7 [list recv_S7F7R $spname]

# receive procedure 
proc recv_S7F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        #vset [split [lindex $TSN_data 0] :] {typeMID lengthMID}
        set MID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F7R

S7F8Process Program ID Data Sent by Host Only

    # S7F8 Tcl Parse reply
    set reply [secs_xact $spname S7F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 PPID MID
        # PPID A:80 (varies)  process program ID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID MID}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        return ;# finished ok
        } ;# end while(ok)

S7F9RMatl/Process Matrix Request Sent by Host and Equipment

    # S7F9R Tcl Receive message - add next line to setup
    $spname whenever S7F9 [list recv_S7F9R $spname]

# receive procedure 
proc recv_S7F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F9R

S7F10Matl/Process Matrix Data Sent by Host and Equipment

    # S7F10 Tcl Parse reply
    set reply [secs_xact $spname S7F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:2 PPID {L:a MID}}
        # PPID A:80 (varies)  process program ID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {PPID La_1}
            #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
            set PPID [lindex $PPID 1]
            if {[string first L: [lindex $La_1 0]] != 0} {set ok 0; break}
            foreach MID [lreplace $La_1 0 0] {
                #vset [split [lindex $MID 0] :] {typeMID lengthMID}
                set MID [lindex $MID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S7F11[R]Matl/Process Matrix Update Send Sent by Host Only

    # S7F11 Tcl Receive message - add next line to setup
    $spname whenever S7F11 [list recv_S7F11 $spname]

# receive procedure 
proc recv_S7F11 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n {L:2 PPID {L:a MID}}
        # PPID A:80 (varies)  process program ID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {PPID La_1}
            #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
            set PPID [lindex $PPID 1]
            if {[string first L: [lindex $La_1 0]] != 0} {set ok 0; break}
            foreach MID [lreplace $La_1 0 0] {
                #vset [split [lindex $MID 0] :] {typeMID lengthMID}
                set MID [lindex $MID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F11

S7F12Matl/Process Matrix Update Ack Sent by Equipment Only

    # S7F12 Tcl Parse reply
    set reply [secs_xact $spname S7F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F13[R]Matl/Process Matrix Delete Entry Send Sent by Host Only

    # S7F13 Tcl Receive message - add next line to setup
    $spname whenever S7F13 [list recv_S7F13 $spname]

# receive procedure 
proc recv_S7F13 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n {L:2 PPID {L:a MID}}
        # PPID A:80 (varies)  process program ID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {PPID La_1}
            #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
            set PPID [lindex $PPID 1]
            if {[string first L: [lindex $La_1 0]] != 0} {set ok 0; break}
            foreach MID [lreplace $La_1 0 0] {
                #vset [split [lindex $MID 0] :] {typeMID lengthMID}
                set MID [lindex $MID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F13

S7F14Delete Matl/Process Matrix Entry Acknowledge Sent by Equipment Only

    # S7F14 Tcl Parse reply
    set reply [secs_xact $spname S7F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F15RMatrix Mode Select Send Sent by Host Only

    # S7F15R Tcl Receive message - add next line to setup
    $spname whenever S7F15 [list recv_S7F15R $spname]

# receive procedure 
proc recv_S7F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MMODE
        # MMODE B:1 (always)  matrix mode selection
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set MMODE [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F15R

S7F16Matrix Mode Select Ack Sent by Equipment Only

    # S7F16 Tcl Parse reply
    set reply [secs_xact $spname S7F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F17RDelete Process Program Send Sent by Host Only

    # S7F17R Tcl Receive message - add next line to setup
    $spname whenever S7F17 [list recv_S7F17R $spname]

# receive procedure 
proc recv_S7F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n PPID
        # PPID A:80 (varies)  process program ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach PPID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
            set PPID [lindex $PPID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F17R

S7F18Delete Process Program Acknowledge Sent by Equipment Only

    # S7F18 Tcl Parse reply
    set reply [secs_xact $spname S7F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F19RCurrent Process Program Dir Request Sent by Host Only

    # S7F19R Tcl Receive message - add next line to setup
    $spname whenever S7F19 [list recv_S7F19R $spname]

# receive procedure 
proc recv_S7F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F19R

S7F20Current Process Program Data Sent by Equipment Only

    # S7F20 Tcl Parse reply
    set reply [secs_xact $spname S7F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n PPID
        # PPID A:80 (varies)  process program ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach PPID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
            set PPID [lindex $PPID 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S7F21Process Capabilities Request Sent by Host Only

    # S7F21 Tcl Receive message - add next line to setup
    $spname whenever S7F21 [list recv_S7F21 $spname]

# receive procedure 
proc recv_S7F21 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F21

S7F22Process Capabilities Data Sent by Equipment Only

    # S7F22 Tcl Parse reply
    set reply [secs_xact $spname S7F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:5 MDLN SOFTREV CMDMAX BYTMAX {L:c {L:11 CCODE CNAME RQCMD BLKDEF BCDS IBCDS NBCDS ACDS IACDS NACDS {L:p L:x}}}
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        # CMDMAX U1:1 (varies)  maximum number of commands allowed, 0=unlimited
        # BYTMAX U4:1 (varies)  process program maximum byte length, 0 means no limit
        # CCODE A:n (varies)  process operation command code
        # CNAME A:16 (always)  text name for a CCODE
        # RQCMD TF:1 (always)  flag that command is required
        # BLKDEF I1:1 (always)  command definition block relationship, standard incorrectly says type U1 is possible
        # BCDS (list)U2:n (varies)  before command code vector
        # IBCDS (list)U2:n (varies)  vector of immediately before command codes
        # NBCDS (list)U2:n (varies)  vector of not before command codes
        # ACDS U2:1 (varies)  after command codes
        # IACDS (list)U2:n (varies)  vector of immediately after command codes
        # NACDS (list)U2:n (varies)  vector of not after command codes
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MDLN SOFTREV CMDMAX BYTMAX Lc}
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        #vset [split [lindex $CMDMAX 0] :] {typeCMDMAX lengthCMDMAX}
        set CMDMAX [lindex $CMDMAX 1]
        #vset [split [lindex $BYTMAX 0] :] {typeBYTMAX lengthBYTMAX}
        set BYTMAX [lindex $BYTMAX 1]
        if {[string first L: [lindex $Lc 0]] != 0} {set ok 0; break}
        foreach L11_1 [lreplace $Lc 0 0] {
            if { [lindex $L11_1 0] != "L:11" } {set ok 0; break}
            vset [lreplace $L11_1 0 0] {CCODE CNAME RQCMD BLKDEF BCDS IBCDS NBCDS ACDS IACDS NACDS Lp_2}
            #vset [split [lindex $CCODE 0] :] {typeCCODE lengthCCODE}
            set CCODE [lindex $CCODE 1]
            if {[string first "A:" [lindex $CNAME 0]] != 0} {set ok 0; break}
            set CNAME [lindex $CNAME 1]
            if {[lindex $RQCMD 0] != "TF:1"} {set ok 0; break}
            set RQCMD [lindex $RQCMD 1]
            if {[lindex $BLKDEF 0] != "I1:1"} {set ok 0; break}
            set BLKDEF [lindex $BLKDEF 1]
            #vset [split [lindex $BCDS 0] :] {typeBCDS lengthBCDS}
            set BCDS [lreplace $BCDS 0 0]
            #vset [split [lindex $IBCDS 0] :] {typeIBCDS lengthIBCDS}
            set IBCDS [lreplace $IBCDS 0 0]
            #vset [split [lindex $NBCDS 0] :] {typeNBCDS lengthNBCDS}
            set NBCDS [lreplace $NBCDS 0 0]
            #vset [split [lindex $ACDS 0] :] {typeACDS lengthACDS}
            set ACDS [lindex $ACDS 1]
            #vset [split [lindex $IACDS 0] :] {typeIACDS lengthIACDS}
            set IACDS [lreplace $IACDS 0 0]
            #vset [split [lindex $NACDS 0] :] {typeNACDS lengthNACDS}
            set NACDS [lreplace $NACDS 0 0]
            if {[string first L: [lindex $Lp_2 0]] != 0} {set ok 0; break}
            foreach Lx_3 [lreplace $Lp_2 0 0] {
                if {$Lx_3 ne "L:x"} {set ok 0; break}
                # single token data such as L:0 or U4:0 has been received as expected
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S7F23RFormatted Process Program Send Sent by Host and Equipment

    # S7F23R Tcl Receive message - add next line to setup
    $spname whenever S7F23 [list recv_S7F23R $spname]

# receive procedure 
proc recv_S7F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 PPID MDLN SOFTREV {L:c {L:2 CCODE {L:p PPARM}}}
        # PPID A:80 (varies)  process program ID
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        # CCODE A:n (varies)  process operation command code
        # PPARM A:n (varies)  process parameter, any scalar or vector
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID MDLN SOFTREV Lc}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        if {[string first L: [lindex $Lc 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lc 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CCODE Lp_2}
            #vset [split [lindex $CCODE 0] :] {typeCCODE lengthCCODE}
            set CCODE [lindex $CCODE 1]
            if {[string first L: [lindex $Lp_2 0]] != 0} {set ok 0; break}
            foreach PPARM [lreplace $Lp_2 0 0] {
                #vset [split [lindex $PPARM 0] :] {typePPARM lengthPPARM}
                set PPARM [lindex $PPARM 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F23R

S7F24Formatted Process Program Acknowledge Sent by Host and Equipment

    # S7F24 Tcl Parse reply
    set reply [secs_xact $spname S7F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F25RFormatted Process Program Request Sent by Host and Equipment

    # S7F25R Tcl Receive message - add next line to setup
    $spname whenever S7F25 [list recv_S7F25R $spname]

# receive procedure 
proc recv_S7F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect PPID
        # PPID A:80 (varies)  process program ID
        #vset [split [lindex $TSN_data 0] :] {typePPID lengthPPID}
        set PPID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F25R

S7F26Formatted Process Program Data Sent by Host and Equipment

    # S7F26 Tcl Parse reply
    set reply [secs_xact $spname S7F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 PPID MDLN SOFTREV {L:c {L:2 CCODE {L:p PPARM}}}
        # PPID A:80 (varies)  process program ID
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        # CCODE A:n (varies)  process operation command code
        # PPARM A:n (varies)  process parameter, any scalar or vector
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID MDLN SOFTREV Lc}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        if {[string first L: [lindex $Lc 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lc 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CCODE Lp_2}
            #vset [split [lindex $CCODE 0] :] {typeCCODE lengthCCODE}
            set CCODE [lindex $CCODE 1]
            if {[string first L: [lindex $Lp_2 0]] != 0} {set ok 0; break}
            foreach PPARM [lreplace $Lp_2 0 0] {
                #vset [split [lindex $PPARM 0] :] {typePPARM lengthPPARM}
                set PPARM [lindex $PPARM 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S7F27RProcess Program Verification Send Sent by Equipment Only

    # S7F27R Tcl Receive message - add next line to setup
    $spname whenever S7F27 [list recv_S7F27R $spname]

# receive procedure 
proc recv_S7F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PPID {L:n {L:3 ACKC7A SEQNUM ERRW7}}
        # PPID A:80 (varies)  process program ID
        # ACKC7A U4:1 (varies)  process program check code
        # SEQNUM U4:1 (varies)  process program command number
        # ERRW7 A:n (varies)  process program error description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID Ln}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {ACKC7A SEQNUM ERRW7}
            #vset [split [lindex $ACKC7A 0] :] {typeACKC7A lengthACKC7A}
            set ACKC7A [lindex $ACKC7A 1]
            #vset [split [lindex $SEQNUM 0] :] {typeSEQNUM lengthSEQNUM}
            set SEQNUM [lindex $SEQNUM 1]
            #vset [split [lindex $ERRW7 0] :] {typeERRW7 lengthERRW7}
            set ERRW7 [lindex $ERRW7 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F27R

S7F28Process Program Verification Acknowledge Sent by Host Only

    # S7F28 Tcl Parse reply
    set reply [secs_xact $spname S7F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S7F29RProcess Program Verification Inquire Sent by Equipment Only

    # S7F29R Tcl Receive message - add next line to setup
    $spname whenever S7F29 [list recv_S7F29R $spname]

# receive procedure 
proc recv_S7F29R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect LENGTH
        # LENGTH U4:1 (always)  program length in bytes
        if {[lindex $TSN_data 0] != "U4:1"} {set ok 0; break}
        set LENGTH [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F29R

S7F30Process Program Verification Grant Sent by Host Only

    # S7F30 Tcl Parse reply
    set reply [secs_xact $spname S7F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect PPGNT
        # PPGNT B:1 (always)  process program transfer grant status
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set PPGNT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F31RVerification Request Send Sent by Host Only

    # S7F31R Tcl Receive message - add next line to setup
    $spname whenever S7F31 [list recv_S7F31R $spname]

# receive procedure 
proc recv_S7F31R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 PPID MDLN SOFTREV {L:c {L:2 CCODE {L:p PPARM}}}
        # PPID A:80 (varies)  process program ID
        # MDLN A:20 (always)  equipment model type
        # SOFTREV A:20 (always)  software revision
        # CCODE A:n (varies)  process operation command code
        # PPARM A:n (varies)  process parameter, any scalar or vector
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID MDLN SOFTREV Lc}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        if {[string first "A:" [lindex $MDLN 0]] != 0} {set ok 0; break}
        set MDLN [lindex $MDLN 1]
        if {[string first "A:" [lindex $SOFTREV 0]] != 0} {set ok 0; break}
        set SOFTREV [lindex $SOFTREV 1]
        if {[string first L: [lindex $Lc 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lc 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CCODE Lp_2}
            #vset [split [lindex $CCODE 0] :] {typeCCODE lengthCCODE}
            set CCODE [lindex $CCODE 1]
            if {[string first L: [lindex $Lp_2 0]] != 0} {set ok 0; break}
            foreach PPARM [lreplace $Lp_2 0 0] {
                #vset [split [lindex $PPARM 0] :] {typePPARM lengthPPARM}
                set PPARM [lindex $PPARM 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F32 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S7F31R

S7F32Verification Request Acknowledge Sent by Equipment Only

    # S7F32 Tcl Parse reply
    set reply [secs_xact $spname S7F31R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F33RProcess Program Available Request Sent by Host and Equipment

    # S7F33R Tcl Receive message - add next line to setup
    $spname whenever S7F33 [list recv_S7F33R $spname]

# receive procedure 
proc recv_S7F33R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect PPID
        # PPID A:80 (varies)  process program ID
        #vset [split [lindex $TSN_data 0] :] {typePPID lengthPPID}
        set PPID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F34 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F33R

S7F34Process Program Availability Data Sent by Host and Equipment

    # S7F34 Tcl Parse reply
    set reply [secs_xact $spname S7F33R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 PPID UNFLEN FRMLEN
        # PPID A:80 (varies)  process program ID
        # UNFLEN U4:1 (varies)  unformatted process program length if available, else 0
        # FRMLEN U4:1 (varies)  formatted process program length if available, else 0
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PPID UNFLEN FRMLEN}
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        #vset [split [lindex $UNFLEN 0] :] {typeUNFLEN lengthUNFLEN}
        set UNFLEN [lindex $UNFLEN 1]
        #vset [split [lindex $FRMLEN 0] :] {typeFRMLEN lengthFRMLEN}
        set FRMLEN [lindex $FRMLEN 1]
        return ;# finished ok
        } ;# end while(ok)

S7F35RProcess Program for MID Request Sent by Host and Equipment

    # S7F35R Tcl Receive message - add next line to setup
    $spname whenever S7F35 [list recv_S7F35R $spname]

# receive procedure 
proc recv_S7F35R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MID
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        #vset [split [lindex $TSN_data 0] :] {typeMID lengthMID}
        set MID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F36 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F35R

S7F36Process Program for MID Data Sent by Host and Equipment

    # S7F36 Tcl Parse reply
    set reply [secs_xact $spname S7F35R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 MID PPID PPBODY
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # PPID A:80 (varies)  process program ID
        # PPBODY (list)B:n (varies)  process program data, any non-list type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID PPID PPBODY}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        #vset [split [lindex $PPID 0] :] {typePPID lengthPPID}
        set PPID [lindex $PPID 1]
        #vset [split [lindex $PPBODY 0] :] {typePPBODY lengthPPBODY}
        # convert list of type B 0xhh to int using expr
        set PPBODY {}; foreach v [lreplace $PPBODY 0 0] {lappend PPBODY [expr {$v}]}
        return ;# finished ok
        } ;# end while(ok)

S7F37RLarge PP Send Sent by Host and Equipment

    # S7F37R Tcl Receive message - add next line to setup
    $spname whenever S7F37 [list recv_S7F37R $spname]

# receive procedure 
proc recv_S7F37R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        #vset [split [lindex $TSN_data 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F38 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F37R

S7F38Large PP Send Ack Sent by Host and Equipment

    # S7F38 Tcl Parse reply
    set reply [secs_xact $spname S7F37R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F39RLarge Formatted PP Send Sent by Host and Equipment

    # S7F39R Tcl Receive message - add next line to setup
    $spname whenever S7F39 [list recv_S7F39R $spname]

# receive procedure 
proc recv_S7F39R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        #vset [split [lindex $TSN_data 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F40 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F39R

S7F40Large Formatted PP Ack Sent by Host and Equipment

    # S7F40 Tcl Parse reply
    set reply [secs_xact $spname S7F39R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F41RLarge PP Req Sent by Host and Equipment

    # S7F41R Tcl Receive message - add next line to setup
    $spname whenever S7F41 [list recv_S7F41R $spname]

# receive procedure 
proc recv_S7F41R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        #vset [split [lindex $TSN_data 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F42 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F41R

S7F42Large PP Req Ack Sent by Host and Equipment

    # S7F42 Tcl Parse reply
    set reply [secs_xact $spname S7F41R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S7F43RLarge Formatted PP Req Sent by Host and Equipment

    # S7F43R Tcl Receive message - add next line to setup
    $spname whenever S7F43 [list recv_S7F43R $spname]

# receive procedure 
proc recv_S7F43R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        #vset [split [lindex $TSN_data 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S7F44 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S7F43R

S7F44Large Formatted PP Req Ack Sent by Host and Equipment

    # S7F44 Tcl Parse reply
    set reply [secs_xact $spname S7F43R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC7
        # ACKC7 B:1 (always)  S7 acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC7 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S9F1Unknown Device ID Sent by Equipment Only

    # S9F1 Tcl Receive message - add next line to setup
    $spname whenever S9F1 [list recv_S9F1 $spname]

# receive procedure 
proc recv_S9F1 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MHEAD
        # MHEAD (list)B:10 (always)  message header of received block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set MHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend MHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F1

S9F3Unknown Stream Sent by Equipment Only

    # S9F3 Tcl Receive message - add next line to setup
    $spname whenever S9F3 [list recv_S9F3 $spname]

# receive procedure 
proc recv_S9F3 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MHEAD
        # MHEAD (list)B:10 (always)  message header of received block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set MHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend MHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F3

S9F5Unknown Function Sent by Equipment Only

    # S9F5 Tcl Receive message - add next line to setup
    $spname whenever S9F5 [list recv_S9F5 $spname]

# receive procedure 
proc recv_S9F5 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MHEAD
        # MHEAD (list)B:10 (always)  message header of received block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set MHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend MHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F5

S9F7Illegal Data Sent by Equipment Only

    # S9F7 Tcl Receive message - add next line to setup
    $spname whenever S9F7 [list recv_S9F7 $spname]

# receive procedure 
proc recv_S9F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MHEAD
        # MHEAD (list)B:10 (always)  message header of received block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set MHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend MHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F7

S9F9Transaction Timeout Sent by Equipment Only

    # S9F9 Tcl Receive message - add next line to setup
    $spname whenever S9F9 [list recv_S9F9 $spname]

# receive procedure 
proc recv_S9F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect SHEAD
        # SHEAD (list)B:10 (always)  message header of sent block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set SHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend SHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F9

S9F11Data Too Long Sent by Equipment Only

    # S9F11 Tcl Receive message - add next line to setup
    $spname whenever S9F11 [list recv_S9F11 $spname]

# receive procedure 
proc recv_S9F11 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect MHEAD
        # MHEAD (list)B:10 (always)  message header of received block
        if {[string first "B:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        # convert list of type B 0xhh to int using expr
        set MHEAD {}; foreach v [lreplace $TSN_data 0 0] {lappend MHEAD [expr {$v}]}
        } ;# end while(ok)
    } ;# end recv_S9F11

S9F13Conversation Timeout Sent by Equipment Only

    # S9F13 Tcl Receive message - add next line to setup
    $spname whenever S9F13 [list recv_S9F13 $spname]

# receive procedure 
proc recv_S9F13 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MEXP EDID
        # MEXP A:6 (always)  message expected in form of SxxFyy
        # EDID A:80 (varies)  expected data identification, PPID or SPID or PTN
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MEXP EDID}
        if {[string first "A:" [lindex $MEXP 0]] != 0} {set ok 0; break}
        set MEXP [lindex $MEXP 1]
        #vset [split [lindex $EDID 0] :] {typeEDID lengthEDID}
        set EDID [lindex $EDID 1]
        } ;# end while(ok)
    } ;# end recv_S9F13

S10F1[R]Terminal Request Sent by Equipment Only

    # S10F1 Tcl Receive message - add next line to setup
    $spname whenever S10F1 [list recv_S10F1 $spname]

# receive procedure 
proc recv_S10F1 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TID TEXT
        # TID B:1 (always)  terminal ID
        # TEXT A:120 (varies)  line of text for display, no standard max size
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TID TEXT}
        if {[lindex $TID 0] != "B:1"} {set ok 0; break}
        set TID [expr [lindex $TID 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $TEXT 0] :] {typeTEXT lengthTEXT}
        set TEXT [lindex $TEXT 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S10F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S10F1

S10F2Terminal Request Acknowledge Sent by Host Only

    # S10F2 Tcl Parse reply
    set reply [secs_xact $spname S10F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC10
        # ACKC10 B:1 (always)  acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC10 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S10F3[R]Terminal Display, Single Sent by Host Only

    # S10F3 Tcl Receive message - add next line to setup
    $spname whenever S10F3 [list recv_S10F3 $spname]

# receive procedure 
proc recv_S10F3 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TID TEXT
        # TID B:1 (always)  terminal ID
        # TEXT A:120 (varies)  line of text for display, no standard max size
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TID TEXT}
        if {[lindex $TID 0] != "B:1"} {set ok 0; break}
        set TID [expr [lindex $TID 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $TEXT 0] :] {typeTEXT lengthTEXT}
        set TEXT [lindex $TEXT 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S10F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S10F3

S10F4Terminal Display, Single Acknowledge Sent by Equipment Only

    # S10F4 Tcl Parse reply
    set reply [secs_xact $spname S10F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC10
        # ACKC10 B:1 (always)  acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC10 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S10F5[R]Terminal Display, Multi-Block Sent by Host Only

    # S10F5 Tcl Receive message - add next line to setup
    $spname whenever S10F5 [list recv_S10F5 $spname]

# receive procedure 
proc recv_S10F5 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TID {L:n TEXT}
        # TID B:1 (always)  terminal ID
        # TEXT A:120 (varies)  line of text for display, no standard max size
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TID Ln}
        if {[lindex $TID 0] != "B:1"} {set ok 0; break}
        set TID [expr [lindex $TID 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach TEXT [lreplace $Ln 0 0] {
            #vset [split [lindex $TEXT 0] :] {typeTEXT lengthTEXT}
            set TEXT [lindex $TEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S10F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S10F5

S10F6Terminal Display, Multi-Block Acknowledge Sent by Equipment Only

    # S10F6 Tcl Parse reply
    set reply [secs_xact $spname S10F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC10
        # ACKC10 B:1 (always)  acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC10 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S10F7Multi-block Not Allowed Sent by Equipment Only

    # S10F7 Tcl Receive message - add next line to setup
    $spname whenever S10F7 [list recv_S10F7 $spname]

# receive procedure 
proc recv_S10F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TID
        # TID B:1 (always)  terminal ID
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set TID [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S10F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S10F7

S10F9Broadcast Sent by Host Only

    # S10F9 Tcl Receive message - add next line to setup
    $spname whenever S10F9 [list recv_S10F9 $spname]

# receive procedure 
proc recv_S10F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TEXT
        # TEXT A:120 (varies)  line of text for display, no standard max size
        #vset [split [lindex $TSN_data 0] :] {typeTEXT lengthTEXT}
        set TEXT [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S10F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S10F9

S10F10Broadcast Acknowledge Sent by Equipment Only

    # S10F10 Tcl Parse reply
    set reply [secs_xact $spname S10F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC10
        # ACKC10 B:1 (always)  acknowledge code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC10 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F1RMap Setup Data Send Sent by Equipment Only

    # S12F1R Tcl Receive message - add next line to setup
    $spname whenever S12F1 [list recv_S12F1R $spname]

# receive procedure 
proc recv_S12F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:15 MID IDTYP FNLOC FFROT ORLOC RPSEL {L:n REFP} DUTMS XDIES YDIES ROWCT COLCT NULBC PRDCT PRAXI
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # FNLOC U2:1 (always)  flat/notch location in degrees clockwise from bottom
        # FFROT U2:1 (always)  film frame location in degrees clockwise from bottom
        # ORLOC B:1 (always)  origin location
        # RPSEL U1:1 (always)  reference point select 
        # REFP (list)I4:2 (varies)  x y reference point
        # DUTMS A:n (always)  die units of measure
        # XDIES F4:1 (varies)  X-axis die size
        # YDIES F4:1 (varies)  Y-axis die size
        # ROWCT U4:1 (varies)  row count in die increments
        # COLCT U4:1 (varies)  column count in die increments
        # NULBC A:n (varies)  null bin code value
        # PRDCT U4:1 (varies)  process die count
        # PRAXI B:1 (always)  process access
        if { [lindex $TSN_data 0] != "L:15" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP FNLOC FFROT ORLOC RPSEL Ln DUTMS XDIES YDIES ROWCT COLCT NULBC PRDCT PRAXI}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[lindex $FNLOC 0] != "U2:1"} {set ok 0; break}
        set FNLOC [lindex $FNLOC 1]
        if {[lindex $FFROT 0] != "U2:1"} {set ok 0; break}
        set FFROT [lindex $FFROT 1]
        if {[lindex $ORLOC 0] != "B:1"} {set ok 0; break}
        set ORLOC [expr [lindex $ORLOC 1]]  ;# expr converts 0xhh to int
        if {[lindex $RPSEL 0] != "U1:1"} {set ok 0; break}
        set RPSEL [lindex $RPSEL 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach REFP [lreplace $Ln 0 0] {
            #vset [split [lindex $REFP 0] :] {typeREFP lengthREFP}
            set REFP [lreplace $REFP 0 0]
            }
        if {!$ok} break
        if {[string first "A:" [lindex $DUTMS 0]] != 0} {set ok 0; break}
        set DUTMS [lindex $DUTMS 1]
        #vset [split [lindex $XDIES 0] :] {typeXDIES lengthXDIES}
        set XDIES [lindex $XDIES 1]
        #vset [split [lindex $YDIES 0] :] {typeYDIES lengthYDIES}
        set YDIES [lindex $YDIES 1]
        #vset [split [lindex $ROWCT 0] :] {typeROWCT lengthROWCT}
        set ROWCT [lindex $ROWCT 1]
        #vset [split [lindex $COLCT 0] :] {typeCOLCT lengthCOLCT}
        set COLCT [lindex $COLCT 1]
        #vset [split [lindex $NULBC 0] :] {typeNULBC lengthNULBC}
        set NULBC [lindex $NULBC 1]
        #vset [split [lindex $PRDCT 0] :] {typePRDCT lengthPRDCT}
        set PRDCT [lindex $PRDCT 1]
        if {[lindex $PRAXI 0] != "B:1"} {set ok 0; break}
        set PRAXI [expr [lindex $PRAXI 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F1R

S12F2Map Setup Data Acknowledge Sent by Host Only

    # S12F2 Tcl Parse reply
    set reply [secs_xact $spname S12F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect SDACK
        # SDACK B:1 (always)  setup data ack, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set SDACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F3RMap Setup Data Request Sent by Equipment Only

    # S12F3R Tcl Receive message - add next line to setup
    $spname whenever S12F3 [list recv_S12F3R $spname]

# receive procedure 
proc recv_S12F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:9 MID IDTYP MAPFT FNLOC FFROT ORLOC PRAXI BCEQU NULBC
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # MAPFT B:1 (always)  map data format type
        # FNLOC U2:1 (always)  flat/notch location in degrees clockwise from bottom
        # FFROT U2:1 (always)  film frame location in degrees clockwise from bottom
        # ORLOC B:1 (always)  origin location
        # PRAXI B:1 (always)  process access
        # BCEQU (list)U1:n (varies)  array of bin code equivalents
        # NULBC A:n (varies)  null bin code value
        if { [lindex $TSN_data 0] != "L:9" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP MAPFT FNLOC FFROT ORLOC PRAXI BCEQU NULBC}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[lindex $MAPFT 0] != "B:1"} {set ok 0; break}
        set MAPFT [expr [lindex $MAPFT 1]]  ;# expr converts 0xhh to int
        if {[lindex $FNLOC 0] != "U2:1"} {set ok 0; break}
        set FNLOC [lindex $FNLOC 1]
        if {[lindex $FFROT 0] != "U2:1"} {set ok 0; break}
        set FFROT [lindex $FFROT 1]
        if {[lindex $ORLOC 0] != "B:1"} {set ok 0; break}
        set ORLOC [expr [lindex $ORLOC 1]]  ;# expr converts 0xhh to int
        if {[lindex $PRAXI 0] != "B:1"} {set ok 0; break}
        set PRAXI [expr [lindex $PRAXI 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $BCEQU 0] :] {typeBCEQU lengthBCEQU}
        set BCEQU [lreplace $BCEQU 0 0]
        #vset [split [lindex $NULBC 0] :] {typeNULBC lengthNULBC}
        set NULBC [lindex $NULBC 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F3R

S12F4Map Setup Data Sent by Host Only

    # S12F4 Tcl Parse reply
    set reply [secs_xact $spname S12F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:15 MID IDTYP FNLOC ORLOC RPSEL {L:n REFP} DUTMS XDIES YDIES ROWCT COLCT PRDCT BCEQU NULBC MLCL
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # FNLOC U2:1 (always)  flat/notch location in degrees clockwise from bottom
        # ORLOC B:1 (always)  origin location
        # RPSEL U1:1 (always)  reference point select 
        # REFP (list)I4:2 (varies)  x y reference point
        # DUTMS A:n (always)  die units of measure
        # XDIES F4:1 (varies)  X-axis die size
        # YDIES F4:1 (varies)  Y-axis die size
        # ROWCT U4:1 (varies)  row count in die increments
        # COLCT U4:1 (varies)  column count in die increments
        # PRDCT U4:1 (varies)  process die count
        # BCEQU (list)U1:n (varies)  array of bin code equivalents
        # NULBC A:n (varies)  null bin code value
        # MLCL U4:1 (varies)  message length in bytes
        if { [lindex $TSN_data 0] != "L:15" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP FNLOC ORLOC RPSEL Ln DUTMS XDIES YDIES ROWCT COLCT PRDCT BCEQU NULBC MLCL}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[lindex $FNLOC 0] != "U2:1"} {set ok 0; break}
        set FNLOC [lindex $FNLOC 1]
        if {[lindex $ORLOC 0] != "B:1"} {set ok 0; break}
        set ORLOC [expr [lindex $ORLOC 1]]  ;# expr converts 0xhh to int
        if {[lindex $RPSEL 0] != "U1:1"} {set ok 0; break}
        set RPSEL [lindex $RPSEL 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach REFP [lreplace $Ln 0 0] {
            #vset [split [lindex $REFP 0] :] {typeREFP lengthREFP}
            set REFP [lreplace $REFP 0 0]
            }
        if {!$ok} break
        if {[string first "A:" [lindex $DUTMS 0]] != 0} {set ok 0; break}
        set DUTMS [lindex $DUTMS 1]
        #vset [split [lindex $XDIES 0] :] {typeXDIES lengthXDIES}
        set XDIES [lindex $XDIES 1]
        #vset [split [lindex $YDIES 0] :] {typeYDIES lengthYDIES}
        set YDIES [lindex $YDIES 1]
        #vset [split [lindex $ROWCT 0] :] {typeROWCT lengthROWCT}
        set ROWCT [lindex $ROWCT 1]
        #vset [split [lindex $COLCT 0] :] {typeCOLCT lengthCOLCT}
        set COLCT [lindex $COLCT 1]
        #vset [split [lindex $PRDCT 0] :] {typePRDCT lengthPRDCT}
        set PRDCT [lindex $PRDCT 1]
        #vset [split [lindex $BCEQU 0] :] {typeBCEQU lengthBCEQU}
        set BCEQU [lreplace $BCEQU 0 0]
        #vset [split [lindex $NULBC 0] :] {typeNULBC lengthNULBC}
        set NULBC [lindex $NULBC 1]
        #vset [split [lindex $MLCL 0] :] {typeMLCL lengthMLCL}
        set MLCL [lindex $MLCL 1]
        return ;# finished ok
        } ;# end while(ok)

S12F5RMap Transmit Inquire Sent by Equipment Only

    # S12F5R Tcl Receive message - add next line to setup
    $spname whenever S12F5 [list recv_S12F5R $spname]

# receive procedure 
proc recv_S12F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 MID IDTYP MAPFT MLCL
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # MAPFT B:1 (always)  map data format type
        # MLCL U4:1 (varies)  message length in bytes
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP MAPFT MLCL}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[lindex $MAPFT 0] != "B:1"} {set ok 0; break}
        set MAPFT [expr [lindex $MAPFT 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $MLCL 0] :] {typeMLCL lengthMLCL}
        set MLCL [lindex $MLCL 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F5R

S12F6Map Transmit Grant Sent by Host Only

    # S12F6 Tcl Parse reply
    set reply [secs_xact $spname S12F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRNT1
        # GRNT1 B:1 (always)  grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRNT1 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F7RMap Data Send Type 1 Sent by Equipment Only

    # S12F7R Tcl Receive message - add next line to setup
    $spname whenever S12F7 [list recv_S12F7R $spname]

# receive procedure 
proc recv_S12F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 MID IDTYP {L:n {L:2 RSINF BINLT}}
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # RSINF (list)I4:3 (varies)  starting location for row or column, x,y,direction triplet
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP Ln}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RSINF BINLT}
            #vset [split [lindex $RSINF 0] :] {typeRSINF lengthRSINF}
            set RSINF [lreplace $RSINF 0 0]
            #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
            set BINLT [lreplace $BINLT 0 0]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F7R

S12F8Map Data Ack Type 1 Sent by Host Only

    # S12F8 Tcl Parse reply
    set reply [secs_xact $spname S12F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect MDACK
        # MDACK B:1 (always)  map data ack
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set MDACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F9RMap Data Send Type 2 Sent by Equipment Only

    # S12F9R Tcl Receive message - add next line to setup
    $spname whenever S12F9 [list recv_S12F9R $spname]

# receive procedure 
proc recv_S12F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 MID IDTYP STRP BINLT
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # STRP (list)I2:2 (varies)  x y die coordinate starting position
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP STRP BINLT}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $STRP 0] :] {typeSTRP lengthSTRP}
        set STRP [lreplace $STRP 0 0]
        #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
        set BINLT [lreplace $BINLT 0 0]
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F9R

S12F10Map Data Ack Type 2 Sent by Host Only

    # S12F10 Tcl Parse reply
    set reply [secs_xact $spname S12F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect MDACK
        # MDACK B:1 (always)  map data ack
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set MDACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F11RMap Data Send Type 3 Sent by Equipment Only

    # S12F11R Tcl Receive message - add next line to setup
    $spname whenever S12F11 [list recv_S12F11R $spname]

# receive procedure 
proc recv_S12F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 MID IDTYP {L:n {L:2 XYPOS BINLT}}
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # XYPOS (list)I2:2 (varies)  x y coordinate position
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP Ln}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {XYPOS BINLT}
            #vset [split [lindex $XYPOS 0] :] {typeXYPOS lengthXYPOS}
            set XYPOS [lreplace $XYPOS 0 0]
            #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
            set BINLT [lreplace $BINLT 0 0]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F11R

S12F12Map Data Ack Type 3 Sent by Host Only

    # S12F12 Tcl Parse reply
    set reply [secs_xact $spname S12F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect MDACK
        # MDACK B:1 (always)  map data ack
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set MDACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S12F13RMap Data Request Type 1 Sent by Equipment Only

    # S12F13R Tcl Receive message - add next line to setup
    $spname whenever S12F13 [list recv_S12F13R $spname]

# receive procedure 
proc recv_S12F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MID IDTYP
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F13R

S12F14Map Data Type 1 Sent by Host Only

    # S12F14 Tcl Parse reply
    set reply [secs_xact $spname S12F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 MID IDTYP {L:n {L:2 RSINF BINLT}}
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # RSINF (list)I4:3 (varies)  starting location for row or column, x,y,direction triplet
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP Ln}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RSINF BINLT}
            #vset [split [lindex $RSINF 0] :] {typeRSINF lengthRSINF}
            set RSINF [lreplace $RSINF 0 0]
            #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
            set BINLT [lreplace $BINLT 0 0]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S12F15RMap Data Request Type 2 Sent by Equipment Only

    # S12F15R Tcl Receive message - add next line to setup
    $spname whenever S12F15 [list recv_S12F15R $spname]

# receive procedure 
proc recv_S12F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MID IDTYP
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F15R

S12F16Map Data Type 2 Sent by Host Only

    # S12F16 Tcl Parse reply
    set reply [secs_xact $spname S12F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 MID IDTYP STRP BINLT
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # STRP (list)I2:2 (varies)  x y die coordinate starting position
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP STRP BINLT}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $STRP 0] :] {typeSTRP lengthSTRP}
        set STRP [lreplace $STRP 0 0]
        #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
        set BINLT [lreplace $BINLT 0 0]
        return ;# finished ok
        } ;# end while(ok)

S12F17RMap Data Request Type 3 Sent by Equipment Only

    # S12F17R Tcl Receive message - add next line to setup
    $spname whenever S12F17 [list recv_S12F17R $spname]

# receive procedure 
proc recv_S12F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 MID IDTYP SDBIN
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # SDBIN B:1 (always)  send bin data flag, 0=send, else do not
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP SDBIN}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[lindex $SDBIN 0] != "B:1"} {set ok 0; break}
        set SDBIN [expr [lindex $SDBIN 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F17R

S12F18Map Data Type 3 Sent by Host Only

    # S12F18 Tcl Parse reply
    set reply [secs_xact $spname S12F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 MID IDTYP {L:n {L:2 XYPOS BINLT}}
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # IDTYP B:1 (always)  ID type
        # XYPOS (list)I2:2 (varies)  x y coordinate position
        # BINLT (list)U1:n (varies)  array of bin values, text or U1 array
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MID IDTYP Ln}
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[lindex $IDTYP 0] != "B:1"} {set ok 0; break}
        set IDTYP [expr [lindex $IDTYP 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {XYPOS BINLT}
            #vset [split [lindex $XYPOS 0] :] {typeXYPOS lengthXYPOS}
            set XYPOS [lreplace $XYPOS 0 0]
            #vset [split [lindex $BINLT 0] :] {typeBINLT lengthBINLT}
            set BINLT [lreplace $BINLT 0 0]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S12F19Map Error Report Send Sent by Host and Equipment

    # S12F19 Tcl Receive message - add next line to setup
    $spname whenever S12F19 [list recv_S12F19 $spname]

# receive procedure 
proc recv_S12F19 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 MAPER DATLC
        # MAPER B:1 (always)  map error
        # DATLC U1:1 (always)  location of invalid data, offset in bytes in the SECS-II message body
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {MAPER DATLC}
        if {[lindex $MAPER 0] != "B:1"} {set ok 0; break}
        set MAPER [expr [lindex $MAPER 1]]  ;# expr converts 0xhh to int
        if {[lindex $DATLC 0] != "U1:1"} {set ok 0; break}
        set DATLC [lindex $DATLC 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S12F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S12F19

S13F1RSend Data Set Send Sent by Host and Equipment

    # S13F1R Tcl Receive message - add next line to setup
    $spname whenever S13F1 [list recv_S13F1R $spname]

# receive procedure 
proc recv_S13F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:1 DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        if { [lindex $TSN_data 0] != "L:1" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] DSNAME
        #vset [split [lindex $DSNAME 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $DSNAME 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F1R

S13F2Send Data Set Ack Sent by Host and Equipment

    # S13F2 Tcl Parse reply
    set reply [secs_xact $spname S13F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 DSNAME ACKC13
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        # ACKC13 B:1 (always)  acknowledge code, 0 ok
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DSNAME ACKC13}
        #vset [split [lindex $DSNAME 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $DSNAME 1]
        if {[lindex $ACKC13 0] != "B:1"} {set ok 0; break}
        set ACKC13 [expr [lindex $ACKC13 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S13F3ROpen Data Set Request Sent by Host and Equipment

    # S13F3R Tcl Receive message - add next line to setup
    $spname whenever S13F3 [list recv_S13F3R $spname]

# receive procedure 
proc recv_S13F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 HANDLE DSNAME CKPNT
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        # CKPNT U4:1 (always)  data set checkpoint defined by sender
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HANDLE DSNAME CKPNT}
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        #vset [split [lindex $DSNAME 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $DSNAME 1]
        if {[lindex $CKPNT 0] != "U4:1"} {set ok 0; break}
        set CKPNT [lindex $CKPNT 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F3R

S13F4Open Data Set Data Sent by Host and Equipment

    # S13F4 Tcl Parse reply
    set reply [secs_xact $spname S13F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:5 HANDLE DSNAME ACKC13 RTYPE RECLEN
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        # ACKC13 B:1 (always)  acknowledge code, 0 ok
        # RTYPE U1:1 (varies)  type of data record
        # RECLEN U4:1 (varies)  maximum number of bytes or characters in a discrete record
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HANDLE DSNAME ACKC13 RTYPE RECLEN}
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        #vset [split [lindex $DSNAME 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $DSNAME 1]
        if {[lindex $ACKC13 0] != "B:1"} {set ok 0; break}
        set ACKC13 [expr [lindex $ACKC13 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $RTYPE 0] :] {typeRTYPE lengthRTYPE}
        set RTYPE [lindex $RTYPE 1]
        #vset [split [lindex $RECLEN 0] :] {typeRECLEN lengthRECLEN}
        set RECLEN [lindex $RECLEN 1]
        return ;# finished ok
        } ;# end while(ok)

S13F5RRead Data Set Request Sent by Host and Equipment

    # S13F5R Tcl Receive message - add next line to setup
    $spname whenever S13F5 [list recv_S13F5R $spname]

# receive procedure 
proc recv_S13F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 HANDLE READLN
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        # READLN U4:1 (varies)  maximum number of bytes or characters to read
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HANDLE READLN}
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        #vset [split [lindex $READLN 0] :] {typeREADLN lengthREADLN}
        set READLN [lindex $READLN 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F5R

S13F6Read Data Set Data Sent by Host and Equipment

    # S13F6 Tcl Parse reply
    set reply [secs_xact $spname S13F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 HANDLE ACKC13 CKPNT {L:n FILDAT}
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        # ACKC13 B:1 (always)  acknowledge code, 0 ok
        # CKPNT U4:1 (always)  data set checkpoint defined by sender
        # FILDAT (list)B (varies)  Data Set Data, binary or ascii.  Max length is the RECLEN from open.
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HANDLE ACKC13 CKPNT Ln}
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        if {[lindex $ACKC13 0] != "B:1"} {set ok 0; break}
        set ACKC13 [expr [lindex $ACKC13 1]]  ;# expr converts 0xhh to int
        if {[lindex $CKPNT 0] != "U4:1"} {set ok 0; break}
        set CKPNT [lindex $CKPNT 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach FILDAT [lreplace $Ln 0 0] {
            #vset [split [lindex $FILDAT 0] :] {typeFILDAT lengthFILDAT}
            # convert list of type B 0xhh to int using expr
            set FILDAT {}; foreach v [lreplace $FILDAT 0 0] {lappend FILDAT [expr {$v}]}
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S13F7RClose Data Set Send Sent by Host and Equipment

    # S13F7R Tcl Receive message - add next line to setup
    $spname whenever S13F7 [list recv_S13F7R $spname]

# receive procedure 
proc recv_S13F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:1 HANDLE
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        if { [lindex $TSN_data 0] != "L:1" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] HANDLE
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F7R

S13F8Close Data Set Ack Sent by Host and Equipment

    # S13F8 Tcl Parse reply
    set reply [secs_xact $spname S13F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 HANDLE ACKC13
        # HANDLE (list)U4 (varies)  logical unit or handle for a data set
        # ACKC13 B:1 (always)  acknowledge code, 0 ok
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {HANDLE ACKC13}
        #vset [split [lindex $HANDLE 0] :] {typeHANDLE lengthHANDLE}
        set HANDLE [lreplace $HANDLE 0 0]
        if {[lindex $ACKC13 0] != "B:1"} {set ok 0; break}
        set ACKC13 [expr [lindex $ACKC13 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S13F9RReset Data Set Send Sent by Host and Equipment

    # S13F9R Tcl Receive message - add next line to setup
    $spname whenever S13F9 [list recv_S13F9R $spname]

# receive procedure 
proc recv_S13F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F9R

S13F10Reset Data Set Ack Sent by Host and Equipment

    # S13F10 Tcl Parse reply
    set reply [secs_xact $spname S13F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S13F11RData Set Obj Multi-Block Inquire Sent by Host and Equipment

    # S13F11R Tcl Receive message - add next line to setup
    $spname whenever S13F11 [list recv_S13F11R $spname]

# receive procedure 
proc recv_S13F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID OBJSPEC DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F11R

S13F12Data Set Obj Multi-Block Grant Sent by Host and Equipment

    # S13F12 Tcl Parse reply
    set reply [secs_xact $spname S13F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S13F13RTable Data Send Sent by Host and Equipment

    # S13F13R Tcl Receive message - add next line to setup
    $spname whenever S13F13 [list recv_S13F13R $spname]

# receive procedure 
proc recv_S13F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:8 DATAID OBJSPEC TBLTYP TBLID TBLCMD {L:n {L:2 ATTRID ATTRDATA}} {L:c COLHDR} {L:r {L:m TBLELT}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # TBLTYP A:n (always)  denotes the format and application of the table, conforms to OBJTYPE
        # TBLID A:80 (varies)  table identifier, a kind of OBJSPEC
        # TBLCMD U1:1 (always)  table command
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # COLHDR A:20 (always)  table column name
        # TBLELT A:n (varies)  table element any type, list types or array types are discouraged, first column type must be a primary key value and not be a list or array
        if { [lindex $TSN_data 0] != "L:8" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC TBLTYP TBLID TBLCMD Ln Lc_n1 Lr_n2}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first "A:" [lindex $TBLTYP 0]] != 0} {set ok 0; break}
        set TBLTYP [lindex $TBLTYP 1]
        #vset [split [lindex $TBLID 0] :] {typeTBLID lengthTBLID}
        set TBLID [lindex $TBLID 1]
        if {[lindex $TBLCMD 0] != "U1:1"} {set ok 0; break}
        set TBLCMD [lindex $TBLCMD 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lc_n1 0]] != 0} {set ok 0; break}
        foreach COLHDR [lreplace $Lc_n1 0 0] {
            if {[string first "A:" [lindex $COLHDR 0]] != 0} {set ok 0; break}
            set COLHDR [lindex $COLHDR 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lr_n2 0]] != 0} {set ok 0; break}
        foreach Lm_1 [lreplace $Lr_n2 0 0] {
            if {[string first L: [lindex $Lm_1 0]] != 0} {set ok 0; break}
            foreach TBLELT [lreplace $Lm_1 0 0] {
                #vset [split [lindex $TBLELT 0] :] {typeTBLELT lengthTBLELT}
                set TBLELT [lindex $TBLELT 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F13R

S13F14Table Data Ack Sent by Host and Equipment

    # S13F14 Tcl Parse reply
    set reply [secs_xact $spname S13F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TBLACK {L:p {L:2 ERRCODE ERRTEXT}}
        # TBLACK U1:1 (always)  acknowledge code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TBLACK Lp}
        if {[lindex $TBLACK 0] != "U1:1"} {set ok 0; break}
        set TBLACK [lindex $TBLACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S13F15RTable Data Request Sent by Host and Equipment

    # S13F15R Tcl Receive message - add next line to setup
    $spname whenever S13F15 [list recv_S13F15R $spname]

# receive procedure 
proc recv_S13F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:7 DATAID OBJSPEC TBLTYP TBLID TBLCMD {L:p COLHDR} {L:q TBLELT}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # TBLTYP A:n (always)  denotes the format and application of the table, conforms to OBJTYPE
        # TBLID A:80 (varies)  table identifier, a kind of OBJSPEC
        # TBLCMD U1:1 (always)  table command
        # COLHDR A:20 (always)  table column name
        # TBLELT A:n (varies)  table element any type, list types or array types are discouraged, first column type must be a primary key value and not be a list or array
        if { [lindex $TSN_data 0] != "L:7" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC TBLTYP TBLID TBLCMD Lp Lq_n1}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first "A:" [lindex $TBLTYP 0]] != 0} {set ok 0; break}
        set TBLTYP [lindex $TBLTYP 1]
        #vset [split [lindex $TBLID 0] :] {typeTBLID lengthTBLID}
        set TBLID [lindex $TBLID 1]
        if {[lindex $TBLCMD 0] != "U1:1"} {set ok 0; break}
        set TBLCMD [lindex $TBLCMD 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach COLHDR [lreplace $Lp 0 0] {
            if {[string first "A:" [lindex $COLHDR 0]] != 0} {set ok 0; break}
            set COLHDR [lindex $COLHDR 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lq_n1 0]] != 0} {set ok 0; break}
        foreach TBLELT [lreplace $Lq_n1 0 0] {
            #vset [split [lindex $TBLELT 0] :] {typeTBLELT lengthTBLELT}
            set TBLELT [lindex $TBLELT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S13F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S13F15R

S13F16Table Data Sent by Host and Equipment

    # S13F16 Tcl Parse reply
    set reply [secs_xact $spname S13F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:6 TBLTYP TBLID {L:n {L:2 ATTRID ATTRDATA}} {L:c COLHDR} {L:r {L:c TBLELT}} {L:2 TBLACK {L:p ERRCODE ERRTEXT}}
        # TBLTYP A:n (always)  denotes the format and application of the table, conforms to OBJTYPE
        # TBLID A:80 (varies)  table identifier, a kind of OBJSPEC
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # COLHDR A:20 (always)  table column name
        # TBLELT A:n (varies)  table element any type, list types or array types are discouraged, first column type must be a primary key value and not be a list or array
        # TBLACK U1:1 (always)  acknowledge code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:6" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TBLTYP TBLID Ln Lc_n1 Lr_n2 L2_n3}
        if {[string first "A:" [lindex $TBLTYP 0]] != 0} {set ok 0; break}
        set TBLTYP [lindex $TBLTYP 1]
        #vset [split [lindex $TBLID 0] :] {typeTBLID lengthTBLID}
        set TBLID [lindex $TBLID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lc_n1 0]] != 0} {set ok 0; break}
        foreach COLHDR [lreplace $Lc_n1 0 0] {
            if {[string first "A:" [lindex $COLHDR 0]] != 0} {set ok 0; break}
            set COLHDR [lindex $COLHDR 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lr_n2 0]] != 0} {set ok 0; break}
        foreach Lc_1 [lreplace $Lr_n2 0 0] {
            if {[string first L: [lindex $Lc_1 0]] != 0} {set ok 0; break}
            foreach TBLELT [lreplace $Lc_1 0 0] {
                #vset [split [lindex $TBLELT 0] :] {typeTBLELT lengthTBLELT}
                set TBLELT [lindex $TBLELT 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n3 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n3 0 0] {TBLACK Lp_1}
        if {[lindex $TBLACK 0] != "U1:1"} {set ok 0; break}
        set TBLACK [lindex $TBLACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach {ERRCODE ERRTEXT} [lreplace $Lp_1 0 0] {
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F1RGet Attributes Request Sent by Host and Equipment

    # S14F1R Tcl Receive message - add next line to setup
    $spname whenever S14F1 [list recv_S14F1R $spname]

# receive procedure 
proc recv_S14F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 OBJSPEC OBJTYPE {L:i OBJID} {L:q {L:3 ATTRID ATTRDATA ATTRRELN}} {L:a ATTRID}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # OBJID A:80 (varies)  E39 object identifier 1-80 chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # ATTRRELN U1:1 (always)  relationship of a value to an attribute value of an object
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJTYPE Li Lq_n1 La_n2}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
        set OBJTYPE [lindex $OBJTYPE 1]
        if {[string first L: [lindex $Li 0]] != 0} {set ok 0; break}
        foreach OBJID [lreplace $Li 0 0] {
            #vset [split [lindex $OBJID 0] :] {typeOBJID lengthOBJID}
            set OBJID [lindex $OBJID 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Lq_n1 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lq_n1 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {ATTRID ATTRDATA ATTRRELN}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            if {[lindex $ATTRRELN 0] != "U1:1"} {set ok 0; break}
            set ATTRRELN [lindex $ATTRRELN 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $La_n2 0]] != 0} {set ok 0; break}
        foreach ATTRID [lreplace $La_n2 0 0] {
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F1R

S14F2Attribute Data Sent by Host and Equipment

    # S14F2 Tcl Parse reply
    set reply [secs_xact $spname S14F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:2 OBJID {L:a {L:2 ATTRID ATTRDATA}}}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJID A:80 (varies)  E39 object identifier 1-80 chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {OBJID La_2}
            #vset [split [lindex $OBJID 0] :] {typeOBJID lengthOBJID}
            set OBJID [lindex $OBJID 1]
            if {[string first L: [lindex $La_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $La_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {ATTRID ATTRDATA}
                #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
                set ATTRID [lindex $ATTRID 1]
                #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
                set ATTRDATA [lindex $ATTRDATA 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F3RSet Attributes Sent by Host and Equipment

    # S14F3R Tcl Receive message - add next line to setup
    $spname whenever S14F3 [list recv_S14F3R $spname]

# receive procedure 
proc recv_S14F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 OBJSPEC OBJTYPE {L:i OBJID} {L:n {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # OBJID A:80 (varies)  E39 object identifier 1-80 chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJTYPE Li Ln_n1}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
        set OBJTYPE [lindex $OBJTYPE 1]
        if {[string first L: [lindex $Li 0]] != 0} {set ok 0; break}
        foreach OBJID [lreplace $Li 0 0] {
            #vset [split [lindex $OBJID 0] :] {typeOBJID lengthOBJID}
            set OBJID [lindex $OBJID 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Ln_n1 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln_n1 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F3R

S14F4Set Attributes Reply Sent by Host and Equipment

    # S14F4 Tcl Parse reply
    set reply [secs_xact $spname S14F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:i {L:2 OBJID {L:n {L:2 ATTRID ATTRDATA}}}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJID A:80 (varies)  E39 object identifier 1-80 chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Li L2_n1}
        if {[string first L: [lindex $Li 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Li 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {OBJID Ln_2}
            #vset [split [lindex $OBJID 0] :] {typeOBJID lengthOBJID}
            set OBJID [lindex $OBJID 1]
            if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Ln_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {ATTRID ATTRDATA}
                #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
                set ATTRID [lindex $ATTRID 1]
                #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
                set ATTRDATA [lindex $ATTRDATA 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F5RGet Type Data Sent by Host and Equipment

    # S14F5R Tcl Receive message - add next line to setup
    $spname whenever S14F5 [list recv_S14F5R $spname]

# receive procedure 
proc recv_S14F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect OBJSPEC
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        #vset [split [lindex $TSN_data 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F5R

S14F6Type Data Sent by Host and Equipment

    # S14F6 Tcl Parse reply
    set reply [secs_xact $spname S14F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n OBJTYPE} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach OBJTYPE [lreplace $Ln 0 0] {
            #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
            set OBJTYPE [lindex $OBJTYPE 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F7RGet Attribute Names for the types Sent by Host and Equipment

    # S14F7R Tcl Receive message - add next line to setup
    $spname whenever S14F7 [list recv_S14F7R $spname]

# receive procedure 
proc recv_S14F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 OBJSPEC {L:n OBJTYPE}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC Ln}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach OBJTYPE [lreplace $Ln 0 0] {
            #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
            set OBJTYPE [lindex $OBJTYPE 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F7R

S14F8Attribute Names of the object types Sent by Host and Equipment

    # S14F8 Tcl Parse reply
    set reply [secs_xact $spname S14F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:2 OBJTYPE {L:a ATTRID}}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {OBJTYPE La_2}
            #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
            set OBJTYPE [lindex $OBJTYPE 1]
            if {[string first L: [lindex $La_2 0]] != 0} {set ok 0; break}
            foreach ATTRID [lreplace $La_2 0 0] {
                #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
                set ATTRID [lindex $ATTRID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F9RCreate Obj Request Sent by Host and Equipment

    # S14F9R Tcl Receive message - add next line to setup
    $spname whenever S14F9 [list recv_S14F9R $spname]

# receive procedure 
proc recv_S14F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 OBJSPEC OBJTYPE {L:a {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJTYPE La}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
        set OBJTYPE [lindex $OBJTYPE 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F9R

S14F10Create Obj Ack Sent by Host and Equipment

    # S14F10 Tcl Parse reply
    set reply [secs_xact $spname S14F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 OBJSPEC {L:b {L:2 ATTRID ATTRDATA}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC Lb L2_n1}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $Lb 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lb 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F11RDelete Obj Request Sent by Host and Equipment

    # S14F11R Tcl Receive message - add next line to setup
    $spname whenever S14F11 [list recv_S14F11R $spname]

# receive procedure 
proc recv_S14F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 OBJSPEC {L:a {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC La}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F11R

S14F12Delete Obj Ack Sent by Host and Equipment

    # S14F12 Tcl Parse reply
    set reply [secs_xact $spname S14F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:b {L:2 ATTRID ATTRDATA}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lb L2_n1}
        if {[string first L: [lindex $Lb 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lb 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F13RObject Attach Request Sent by Host and Equipment

    # S14F13R Tcl Receive message - add next line to setup
    $spname whenever S14F13 [list recv_S14F13R $spname]

# receive procedure 
proc recv_S14F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 OBJSPEC {L:a {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC La}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F13R

S14F14Object Attach Ack Sent by Host and Equipment

    # S14F14 Tcl Parse reply
    set reply [secs_xact $spname S14F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 OBJTOKEN {L:b {L:2 ATTRID ATTRDATA}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJTOKEN U4:1 (always)  token used for authorization
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJTOKEN Lb L2_n1}
        if {[lindex $OBJTOKEN 0] != "U4:1"} {set ok 0; break}
        set OBJTOKEN [lindex $OBJTOKEN 1]
        if {[string first L: [lindex $Lb 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lb 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F15RAttached Obj Action Req. Sent by Host and Equipment

    # S14F15R Tcl Receive message - add next line to setup
    $spname whenever S14F15 [list recv_S14F15R $spname]

# receive procedure 
proc recv_S14F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 OBJSPEC OBJCMD OBJTOKEN {L:a {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJCMD U1:1 (always)  Specifies an action to be performed by an object
        # OBJTOKEN U4:1 (always)  token used for authorization
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJCMD OBJTOKEN La}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[lindex $OBJCMD 0] != "U1:1"} {set ok 0; break}
        set OBJCMD [lindex $OBJCMD 1]
        if {[lindex $OBJTOKEN 0] != "U4:1"} {set ok 0; break}
        set OBJTOKEN [lindex $OBJTOKEN 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F15R

S14F16Attached Obj Action Ack Sent by Host and Equipment

    # S14F16 Tcl Parse reply
    set reply [secs_xact $spname S14F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:b {L:2 ATTRID ATTRDATA}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lb L2_n1}
        if {[string first L: [lindex $Lb 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lb 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F17RSupervised Obj Action Req Sent by Host and Equipment

    # S14F17R Tcl Receive message - add next line to setup
    $spname whenever S14F17 [list recv_S14F17R $spname]

# receive procedure 
proc recv_S14F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 OBJSPEC OBJCMD TARGETSPEC {L:a {L:2 ATTRID ATTRDATA}}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJCMD U1:1 (always)  Specifies an action to be performed by an object
        # TARGETSPEC A:40 (always)  Specifier of target object
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJCMD TARGETSPEC La}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[lindex $OBJCMD 0] != "U1:1"} {set ok 0; break}
        set OBJCMD [lindex $OBJCMD 1]
        if {[string first "A:" [lindex $TARGETSPEC 0]] != 0} {set ok 0; break}
        set TARGETSPEC [lindex $TARGETSPEC 1]
        if {[string first L: [lindex $La 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $La 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F17R

S14F18Supervised Obj Action Ack Sent by Host and Equipment

    # S14F18 Tcl Parse reply
    set reply [secs_xact $spname S14F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:b {L:2 ATTRID ATTRDATA}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lb L2_n1}
        if {[string first L: [lindex $Lb 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lb 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F19RGeneric Service Req Sent by Host Only

    # S14F19R Tcl Receive message - add next line to setup
    $spname whenever S14F19 [list recv_S14F19R $spname]

# receive procedure 
proc recv_S14F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID OPID OBJSPEC SVCNAME {L:m {L:2 SPNAME SPVAL}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OPID U4:1 (varies)  operation identifier
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # SVCNAME A:n (always)  service name
        # SPNAME A:n (always)  service parameter name
        # SPVAL A:n (varies)  service parameter value, any format type
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OPID OBJSPEC SVCNAME Lm}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first "A:" [lindex $SVCNAME 0]] != 0} {set ok 0; break}
        set SVCNAME [lindex $SVCNAME 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {SPNAME SPVAL}
            if {[string first "A:" [lindex $SPNAME 0]] != 0} {set ok 0; break}
            set SPNAME [lindex $SPNAME 1]
            #vset [split [lindex $SPVAL 0] :] {typeSPVAL lengthSPVAL}
            set SPVAL [lindex $SPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S14F19R

S14F20Generic Service Ack Sent by Host and Equipment

    # S14F20 Tcl Parse reply
    set reply [secs_xact $spname S14F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 SVCACK LINKID {L:n {L:2 SPNAME SPVAL}} {L:2 SVCACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # SVCACK B:1 (always)  service acknowledge code
        # LINKID U4:1 (always)  correlates the RMOPID value in a request to a completion report
        # SPNAME A:n (always)  service parameter name
        # SPVAL A:n (varies)  service parameter value, any format type
        # SVCACK B:1 (always)  service acknowledge code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {SVCACK LINKID Ln L2_n1}
        if {[lindex $SVCACK 0] != "B:1"} {set ok 0; break}
        set SVCACK [expr [lindex $SVCACK 1]]  ;# expr converts 0xhh to int
        if {[lindex $LINKID 0] != "U4:1"} {set ok 0; break}
        set LINKID [lindex $LINKID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {SPNAME SPVAL}
            if {[string first "A:" [lindex $SPNAME 0]] != 0} {set ok 0; break}
            set SPNAME [lindex $SPNAME 1]
            #vset [split [lindex $SPVAL 0] :] {typeSPVAL lengthSPVAL}
            set SPVAL [lindex $SPVAL 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {SVCACK Lp_1}
        if {[lindex $SVCACK 0] != "B:1"} {set ok 0; break}
        set SVCACK [expr [lindex $SVCACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F21RGeneric Service Completion Sent by Host and Equipment

    # S14F21R Tcl Receive message - add next line to setup
    $spname whenever S14F21 [list recv_S14F21R $spname]

# receive procedure 
proc recv_S14F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID OPID LINKID {L:n {L:2 SPNAME SPVAL}} {L:2 SVCACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OPID U4:1 (varies)  operation identifier
        # LINKID U4:1 (always)  correlates the RMOPID value in a request to a completion report
        # SPNAME A:n (always)  service parameter name
        # SPVAL A:n (varies)  service parameter value, any format type
        # SVCACK B:1 (always)  service acknowledge code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OPID LINKID Ln L2_n1}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[lindex $LINKID 0] != "U4:1"} {set ok 0; break}
        set LINKID [lindex $LINKID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {SPNAME SPVAL}
            if {[string first "A:" [lindex $SPNAME 0]] != 0} {set ok 0; break}
            set SPNAME [lindex $SPNAME 1]
            #vset [split [lindex $SPVAL 0] :] {typeSPVAL lengthSPVAL}
            set SPVAL [lindex $SPVAL 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {SVCACK Lp_1}
        if {[lindex $SVCACK 0] != "B:1"} {set ok 0; break}
        set SVCACK [expr [lindex $SVCACK 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F21R

S14F22Generic Service Comp Ack Sent by Host and Equipment

    # S14F22 Tcl Parse reply
    set reply [secs_xact $spname S14F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect DATAACK
        # DATAACK B:1 (always)  Acknowledgement code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set DATAACK [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S14F23RMulti-block Generic Service Inquire Sent by Host and Equipment

    # S14F23R Tcl Receive message - add next line to setup
    $spname whenever S14F23 [list recv_S14F23R $spname]

# receive procedure 
proc recv_S14F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F23R

S14F24Multi-block Generic Service Grant Sent by Host and Equipment

    # S14F24 Tcl Parse reply
    set reply [secs_xact $spname S14F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S14F25RService Name Request Sent by Host and Equipment

    # S14F25R Tcl Receive message - add next line to setup
    $spname whenever S14F25 [list recv_S14F25R $spname]

# receive procedure 
proc recv_S14F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 OBJSPEC {L:n OBJTYPE}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC Ln}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach OBJTYPE [lreplace $Ln 0 0] {
            #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
            set OBJTYPE [lindex $OBJTYPE 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F25R

S14F26Service Name Data Sent by Host and Equipment

    # S14F26 Tcl Parse reply
    set reply [secs_xact $spname S14F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:2 OBJTYPE {L:a SVCNAME}}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # SVCNAME A:n (always)  service name
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {OBJTYPE La_2}
            #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
            set OBJTYPE [lindex $OBJTYPE 1]
            if {[string first L: [lindex $La_2 0]] != 0} {set ok 0; break}
            foreach SVCNAME [lreplace $La_2 0 0] {
                if {[string first "A:" [lindex $SVCNAME 0]] != 0} {set ok 0; break}
                set SVCNAME [lindex $SVCNAME 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S14F27RService Parameter Name Req Sent by Host and Equipment

    # S14F27R Tcl Receive message - add next line to setup
    $spname whenever S14F27 [list recv_S14F27R $spname]

# receive procedure 
proc recv_S14F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 OBJSPEC OBJTYPE {L:n SVCNAME}
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # OBJTYPE A:40 (varies)  object class name, chars 0x20-0x7e but not >, ?, *, or ~.  Does not begin or end with space.
        # SVCNAME A:n (always)  service name
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OBJSPEC OBJTYPE Ln}
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        #vset [split [lindex $OBJTYPE 0] :] {typeOBJTYPE lengthOBJTYPE}
        set OBJTYPE [lindex $OBJTYPE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach SVCNAME [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $SVCNAME 0]] != 0} {set ok 0; break}
            set SVCNAME [lindex $SVCNAME 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S14F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S14F27R

S14F28Service Parameter Name Data Sent by Host and Equipment

    # S14F28 Tcl Parse reply
    set reply [secs_xact $spname S14F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:2 SVCNAME {L:a SPNAME}}} {L:2 OBJACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # SVCNAME A:n (always)  service name
        # SPNAME A:n (always)  service parameter name
        # OBJACK U1:1 (always)  acknowledge code, 0 ok, 1 error
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {SVCNAME La_2}
            if {[string first "A:" [lindex $SVCNAME 0]] != 0} {set ok 0; break}
            set SVCNAME [lindex $SVCNAME 1]
            if {[string first L: [lindex $La_2 0]] != 0} {set ok 0; break}
            foreach SPNAME [lreplace $La_2 0 0] {
                if {[string first "A:" [lindex $SPNAME 0]] != 0} {set ok 0; break}
                set SPNAME [lindex $SPNAME 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {OBJACK Lp_1}
        if {[lindex $OBJACK 0] != "U1:1"} {set ok 0; break}
        set OBJACK [lindex $OBJACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F1RRecipe Management Multi-Block Inquire Sent by Host and Equipment

    # S15F1R Tcl Receive message - add next line to setup
    $spname whenever S15F1 [list recv_S15F1R $spname]

# receive procedure 
proc recv_S15F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID RCPSPEC RMDATASIZE
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPSPEC A:n (always)  recipe specifier
        # RMDATASIZE U4:1 (varies)  the maximum total message body length of a SECS-II message
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPSPEC RMDATASIZE}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        #vset [split [lindex $RMDATASIZE 0] :] {typeRMDATASIZE lengthRMDATASIZE}
        set RMDATASIZE [lindex $RMDATASIZE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F1R

S15F2Recipe Management Multi-block Grant Sent by Host and Equipment

    # S15F2 Tcl Parse reply
    set reply [secs_xact $spname S15F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect RMGRNT
        # RMGRNT B:1 (always)  grant code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set RMGRNT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S15F3RRecipe Namespace Action Req Sent by Host and Equipment

    # S15F3R Tcl Receive message - add next line to setup
    $spname whenever S15F3 [list recv_S15F3R $spname]

# receive procedure 
proc recv_S15F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 RMNSSPEC RMNSCMD
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # RMNSCMD U1:1 (always)  recipe namespace command
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMNSSPEC RMNSCMD}
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        if {[lindex $RMNSCMD 0] != "U1:1"} {set ok 0; break}
        set RMNSCMD [lindex $RMNSCMD 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F3R

S15F4Recipe Namespace Action Sent by Host and Equipment

    # S15F4 Tcl Parse reply
    set reply [secs_xact $spname S15F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F5RRecipe Namespace Rename Req Sent by Host and Equipment

    # S15F5R Tcl Receive message - add next line to setup
    $spname whenever S15F5 [list recv_S15F5R $spname]

# receive procedure 
proc recv_S15F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 RMNSSPEC RMNEWNS
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # RMNEWNS A:n (always)  new name for a recipe namespace
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMNSSPEC RMNEWNS}
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        if {[string first "A:" [lindex $RMNEWNS 0]] != 0} {set ok 0; break}
        set RMNEWNS [lindex $RMNEWNS 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F5R

S15F6Recipe Namespace Rename Ack Sent by Host and Equipment

    # S15F6 Tcl Parse reply
    set reply [secs_xact $spname S15F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F7RRecipe Space Req Sent by Host and Equipment

    # S15F7R Tcl Receive message - add next line to setup
    $spname whenever S15F7 [list recv_S15F7R $spname]

# receive procedure 
proc recv_S15F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect OBJSPEC
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        #vset [split [lindex $TSN_data 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F7R

S15F8Recipe Space Data Sent by Host and Equipment

    # S15F8 Tcl Parse reply
    set reply [secs_xact $spname S15F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMSPACE {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RMSPACE U4:1 (varies)  the amount of storage available in bytes for at least one recipe
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMSPACE L2}
        #vset [split [lindex $RMSPACE 0] :] {typeRMSPACE lengthRMSPACE}
        set RMSPACE [lindex $RMSPACE 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F9RRecipe Status Request Sent by Host and Equipment

    # S15F9R Tcl Receive message - add next line to setup
    $spname whenever S15F9 [list recv_S15F9R $spname]

# receive procedure 
proc recv_S15F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RCPSPEC
        # RCPSPEC A:n (always)  recipe specifier
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F9R

S15F10Recipe Status Data Sent by Host and Equipment

    # S15F10 Tcl Parse reply
    set reply [secs_xact $spname S15F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 RCPSTAT RCPVERS {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPSTAT U1:1 (always)  Recipe status code
        # RCPVERS A:n (always)  recipe version
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSTAT RCPVERS L2}
        if {[lindex $RCPSTAT 0] != "U1:1"} {set ok 0; break}
        set RCPSTAT [lindex $RCPSTAT 1]
        if {[string first "A:" [lindex $RCPVERS 0]] != 0} {set ok 0; break}
        set RCPVERS [lindex $RCPVERS 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F11RRecipe Version Request Sent by Host and Equipment

    # S15F11R Tcl Receive message - add next line to setup
    $spname whenever S15F11 [list recv_S15F11R $spname]

# receive procedure 
proc recv_S15F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 RMNSSPEC RCPCLASS RCPNAME AGENT
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # RCPCLASS A:n (always)  Recipe class
        # RCPNAME A:n (always)  recipe name
        # AGENT A:n (always)  no description, no max length
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMNSSPEC RCPCLASS RCPNAME AGENT}
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        if {[string first "A:" [lindex $RCPCLASS 0]] != 0} {set ok 0; break}
        set RCPCLASS [lindex $RCPCLASS 1]
        if {[string first "A:" [lindex $RCPNAME 0]] != 0} {set ok 0; break}
        set RCPNAME [lindex $RCPNAME 1]
        if {[string first "A:" [lindex $AGENT 0]] != 0} {set ok 0; break}
        set AGENT [lindex $AGENT 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F11R

S15F12Recipe Version Data Sent by Host and Equipment

    # S15F12 Tcl Parse reply
    set reply [secs_xact $spname S15F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 AGENT RCPVERS {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # AGENT A:n (always)  no description, no max length
        # RCPVERS A:n (always)  recipe version
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {AGENT RCPVERS L2}
        if {[string first "A:" [lindex $AGENT 0]] != 0} {set ok 0; break}
        set AGENT [lindex $AGENT 1]
        if {[string first "A:" [lindex $RCPVERS 0]] != 0} {set ok 0; break}
        set RCPVERS [lindex $RCPVERS 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F13RRecipe Create Req Sent by Host and Equipment

    # S15F13R Tcl Receive message - add next line to setup
    $spname whenever S15F13 [list recv_S15F13R $spname]

# receive procedure 
proc recv_S15F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID RCPUPDT RCPSPEC {L:m {L:2 RCPATTRID RCPATTRDATA}} RCPBODY
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPUPDT TF:1 (always)  true for a recipe update, false for create
        # RCPSPEC A:n (always)  recipe specifier
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RCPBODY (list)B:n (varies)  Recipe body
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPUPDT RCPSPEC Lm RCPBODY}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[lindex $RCPUPDT 0] != "TF:1"} {set ok 0; break}
        set RCPUPDT [lindex $RCPUPDT 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        #vset [split [lindex $RCPBODY 0] :] {typeRCPBODY lengthRCPBODY}
        # convert list of type B 0xhh to int using expr
        set RCPBODY {}; foreach v [lreplace $RCPBODY 0 0] {lappend RCPBODY [expr {$v}]}
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F13R

S15F14Recipe Create Ack Sent by Host and Equipment

    # S15F14 Tcl Parse reply
    set reply [secs_xact $spname S15F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F15RRecipe Store Req Sent by Host and Equipment

    # S15F15R Tcl Receive message - add next line to setup
    $spname whenever S15F15 [list recv_S15F15R $spname]

# receive procedure 
proc recv_S15F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID RCPSPEC RCPSECCODE {L:q {L:r RCPSECNM {L:g {L:2 RCPATTRID RCPATTRDATA}}} RCPBODY {L:m {L:2 RCPSECNM {L:a {L:2 RCPATTRID RCPATTRDATA}}}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPSPEC A:n (always)  recipe specifier
        # RCPSECCODE B:1 (always)  indicates the sections of a recipe
        # RCPSECNM A:n (always)  Recipe section name, "Generic", "Body", "ASDS"
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RCPBODY (list)B:n (varies)  Recipe body
        # RCPSECNM A:n (always)  Recipe section name, "Generic", "Body", "ASDS"
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPSPEC RCPSECCODE Lq}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[lindex $RCPSECCODE 0] != "B:1"} {set ok 0; break}
        set RCPSECCODE [expr [lindex $RCPSECCODE 1]]  ;# expr converts 0xhh to int
        if {[string first L: [lindex $Lq 0]] != 0} {set ok 0; break}
        foreach {Lr_1 RCPBODY Lm_1_n1} [lreplace $Lq 0 0] {
            if {[string first L: [lindex $Lr_1 0]] != 0} {set ok 0; break}
            foreach {RCPSECNM Lg_2} [lreplace $Lr_1 0 0] {
                if {[string first "A:" [lindex $RCPSECNM 0]] != 0} {set ok 0; break}
                set RCPSECNM [lindex $RCPSECNM 1]
                if {[string first L: [lindex $Lg_2 0]] != 0} {set ok 0; break}
                foreach L2_3 [lreplace $Lg_2 0 0] {
                    if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                    vset [lreplace $L2_3 0 0] {RCPATTRID RCPATTRDATA}
                    if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
                    set RCPATTRID [lindex $RCPATTRID 1]
                    #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
                    set RCPATTRDATA [lindex $RCPATTRDATA 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            #vset [split [lindex $RCPBODY 0] :] {typeRCPBODY lengthRCPBODY}
            # convert list of type B 0xhh to int using expr
            set RCPBODY {}; foreach v [lreplace $RCPBODY 0 0] {lappend RCPBODY [expr {$v}]}
            if {[string first L: [lindex $Lm_1_n1 0]] != 0} {set ok 0; break}
            foreach L2_2 [lreplace $Lm_1_n1 0 0] {
                if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_2 0 0] {RCPSECNM La_3}
                if {[string first "A:" [lindex $RCPSECNM 0]] != 0} {set ok 0; break}
                set RCPSECNM [lindex $RCPSECNM 1]
                if {[string first L: [lindex $La_3 0]] != 0} {set ok 0; break}
                foreach L2_4 [lreplace $La_3 0 0] {
                    if { [lindex $L2_4 0] != "L:2" } {set ok 0; break}
                    vset [lreplace $L2_4 0 0] {RCPATTRID RCPATTRDATA}
                    if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
                    set RCPATTRID [lindex $RCPATTRID 1]
                    #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
                    set RCPATTRDATA [lindex $RCPATTRDATA 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F15R

S15F16Recipe Store Ack Sent by Host and Equipment

    # S15F16 Tcl Parse reply
    set reply [secs_xact $spname S15F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RCPSECCODE {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPSECCODE B:1 (always)  indicates the sections of a recipe
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSECCODE L2}
        if {[lindex $RCPSECCODE 0] != "B:1"} {set ok 0; break}
        set RCPSECCODE [expr [lindex $RCPSECCODE 1]]  ;# expr converts 0xhh to int
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F17RRecipe Retrieve Req Sent by Host and Equipment

    # S15F17R Tcl Receive message - add next line to setup
    $spname whenever S15F17 [list recv_S15F17R $spname]

# receive procedure 
proc recv_S15F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 RCPSPEC RCPSECCODE
        # RCPSPEC A:n (always)  recipe specifier
        # RCPSECCODE B:1 (always)  indicates the sections of a recipe
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSPEC RCPSECCODE}
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[lindex $RCPSECCODE 0] != "B:1"} {set ok 0; break}
        set RCPSECCODE [expr [lindex $RCPSECCODE 1]]  ;# expr converts 0xhh to int
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F17R

S15F18Recipe Retrieve Data Sent by Host and Equipment

    # S15F18 Tcl Parse reply
    set reply [secs_xact $spname S15F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:q {L:r RCPSECNM {L:g {L:2 RCPATTRID RCPATTRDATA}}} RCPBODY {L:m {L:2 RCPSECNM {L:a {L:2 RCPATTRID RCPATTRDATA}}}}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPSECNM A:n (always)  Recipe section name, "Generic", "Body", "ASDS"
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RCPBODY (list)B:n (varies)  Recipe body
        # RCPSECNM A:n (always)  Recipe section name, "Generic", "Body", "ASDS"
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lq L2_n1}
        if {[string first L: [lindex $Lq 0]] != 0} {set ok 0; break}
        foreach {Lr_1 RCPBODY Lm_1_n1} [lreplace $Lq 0 0] {
            if {[string first L: [lindex $Lr_1 0]] != 0} {set ok 0; break}
            foreach {RCPSECNM Lg_2} [lreplace $Lr_1 0 0] {
                if {[string first "A:" [lindex $RCPSECNM 0]] != 0} {set ok 0; break}
                set RCPSECNM [lindex $RCPSECNM 1]
                if {[string first L: [lindex $Lg_2 0]] != 0} {set ok 0; break}
                foreach L2_3 [lreplace $Lg_2 0 0] {
                    if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                    vset [lreplace $L2_3 0 0] {RCPATTRID RCPATTRDATA}
                    if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
                    set RCPATTRID [lindex $RCPATTRID 1]
                    #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
                    set RCPATTRDATA [lindex $RCPATTRDATA 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            #vset [split [lindex $RCPBODY 0] :] {typeRCPBODY lengthRCPBODY}
            # convert list of type B 0xhh to int using expr
            set RCPBODY {}; foreach v [lreplace $RCPBODY 0 0] {lappend RCPBODY [expr {$v}]}
            if {[string first L: [lindex $Lm_1_n1 0]] != 0} {set ok 0; break}
            foreach L2_2 [lreplace $Lm_1_n1 0 0] {
                if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_2 0 0] {RCPSECNM La_3}
                if {[string first "A:" [lindex $RCPSECNM 0]] != 0} {set ok 0; break}
                set RCPSECNM [lindex $RCPSECNM 1]
                if {[string first L: [lindex $La_3 0]] != 0} {set ok 0; break}
                foreach L2_4 [lreplace $La_3 0 0] {
                    if { [lindex $L2_4 0] != "L:2" } {set ok 0; break}
                    vset [lreplace $L2_4 0 0] {RCPATTRID RCPATTRDATA}
                    if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
                    set RCPATTRID [lindex $RCPATTRID 1]
                    #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
                    set RCPATTRDATA [lindex $RCPATTRDATA 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F19RRecipe Rename Req Sent by Host and Equipment

    # S15F19R Tcl Receive message - add next line to setup
    $spname whenever S15F19 [list recv_S15F19R $spname]

# receive procedure 
proc recv_S15F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 RCPSPEC RCPRENAME RCPNEWID
        # RCPSPEC A:n (always)  recipe specifier
        # RCPRENAME TF:1 (always)  whether a recipe is to be renamed (TRUE) or copied (FALSE)
        # RCPNEWID A:n (always)  the new recipe identifier
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSPEC RCPRENAME RCPNEWID}
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[lindex $RCPRENAME 0] != "TF:1"} {set ok 0; break}
        set RCPRENAME [lindex $RCPRENAME 1]
        if {[string first "A:" [lindex $RCPNEWID 0]] != 0} {set ok 0; break}
        set RCPNEWID [lindex $RCPNEWID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F19R

S15F20Recipe Rename Ack Sent by Host and Equipment

    # S15F20 Tcl Parse reply
    set reply [secs_xact $spname S15F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F21RRecipe Action Req Sent by Host and Equipment

    # S15F21R Tcl Receive message - add next line to setup
    $spname whenever S15F21 [list recv_S15F21R $spname]

# receive procedure 
proc recv_S15F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:6 DATAID RCPCMD RMNSSPEC OPID AGENT {L:n RCPID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPCMD U1:1 (always)  recipe action
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # OPID U4:1 (varies)  operation identifier
        # AGENT A:n (always)  no description, no max length
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        if { [lindex $TSN_data 0] != "L:6" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPCMD RMNSSPEC OPID AGENT Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[lindex $RCPCMD 0] != "U1:1"} {set ok 0; break}
        set RCPCMD [lindex $RCPCMD 1]
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[string first "A:" [lindex $AGENT 0]] != 0} {set ok 0; break}
        set AGENT [lindex $AGENT 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RCPID [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F21R

S15F22Recipe Action Ack Sent by Host and Equipment

    # S15F22 Tcl Parse reply
    set reply [secs_xact $spname S15F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 AGENT LINKID RCPCMD {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # AGENT A:n (always)  no description, no max length
        # LINKID U4:1 (always)  correlates the RMOPID value in a request to a completion report
        # RCPCMD U1:1 (always)  recipe action
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {AGENT LINKID RCPCMD L2}
        if {[string first "A:" [lindex $AGENT 0]] != 0} {set ok 0; break}
        set AGENT [lindex $AGENT 1]
        if {[lindex $LINKID 0] != "U4:1"} {set ok 0; break}
        set LINKID [lindex $LINKID 1]
        if {[lindex $RCPCMD 0] != "U1:1"} {set ok 0; break}
        set RCPCMD [lindex $RCPCMD 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F23RRecipe Descriptor Req Sent by Host and Equipment

    # S15F23R Tcl Receive message - add next line to setup
    $spname whenever S15F23 [list recv_S15F23R $spname]

# receive procedure 
proc recv_S15F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID OBJSPEC {L:n RCPID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RCPID [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F23R

S15F24Recipe Descriptor Data Sent by Host and Equipment

    # S15F24 Tcl Parse reply
    set reply [secs_xact $spname S15F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:a {L:r RCPDESCNM RCPDESCTIME RCPDESCLTH}}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPDESCNM A:n (always)  Identifies a descriptor type "ASDesc", "BodyDesc", "GenDesc"
        # RCPDESCTIME A:16 (always)  timestamp of a recipe section "YYYYMMDDhhmmsscc"
        # RCPDESCLTH U4:1 (varies)  the byte length of a recipe
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach La_1 [lreplace $Ln 0 0] {
            if {[string first L: [lindex $La_1 0]] != 0} {set ok 0; break}
            foreach Lr_2 [lreplace $La_1 0 0] {
                if {[string first L: [lindex $Lr_2 0]] != 0} {set ok 0; break}
                foreach {RCPDESCNM RCPDESCTIME RCPDESCLTH} [lreplace $Lr_2 0 0] {
                    if {[string first "A:" [lindex $RCPDESCNM 0]] != 0} {set ok 0; break}
                    set RCPDESCNM [lindex $RCPDESCNM 1]
                    if {[string first "A:" [lindex $RCPDESCTIME 0]] != 0} {set ok 0; break}
                    set RCPDESCTIME [lindex $RCPDESCTIME 1]
                    #vset [split [lindex $RCPDESCLTH 0] :] {typeRCPDESCLTH lengthRCPDESCLTH}
                    set RCPDESCLTH [lindex $RCPDESCLTH 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F25RRecipe Parameter Update Req Sent by Host and Equipment

    # S15F25R Tcl Receive message - add next line to setup
    $spname whenever S15F25 [list recv_S15F25R $spname]

# receive procedure 
proc recv_S15F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID RMNSSPEC AGENT {L:n {L:3 RCPPARNM RCPPARVAL RCPPARRULE}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # AGENT A:n (always)  no description, no max length
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        # RCPPARRULE A:80 (always)  the restrictions applied to a recipe variable parameter setting
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RMNSSPEC AGENT Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        if {[string first "A:" [lindex $AGENT 0]] != 0} {set ok 0; break}
        set AGENT [lindex $AGENT 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {RCPPARNM RCPPARVAL RCPPARRULE}
            if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
            set RCPPARNM [lindex $RCPPARNM 1]
            #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
            set RCPPARVAL [lindex $RCPPARVAL 1]
            if {[string first "A:" [lindex $RCPPARRULE 0]] != 0} {set ok 0; break}
            set RCPPARRULE [lindex $RCPPARRULE 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F25R

S15F26Recipe Parameter Update Ack Sent by Host and Equipment

    # S15F26 Tcl Parse reply
    set reply [secs_xact $spname S15F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F27RRecipe Download Req Sent by Host Only

    # S15F27R Tcl Receive message - add next line to setup
    $spname whenever S15F27 [list recv_S15F27R $spname]

# receive procedure 
proc recv_S15F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID RCPOWCODE RCPSPEC {L:m {L:2 RCPATTRID RCPATTRDATA}} RCPBODY
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPOWCODE TF:1 (always)  recipe overwrite code, true=overwrite ok, false=do not overwrite
        # RCPSPEC A:n (always)  recipe specifier
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RCPBODY (list)B:n (varies)  Recipe body
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPOWCODE RCPSPEC Lm RCPBODY}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[lindex $RCPOWCODE 0] != "TF:1"} {set ok 0; break}
        set RCPOWCODE [lindex $RCPOWCODE 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        #vset [split [lindex $RCPBODY 0] :] {typeRCPBODY lengthRCPBODY}
        # convert list of type B 0xhh to int using expr
        set RCPBODY {}; foreach v [lreplace $RCPBODY 0 0] {lappend RCPBODY [expr {$v}]}
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F27R

S15F28Recipe Download Ack Sent by Equipment Only

    # S15F28 Tcl Parse reply
    set reply [secs_xact $spname S15F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 RCPID {L:n {L:2 RCPATTRID RCPATTRDATA}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPID Ln L2_n1}
        if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
        set RCPID [lindex $RCPID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F29RRecipe Verify Req Sent by Host Only

    # S15F29R Tcl Receive message - add next line to setup
    $spname whenever S15F29 [list recv_S15F29R $spname]

# receive procedure 
proc recv_S15F29R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID OPID RESPEC {L:m RCPID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OPID U4:1 (varies)  operation identifier
        # RESPEC A:n (always)  object specifier for the recipe executor
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OPID RESPEC Lm}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[string first "A:" [lindex $RESPEC 0]] != 0} {set ok 0; break}
        set RESPEC [lindex $RESPEC 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach RCPID [lreplace $Lm 0 0] {
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F29R

S15F30Recipe Verify Ack Sent by Equipment Only

    # S15F30 Tcl Parse reply
    set reply [secs_xact $spname S15F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:5 OPID LINKID RCPID {L:n {L:2 RCPATTRID RCPATTRDATA}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # OPID U4:1 (varies)  operation identifier
        # LINKID U4:1 (always)  correlates the RMOPID value in a request to a completion report
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {OPID LINKID RCPID Ln L2_n1}
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[lindex $LINKID 0] != "U4:1"} {set ok 0; break}
        set LINKID [lindex $LINKID 1]
        if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
        set RCPID [lindex $RCPID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F31RRecipe Unload Req Sent by Host Only

    # S15F31R Tcl Receive message - add next line to setup
    $spname whenever S15F31 [list recv_S15F31R $spname]

# receive procedure 
proc recv_S15F31R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect RCPSPEC
        # RCPSPEC A:n (always)  recipe specifier
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F32 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F31R

S15F32Recipe Unload Data Sent by Equipment Only

    # S15F32 Tcl Parse reply
    set reply [secs_xact $spname S15F31R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 RCPSPEC {L:m {L:2 RCPATTRID RCPATTRDATA}} RCPBODY {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPSPEC A:n (always)  recipe specifier
        # RCPATTRID A:n (always)  the name of a recipe attribute, but not used to indicate the recipe identifier
        # RCPATTRDATA A:n (varies)  the value of a recipe attribute, any type of data including list
        # RCPBODY (list)B:n (varies)  Recipe body
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSPEC Lm RCPBODY L2_n1}
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPATTRID RCPATTRDATA}
            if {[string first "A:" [lindex $RCPATTRID 0]] != 0} {set ok 0; break}
            set RCPATTRID [lindex $RCPATTRID 1]
            #vset [split [lindex $RCPATTRDATA 0] :] {typeRCPATTRDATA lengthRCPATTRDATA}
            set RCPATTRDATA [lindex $RCPATTRDATA 1]
            }
        if {!$ok} break
        #vset [split [lindex $RCPBODY 0] :] {typeRCPBODY lengthRCPBODY}
        # convert list of type B 0xhh to int using expr
        set RCPBODY {}; foreach v [lreplace $RCPBODY 0 0] {lappend RCPBODY [expr {$v}]}
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F33RRecipe Select Req Sent by Host Only

    # S15F33R Tcl Receive message - add next line to setup
    $spname whenever S15F33 [list recv_S15F33R $spname]

# receive procedure 
proc recv_S15F33R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID RESPEC {L:r {L:2 RCPID {L:p {L:2 RCPPARNM RCPPARVAL}}}} 
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RESPEC A:n (always)  object specifier for the recipe executor
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RESPEC Lr}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RESPEC 0]] != 0} {set ok 0; break}
        set RESPEC [lindex $RESPEC 1]
        if {[string first L: [lindex $Lr 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lr 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPID Lp_2}
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            if {[string first L: [lindex $Lp_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Lp_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {RCPPARNM RCPPARVAL}
                if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
                set RCPPARNM [lindex $RCPPARNM 1]
                #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
                set RCPPARVAL [lindex $RCPPARVAL 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F34 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F33R

S15F34Recipe Select Ack Sent by Equipment Only

    # S15F34 Tcl Parse reply
    set reply [secs_xact $spname S15F33R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F35RRecipe Delete Req Sent by Host Only

    # S15F35R Tcl Receive message - add next line to setup
    $spname whenever S15F35 [list recv_S15F35R $spname]

# receive procedure 
proc recv_S15F35R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID RESPEC RCPDEL {L:n RCPID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RESPEC A:n (always)  object specifier for the recipe executor
        # RCPDEL U1:1 (always)  recipe action
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RESPEC RCPDEL Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RESPEC 0]] != 0} {set ok 0; break}
        set RESPEC [lindex $RESPEC 1]
        if {[lindex $RCPDEL 0] != "U1:1"} {set ok 0; break}
        set RCPDEL [lindex $RCPDEL 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RCPID [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F36 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F35R

S15F36Recipe Delete Ack Sent by Equipment Only

    # S15F36 Tcl Parse reply
    set reply [secs_xact $spname S15F35R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F37RDRNS Segment Approve Action Req Sent by Host and Equipment

    # S15F37R Tcl Receive message - add next line to setup
    $spname whenever S15F37 [list recv_S15F37R $spname]

# receive procedure 
proc recv_S15F37R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:6 RMSEGSPEC OBJTOKEN RMGRNT OPID RCPID RMCHGTYPE
        # RMSEGSPEC A:n (always)  The object ID of a distributed recipe namespace segment
        # OBJTOKEN U4:1 (always)  token used for authorization
        # RMGRNT B:1 (always)  grant code, 0 ok
        # OPID U4:1 (varies)  operation identifier
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RMCHGTYPE U4:1 (varies)  type of change for a recipe
        if { [lindex $TSN_data 0] != "L:6" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMSEGSPEC OBJTOKEN RMGRNT OPID RCPID RMCHGTYPE}
        if {[string first "A:" [lindex $RMSEGSPEC 0]] != 0} {set ok 0; break}
        set RMSEGSPEC [lindex $RMSEGSPEC 1]
        if {[lindex $OBJTOKEN 0] != "U4:1"} {set ok 0; break}
        set OBJTOKEN [lindex $OBJTOKEN 1]
        if {[lindex $RMGRNT 0] != "B:1"} {set ok 0; break}
        set RMGRNT [expr [lindex $RMGRNT 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
        set RCPID [lindex $RCPID 1]
        #vset [split [lindex $RMCHGTYPE 0] :] {typeRMCHGTYPE lengthRMCHGTYPE}
        set RMCHGTYPE [lindex $RMCHGTYPE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F38 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F37R

S15F38DRNS Segment Approve Action Ack Sent by Host and Equipment

    # S15F38 Tcl Parse reply
    set reply [secs_xact $spname S15F37R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F39RDRNS Recorder Seg Req Sent by Host and Equipment

    # S15F39R Tcl Receive message - add next line to setup
    $spname whenever S15F39 [list recv_S15F39R $spname]

# receive procedure 
proc recv_S15F39R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID RMNSCMD RMRECSPEC RMSEGSPEC OBJTOKEN
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RMNSCMD U1:1 (always)  recipe namespace command
        # RMRECSPEC A:n (always)  object id of a distributed recipe namespace recorder
        # RMSEGSPEC A:n (always)  The object ID of a distributed recipe namespace segment
        # OBJTOKEN U4:1 (always)  token used for authorization
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RMNSCMD RMRECSPEC RMSEGSPEC OBJTOKEN}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[lindex $RMNSCMD 0] != "U1:1"} {set ok 0; break}
        set RMNSCMD [lindex $RMNSCMD 1]
        if {[string first "A:" [lindex $RMRECSPEC 0]] != 0} {set ok 0; break}
        set RMRECSPEC [lindex $RMRECSPEC 1]
        if {[string first "A:" [lindex $RMSEGSPEC 0]] != 0} {set ok 0; break}
        set RMSEGSPEC [lindex $RMSEGSPEC 1]
        if {[lindex $OBJTOKEN 0] != "U4:1"} {set ok 0; break}
        set OBJTOKEN [lindex $OBJTOKEN 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F40 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F39R

S15F40DRNS Recorder Seg Ack Sent by Host and Equipment

    # S15F40 Tcl Parse reply
    set reply [secs_xact $spname S15F39R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F41RDRNS Recorder Mod Req Sent by Host and Equipment

    # S15F41R Tcl Receive message - add next line to setup
    $spname whenever S15F41 [list recv_S15F41R $spname]

# receive procedure 
proc recv_S15F41R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID RMRECSPEC OBJTOKEN RMNSCMD {L:c RCPID RCPNEWID RMSEGSPEC RMCHGTYPE OPID TIMESTAMP RMREQUESTOR}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RMRECSPEC A:n (always)  object id of a distributed recipe namespace recorder
        # OBJTOKEN U4:1 (always)  token used for authorization
        # RMNSCMD U1:1 (always)  recipe namespace command
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RCPNEWID A:n (always)  the new recipe identifier
        # RMSEGSPEC A:n (always)  The object ID of a distributed recipe namespace segment
        # RMCHGTYPE U4:1 (varies)  type of change for a recipe
        # OPID U4:1 (varies)  operation identifier
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # RMREQUESTOR TF:1 (always)  True when the initiator of a change request is an attached segment, otherwise false
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RMRECSPEC OBJTOKEN RMNSCMD Lc}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RMRECSPEC 0]] != 0} {set ok 0; break}
        set RMRECSPEC [lindex $RMRECSPEC 1]
        if {[lindex $OBJTOKEN 0] != "U4:1"} {set ok 0; break}
        set OBJTOKEN [lindex $OBJTOKEN 1]
        if {[lindex $RMNSCMD 0] != "U1:1"} {set ok 0; break}
        set RMNSCMD [lindex $RMNSCMD 1]
        if {[string first L: [lindex $Lc 0]] != 0} {set ok 0; break}
        foreach {RCPID RCPNEWID RMSEGSPEC RMCHGTYPE OPID TIMESTAMP RMREQUESTOR} [lreplace $Lc 0 0] {
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            if {[string first "A:" [lindex $RCPNEWID 0]] != 0} {set ok 0; break}
            set RCPNEWID [lindex $RCPNEWID 1]
            if {[string first "A:" [lindex $RMSEGSPEC 0]] != 0} {set ok 0; break}
            set RMSEGSPEC [lindex $RMSEGSPEC 1]
            #vset [split [lindex $RMCHGTYPE 0] :] {typeRMCHGTYPE lengthRMCHGTYPE}
            set RMCHGTYPE [lindex $RMCHGTYPE 1]
            #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
            set OPID [lindex $OPID 1]
            if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
            set TIMESTAMP [lindex $TIMESTAMP 1]
            if {[lindex $RMREQUESTOR 0] != "TF:1"} {set ok 0; break}
            set RMREQUESTOR [lindex $RMREQUESTOR 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F42 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F41R

S15F42DRNS Recorder Mod Ack Sent by Host and Equipment

    # S15F42 Tcl Parse reply
    set reply [secs_xact $spname S15F41R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F43RDRNS Get Change Req Sent by Host and Equipment

    # S15F43R Tcl Receive message - add next line to setup
    $spname whenever S15F43 [list recv_S15F43R $spname]

# receive procedure 
proc recv_S15F43R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 DATAID OBJSPEC TARGETSPEC
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # TARGETSPEC A:40 (always)  Specifier of target object
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC TARGETSPEC}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first "A:" [lindex $TARGETSPEC 0]] != 0} {set ok 0; break}
        set TARGETSPEC [lindex $TARGETSPEC 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F44 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F43R

S15F44DRNS Get Change Ack Sent by Host and Equipment

    # S15F44 Tcl Parse reply
    set reply [secs_xact $spname S15F43R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:n {L:7 RCPID RCPNEWID RMSEGSPEC RMCHGTYPE OPID TIMESTAMP RMREQUESTOR}} {L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}}
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RCPNEWID A:n (always)  the new recipe identifier
        # RMSEGSPEC A:n (always)  The object ID of a distributed recipe namespace segment
        # RMCHGTYPE U4:1 (varies)  type of change for a recipe
        # OPID U4:1 (varies)  operation identifier
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # RMREQUESTOR TF:1 (always)  True when the initiator of a change request is an attached segment, otherwise false
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Ln L2_n1}
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L7_1 [lreplace $Ln 0 0] {
            if { [lindex $L7_1 0] != "L:7" } {set ok 0; break}
            vset [lreplace $L7_1 0 0] {RCPID RCPNEWID RMSEGSPEC RMCHGTYPE OPID TIMESTAMP RMREQUESTOR}
            if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
            set RCPID [lindex $RCPID 1]
            if {[string first "A:" [lindex $RCPNEWID 0]] != 0} {set ok 0; break}
            set RCPNEWID [lindex $RCPNEWID 1]
            if {[string first "A:" [lindex $RMSEGSPEC 0]] != 0} {set ok 0; break}
            set RMSEGSPEC [lindex $RMSEGSPEC 1]
            #vset [split [lindex $RMCHGTYPE 0] :] {typeRMCHGTYPE lengthRMCHGTYPE}
            set RMCHGTYPE [lindex $RMCHGTYPE 1]
            #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
            set OPID [lindex $OPID 1]
            if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
            set TIMESTAMP [lindex $TIMESTAMP 1]
            if {[lindex $RMREQUESTOR 0] != "TF:1"} {set ok 0; break}
            set RMREQUESTOR [lindex $RMREQUESTOR 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {RMACK Lp_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lp_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F45RDRNS Mgr Seg Aprvl Req Sent by Host and Equipment

    # S15F45R Tcl Receive message - add next line to setup
    $spname whenever S15F45 [list recv_S15F45R $spname]

# receive procedure 
proc recv_S15F45R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID RCPSPEC RCPNEWID RMCHGTYPE
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RCPSPEC A:n (always)  recipe specifier
        # RCPNEWID A:n (always)  the new recipe identifier
        # RMCHGTYPE U4:1 (varies)  type of change for a recipe
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RCPSPEC RCPNEWID RMCHGTYPE}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first "A:" [lindex $RCPNEWID 0]] != 0} {set ok 0; break}
        set RCPNEWID [lindex $RCPNEWID 1]
        #vset [split [lindex $RMCHGTYPE 0] :] {typeRMCHGTYPE lengthRMCHGTYPE}
        set RMCHGTYPE [lindex $RMCHGTYPE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F46 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F45R

S15F46DRNS Mgr Seg Aprvl Ack Sent by Host and Equipment

    # S15F46 Tcl Parse reply
    set reply [secs_xact $spname S15F45R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 RMCHGTYPE RMGRNT OPID
        # RMCHGTYPE U4:1 (varies)  type of change for a recipe
        # RMGRNT B:1 (always)  grant code, 0 ok
        # OPID U4:1 (varies)  operation identifier
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMCHGTYPE RMGRNT OPID}
        #vset [split [lindex $RMCHGTYPE 0] :] {typeRMCHGTYPE lengthRMCHGTYPE}
        set RMCHGTYPE [lindex $RMCHGTYPE 1]
        if {[lindex $RMGRNT 0] != "B:1"} {set ok 0; break}
        set RMGRNT [expr [lindex $RMGRNT 1]]  ;# expr converts 0xhh to int
        #vset [split [lindex $OPID 0] :] {typeOPID lengthOPID}
        set OPID [lindex $OPID 1]
        return ;# finished ok
        } ;# end while(ok)

S15F47RDRNS Mgr Rebuild Req Sent by Host and Equipment

    # S15F47R Tcl Receive message - add next line to setup
    $spname whenever S15F47 [list recv_S15F47R $spname]

# receive procedure 
proc recv_S15F47R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID OBJSPEC RMNSSPEC RMRECSPEC {L:n RMSEGSPEC}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # OBJSPEC A:n (varies)  E39 structured text identifying an object, [object type:object id>]+
        # RMNSSPEC A:n (always)  object id of a recipe namespace
        # RMRECSPEC A:n (always)  object id of a distributed recipe namespace recorder
        # RMSEGSPEC A:n (always)  The object ID of a distributed recipe namespace segment
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID OBJSPEC RMNSSPEC RMRECSPEC Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $OBJSPEC 0] :] {typeOBJSPEC lengthOBJSPEC}
        set OBJSPEC [lindex $OBJSPEC 1]
        if {[string first "A:" [lindex $RMNSSPEC 0]] != 0} {set ok 0; break}
        set RMNSSPEC [lindex $RMNSSPEC 1]
        if {[string first "A:" [lindex $RMRECSPEC 0]] != 0} {set ok 0; break}
        set RMRECSPEC [lindex $RMRECSPEC 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RMSEGSPEC [lreplace $Ln 0 0] {
            if {[string first "A:" [lindex $RMSEGSPEC 0]] != 0} {set ok 0; break}
            set RMSEGSPEC [lindex $RMSEGSPEC 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F48 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F47R

S15F48DRNS Mgr Rebuild Ack Sent by Host and Equipment

    # S15F48 Tcl Parse reply
    set reply [secs_xact $spname S15F47R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RMACK {L:p {L:2 ERRCODE ERRTEXT}}
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RMACK Lp}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lp 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S15F49RLarge Recipe Download Req Sent by Host Only

    # S15F49R Tcl Receive message - add next line to setup
    $spname whenever S15F49 [list recv_S15F49R $spname]

# receive procedure 
proc recv_S15F49R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DSNAME RCPOWCODE
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        # RCPOWCODE TF:1 (always)  recipe overwrite code, true=overwrite ok, false=do not overwrite
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DSNAME RCPOWCODE}
        #vset [split [lindex $DSNAME 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $DSNAME 1]
        if {[lindex $RCPOWCODE 0] != "TF:1"} {set ok 0; break}
        set RCPOWCODE [lindex $RCPOWCODE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F50 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F49R

S15F50Large Recipe Download Ack Sent by Equipment Only

    # S15F50 Tcl Parse reply
    set reply [secs_xact $spname S15F49R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC15
        # ACKC15 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC15 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S15F51RLarge Recipe Upload Req Sent by Host Only

    # S15F51R Tcl Receive message - add next line to setup
    $spname whenever S15F51 [list recv_S15F51R $spname]

# receive procedure 
proc recv_S15F51R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DSNAME
        # DSNAME A:50 (varies)  the name of a dataset such as a PPID
        #vset [split [lindex $TSN_data 0] :] {typeDSNAME lengthDSNAME}
        set DSNAME [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F52 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S15F51R

S15F52Large Recipe Upload Ack Sent by Equipment Only

    # S15F52 Tcl Parse reply
    set reply [secs_xact $spname S15F51R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKC15
        # ACKC15 B:1 (always)  acknowledge code, 0 ok
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set ACKC15 [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S15F53RRecipe Verification Send Sent by Equipment Only

    # S15F53R Tcl Receive message - add next line to setup
    $spname whenever S15F53 [list recv_S15F53R $spname]

# receive procedure 
proc recv_S15F53R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 RCPSPEC RCPID {L:2 RMACK {L:n {L:2 ERRCODE ERRTEXT}}}
        # RCPSPEC A:n (always)  recipe specifier
        # RCPID A:n (always)  recipe identifier conforming to OBJSPEC
        # RMACK U1:1 (always)  recipe managment completion code
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RCPSPEC RCPID L2}
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first "A:" [lindex $RCPID 0]] != 0} {set ok 0; break}
        set RCPID [lindex $RCPID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {RMACK Ln_1}
        if {[lindex $RMACK 0] != "U1:1"} {set ok 0; break}
        set RMACK [lindex $RMACK 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S15F54 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S15F53R

S15F54Recipe Verification Ack Sent by Host Only

    # S15F54 Tcl Parse reply
    set reply [secs_xact $spname S15F53R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S16F1RProcess Job Data MBI Sent by Host Only

    # S16F1R Tcl Receive message - add next line to setup
    $spname whenever S16F1 [list recv_S16F1R $spname]

# receive procedure 
proc recv_S16F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID DATALENGTH
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID DATALENGTH}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F1R

S16F2PJD MBI Grant Sent by Equipment Only

    # S16F2 Tcl Parse reply
    set reply [secs_xact $spname S16F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)

S16F3RProcess Job Create Req Sent by Host Only

    # S16F3R Tcl Receive message - add next line to setup
    $spname whenever S16F3 [list recv_S16F3R $spname]

# receive procedure 
proc recv_S16F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:5 DATAID MF {L:n MID} {L:3 PRRECIPEMETHOD RCPSPEC {L:m {L:2 RCPPARNM RCPPARVAL}}} PRPROCESSSTART
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # PRRECIPEMETHOD U1:1 (always)  recipe type
        # RCPSPEC A:n (always)  recipe specifier
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        # PRPROCESSSTART TF:1 (always)  automatic start flag, false implies manual start
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID MF Ln L3_n1 PRPROCESSSTART}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach MID [lreplace $Ln 0 0] {
            #vset [split [lindex $MID 0] :] {typeMID lengthMID}
            set MID [lindex $MID 1]
            }
        if {!$ok} break
        if { [lindex $L3_n1 0] != "L:3" } {set ok 0; break}
        vset [lreplace $L3_n1 0 0] {PRRECIPEMETHOD RCPSPEC Lm_1}
        if {[lindex $PRRECIPEMETHOD 0] != "U1:1"} {set ok 0; break}
        set PRRECIPEMETHOD [lindex $PRRECIPEMETHOD 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first L: [lindex $Lm_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lm_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {RCPPARNM RCPPARVAL}
            if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
            set RCPPARNM [lindex $RCPPARNM 1]
            #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
            set RCPPARVAL [lindex $RCPPARVAL 1]
            }
        if {!$ok} break
        if {[lindex $PRPROCESSSTART 0] != "TF:1"} {set ok 0; break}
        set PRPROCESSSTART [lindex $PRPROCESSSTART 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F3R

S16F4Process Job Create Ack Sent by Equipment Only

    # S16F4 Tcl Parse reply
    set reply [secs_xact $spname S16F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 PRJOBID {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PRJOBID L2}
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F5RProcess Job Cmd Req Sent by Host Only

    # S16F5R Tcl Receive message - add next line to setup
    $spname whenever S16F5 [list recv_S16F5R $spname]

# receive procedure 
proc recv_S16F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID PRJOBID PRCMDNAME {L:n {L:2 CPNAME CPVAL}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # PRJOBID A:n (always)  process job identifier
        # PRCMDNAME A:6 (always)  process job commmands, START, STOP, PAUSE, RESUME, ABORT, CANCEL
        # CPNAME A:n (varies)  command parameter name
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID PRJOBID PRCMDNAME Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if {[string first "A:" [lindex $PRCMDNAME 0]] != 0} {set ok 0; break}
        set PRCMDNAME [lindex $PRCMDNAME 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CPNAME CPVAL}
            #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
            set CPNAME [lindex $CPNAME 1]
            #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
            set CPVAL [lindex $CPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F5R

S16F6Process Job Cmd Ack Sent by Equipment Only

    # S16F6 Tcl Parse reply
    set reply [secs_xact $spname S16F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 PRJOBID {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PRJOBID L2}
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F7[R]Process Job Alert Notify Sent by Equipment Only

    # S16F7 Tcl Receive message - add next line to setup
    $spname whenever S16F7 [list recv_S16F7 $spname]

# receive procedure 
proc recv_S16F7 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TIMESTAMP PRJOBID PRJOBMILESTONE {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # PRJOBID A:n (always)  process job identifier
        # PRJOBMILESTONE U1:1 (varies)  process job status 
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TIMESTAMP PRJOBID PRJOBMILESTONE L2}
        if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
        set TIMESTAMP [lindex $TIMESTAMP 1]
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        #vset [split [lindex $PRJOBMILESTONE 0] :] {typePRJOBMILESTONE lengthPRJOBMILESTONE}
        set PRJOBMILESTONE [lindex $PRJOBMILESTONE 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S16F7

S16F8Process Job Alert Ack Sent by Host Only

    # S16F8 Tcl Parse reply
    set reply [secs_xact $spname S16F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S16F9[R]Process Job Event Notify Sent by Equipment Only

    # S16F9 Tcl Receive message - add next line to setup
    $spname whenever S16F9 [list recv_S16F9 $spname]

# receive procedure 
proc recv_S16F9 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 PREVENTID TIMESTAMP PRJOBID {L:n {L:2 VID V}}
        # PREVENTID U1:1 (varies)  process job event ID
        # TIMESTAMP A:32 (always)  ECV TimeFormat controls format, 0=A:12 YYMMDDHHMMSS, 1=A:16 YYYYMMDDHHMMSScc,2=YYYY-MM-DDTHH:MM:SS.s[s]*{Z|+hh:mm|-hh:mm}
        # PRJOBID A:n (always)  process job identifier
        # VID A:n (varies)  A variable ID
        # V A:n (varies)  variable value, any type including list
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PREVENTID TIMESTAMP PRJOBID Ln}
        #vset [split [lindex $PREVENTID 0] :] {typePREVENTID lengthPREVENTID}
        set PREVENTID [lindex $PREVENTID 1]
        if {[string first "A:" [lindex $TIMESTAMP 0]] != 0} {set ok 0; break}
        set TIMESTAMP [lindex $TIMESTAMP 1]
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {VID V}
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            #vset [split [lindex $V 0] :] {typeV lengthV}
            set V [lindex $V 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S16F9

S16F10Process Job Event Ack Sent by Host Only

    # S16F10 Tcl Parse reply
    set reply [secs_xact $spname S16F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S16F11RPRJobCreateEnh Sent by Host Only

    # S16F11R Tcl Receive message - add next line to setup
    $spname whenever S16F11 [list recv_S16F11R $spname]

# receive procedure 
proc recv_S16F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:7 DATAID PRJOBID MF {L:n {L:2 CARRIERID {L:j SLOTID}}} {L:3 PRRECIPEMETHOD RCPSPEC {L:m {L:2 RCPPARNM RCPPARVAL}}} PRPROCESSSTART {L:p PRPAUSEEVENTID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # PRJOBID A:n (always)  process job identifier
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # CARRIERID A:n (always)  carrier ID
        # SLOTID U1:1 (always)  slot position within a carrier
        # PRRECIPEMETHOD U1:1 (always)  recipe type
        # RCPSPEC A:n (always)  recipe specifier
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        # PRPROCESSSTART TF:1 (always)  automatic start flag, false implies manual start
        # PRPAUSEEVENTID U4:1 (varies)  an event identifier for which a process job should be paused
        if { [lindex $TSN_data 0] != "L:7" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID PRJOBID MF Ln L3_n1 PRPROCESSSTART Lp_n2}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        #vset [split [lindex $MF 0] :] {typeMF lengthMF}
        set MF [lindex $MF 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {CARRIERID Lj_2}
            if {[string first "A:" [lindex $CARRIERID 0]] != 0} {set ok 0; break}
            set CARRIERID [lindex $CARRIERID 1]
            if {[string first L: [lindex $Lj_2 0]] != 0} {set ok 0; break}
            foreach SLOTID [lreplace $Lj_2 0 0] {
                if {[lindex $SLOTID 0] != "U1:1"} {set ok 0; break}
                set SLOTID [lindex $SLOTID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if { [lindex $L3_n1 0] != "L:3" } {set ok 0; break}
        vset [lreplace $L3_n1 0 0] {PRRECIPEMETHOD RCPSPEC Lm_1}
        if {[lindex $PRRECIPEMETHOD 0] != "U1:1"} {set ok 0; break}
        set PRRECIPEMETHOD [lindex $PRRECIPEMETHOD 1]
        if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
        set RCPSPEC [lindex $RCPSPEC 1]
        if {[string first L: [lindex $Lm_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Lm_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {RCPPARNM RCPPARVAL}
            if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
            set RCPPARNM [lindex $RCPPARNM 1]
            #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
            set RCPPARVAL [lindex $RCPPARVAL 1]
            }
        if {!$ok} break
        if {[lindex $PRPROCESSSTART 0] != "TF:1"} {set ok 0; break}
        set PRPROCESSSTART [lindex $PRPROCESSSTART 1]
        if {[string first L: [lindex $Lp_n2 0]] != 0} {set ok 0; break}
        foreach PRPAUSEEVENTID [lreplace $Lp_n2 0 0] {
            #vset [split [lindex $PRPAUSEEVENTID 0] :] {typePRPAUSEEVENTID lengthPRPAUSEEVENTID}
            set PRPAUSEEVENTID [lindex $PRPAUSEEVENTID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F11R

S16F12PRJobCreateEnh Ack Sent by Equipment Only

    # S16F12 Tcl Parse reply
    set reply [secs_xact $spname S16F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 PRJOBID {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PRJOBID L2}
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F15RPRJobMultiCreate Sent by Host Only

    # S16F15R Tcl Receive message - add next line to setup
    $spname whenever S16F15 [list recv_S16F15R $spname]

# receive procedure 
proc recv_S16F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 DATAID {L:p {L:6 PRJOBID MF {L:n {L:2 CARRIERID {L:j SLOTID}}} {L:3 PRRECIPEMETHOD RCPSPEC {L:m {L:2 RCPPARNM RCPPARVAL}}} PRPROCESSSTART {L:k PRPAUSEEVENTID}}}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # PRJOBID A:n (always)  process job identifier
        # MF B:1 (varies)  material format code, ASCII indicates generic units, E40 restricts to B:1
        # CARRIERID A:n (always)  carrier ID
        # SLOTID U1:1 (always)  slot position within a carrier
        # PRRECIPEMETHOD U1:1 (always)  recipe type
        # RCPSPEC A:n (always)  recipe specifier
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        # PRPROCESSSTART TF:1 (always)  automatic start flag, false implies manual start
        # PRPAUSEEVENTID U4:1 (varies)  an event identifier for which a process job should be paused
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID Lp}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first L: [lindex $Lp 0]] != 0} {set ok 0; break}
        foreach L6_1 [lreplace $Lp 0 0] {
            if { [lindex $L6_1 0] != "L:6" } {set ok 0; break}
            vset [lreplace $L6_1 0 0] {PRJOBID MF Ln_2 L3_2_n1 PRPROCESSSTART Lk_2_n2}
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            #vset [split [lindex $MF 0] :] {typeMF lengthMF}
            set MF [lindex $MF 1]
            if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Ln_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {CARRIERID Lj_4}
                if {[string first "A:" [lindex $CARRIERID 0]] != 0} {set ok 0; break}
                set CARRIERID [lindex $CARRIERID 1]
                if {[string first L: [lindex $Lj_4 0]] != 0} {set ok 0; break}
                foreach SLOTID [lreplace $Lj_4 0 0] {
                    if {[lindex $SLOTID 0] != "U1:1"} {set ok 0; break}
                    set SLOTID [lindex $SLOTID 1]
                    }
                if {!$ok} break
                }
            if {!$ok} break
            if { [lindex $L3_2_n1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_2_n1 0 0] {PRRECIPEMETHOD RCPSPEC Lm_3}
            if {[lindex $PRRECIPEMETHOD 0] != "U1:1"} {set ok 0; break}
            set PRRECIPEMETHOD [lindex $PRRECIPEMETHOD 1]
            if {[string first "A:" [lindex $RCPSPEC 0]] != 0} {set ok 0; break}
            set RCPSPEC [lindex $RCPSPEC 1]
            if {[string first L: [lindex $Lm_3 0]] != 0} {set ok 0; break}
            foreach L2_4 [lreplace $Lm_3 0 0] {
                if { [lindex $L2_4 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_4 0 0] {RCPPARNM RCPPARVAL}
                if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
                set RCPPARNM [lindex $RCPPARNM 1]
                #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
                set RCPPARVAL [lindex $RCPPARVAL 1]
                }
            if {!$ok} break
            if {[lindex $PRPROCESSSTART 0] != "TF:1"} {set ok 0; break}
            set PRPROCESSSTART [lindex $PRPROCESSSTART 1]
            if {[string first L: [lindex $Lk_2_n2 0]] != 0} {set ok 0; break}
            foreach PRPAUSEEVENTID [lreplace $Lk_2_n2 0 0] {
                #vset [split [lindex $PRPAUSEEVENTID 0] :] {typePRPAUSEEVENTID lengthPRPAUSEEVENTID}
                set PRPAUSEEVENTID [lindex $PRPAUSEEVENTID 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F15R

S16F16PRJobMultiCreate Ack Sent by Equipment Only

    # S16F16 Tcl Parse reply
    set reply [secs_xact $spname S16F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:m PRJOBID} {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm L2_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach PRJOBID [lreplace $Lm 0 0] {
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F17RPRJobDequeue Sent by Host Only

    # S16F17R Tcl Receive message - add next line to setup
    $spname whenever S16F17 [list recv_S16F17R $spname]

# receive procedure 
proc recv_S16F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:m PRJOBID
        # PRJOBID A:n (always)  process job identifier
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach PRJOBID [lreplace $TSN_data 0 0] {
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F17R

S16F18PRJobDequeue Ack Sent by Equipment Only

    # S16F18 Tcl Parse reply
    set reply [secs_xact $spname S16F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:m PRJOBID} {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm L2_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach PRJOBID [lreplace $Lm 0 0] {
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F19RPRJob List Req Sent by Host Only

    # S16F19R Tcl Receive message - add next line to setup
    $spname whenever S16F19 [list recv_S16F19R $spname]

# receive procedure 
proc recv_S16F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F19R

S16F20PRJob List Data Sent by Equipment Only

    # S16F20 Tcl Parse reply
    set reply [secs_xact $spname S16F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:m {L:2 PRJOBID PRSTATE}
        # PRJOBID A:n (always)  process job identifier
        # PRSTATE U1:1 (always)  process job state, E40 definition
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L2 [lreplace $TSN_data 0 0] {
            if { [lindex $L2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2 0 0] {PRJOBID PRSTATE}
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            if {[lindex $PRSTATE 0] != "U1:1"} {set ok 0; break}
            set PRSTATE [lindex $PRSTATE 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F21RPRJob Create Limit Req Sent by Host Only

    # S16F21R Tcl Receive message - add next line to setup
    $spname whenever S16F21 [list recv_S16F21R $spname]

# receive procedure 
proc recv_S16F21R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # no data expected
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F22 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F21R

S16F22PRJob Create Limit Data Sent by Equipment Only

    # S16F22 Tcl Parse reply
    set reply [secs_xact $spname S16F21R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect PRJOBSPACE
        # PRJOBSPACE U2:1 (always)  the number of process jobs that can be created
        if {[lindex $TSN_data 0] != "U2:1"} {set ok 0; break}
        set PRJOBSPACE [lindex $TSN_data 1]
        return ;# finished ok
        } ;# end while(ok)

S16F23RPRJob Recipe Variable Set Sent by Host Only

    # S16F23R Tcl Receive message - add next line to setup
    $spname whenever S16F23 [list recv_S16F23R $spname]

# receive procedure 
proc recv_S16F23R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 PRJOBID {L:m {L:2 RCPPARNM RCPPARVAL}}
        # PRJOBID A:n (always)  process job identifier
        # RCPPARNM A:256 (always)  the name of a recipe variable parameter
        # RCPPARVAL A:80 (varies)  the value of a recipe variable parameter, any scalar format type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {PRJOBID Lm}
        if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
        set PRJOBID [lindex $PRJOBID 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {RCPPARNM RCPPARVAL}
            if {[string first "A:" [lindex $RCPPARNM 0]] != 0} {set ok 0; break}
            set RCPPARNM [lindex $RCPPARNM 1]
            #vset [split [lindex $RCPPARVAL 0] :] {typeRCPPARVAL lengthRCPPARVAL}
            set RCPPARVAL [lindex $RCPPARVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F24 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F23R

S16F24PRJob Recipe Variable Ack Sent by Host Only

    # S16F24 Tcl Parse reply
    set reply [secs_xact $spname S16F23R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACKA Ln}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F25RPRJob Start Method Set Sent by Host Only

    # S16F25R Tcl Receive message - add next line to setup
    $spname whenever S16F25 [list recv_S16F25R $spname]

# receive procedure 
proc recv_S16F25R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 {L:m PRJOBID} PRPROCESSSTART
        # PRJOBID A:n (always)  process job identifier
        # PRPROCESSSTART TF:1 (always)  automatic start flag, false implies manual start
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm PRPROCESSSTART}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach PRJOBID [lreplace $Lm 0 0] {
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            }
        if {!$ok} break
        if {[lindex $PRPROCESSSTART 0] != "TF:1"} {set ok 0; break}
        set PRPROCESSSTART [lindex $PRPROCESSSTART 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F26 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F25R

S16F26PRJob Start Method Ack Sent by Equipment Only

    # S16F26 Tcl Parse reply
    set reply [secs_xact $spname S16F25R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:m PRJOBID} {L:2 ACKA {L:n {L:2 ERRCODE ERRTEXT}}}
        # PRJOBID A:n (always)  process job identifier
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm L2_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach PRJOBID [lreplace $Lm 0 0] {
            if {[string first "A:" [lindex $PRJOBID 0]] != 0} {set ok 0; break}
            set PRJOBID [lindex $PRJOBID 1]
            }
        if {!$ok} break
        if { [lindex $L2_n1 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2_n1 0 0] {ACKA Ln_1}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Ln_1 0]] != 0} {set ok 0; break}
        foreach L2_2 [lreplace $Ln_1 0 0] {
            if { [lindex $L2_2 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_2 0 0] {ERRCODE ERRTEXT}
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S16F27RControl Job Command Sent by Host Only

    # S16F27R Tcl Receive message - add next line to setup
    $spname whenever S16F27 [list recv_S16F27R $spname]

# receive procedure 
proc recv_S16F27R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 CTLJOBID CTLJOBCMD {L:2 CPNAME CPVAL}
        # CTLJOBID A:n (always)  control job ID, an OBJID
        # CTLJOBCMD U1:1 (always)  control job command
        # CPNAME A:n (varies)  command parameter name
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {CTLJOBID CTLJOBCMD L2}
        if {[string first "A:" [lindex $CTLJOBID 0]] != 0} {set ok 0; break}
        set CTLJOBID [lindex $CTLJOBID 1]
        if {[lindex $CTLJOBCMD 0] != "U1:1"} {set ok 0; break}
        set CTLJOBCMD [lindex $CTLJOBCMD 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {CPNAME CPVAL}
        #vset [split [lindex $CPNAME 0] :] {typeCPNAME lengthCPNAME}
        set CPNAME [lindex $CPNAME 1]
        #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
        set CPVAL [lindex $CPVAL 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F28 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F27R

S16F28Control Job Command Ack Sent by Equipment Only

    # S16F28 Tcl Parse reply
    set reply [secs_xact $spname S16F27R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 ACKA {L:2 ERRCODE ERRTEXT}
        # ACKA TF:1 (always)  request success
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACKA L2}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if { [lindex $L2 0] != "L:2" } {set ok 0; break}
        vset [lreplace $L2 0 0] {ERRCODE ERRTEXT}
        #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
        set ERRCODE [lindex $ERRCODE 1]
        if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
        set ERRTEXT [lindex $ERRTEXT 1]
        return ;# finished ok
        } ;# end while(ok)

S16F29PRSetMtrlOrder Sent by Host Only

    # S16F29 Tcl Receive message - add next line to setup
    $spname whenever S16F29 [list recv_S16F29 $spname]

# receive procedure 
proc recv_S16F29 {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect PRMTRLORDER
        # PRMTRLORDER U1:1 (always)  ordering method for pending process jobs
        if {[lindex $TSN_data 0] != "U1:1"} {set ok 0; break}
        set PRMTRLORDER [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S16F30 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S16F29

S16F30PRSetMtrlOrder Ack Sent by Equipment Only

    # S16F30 Tcl Parse reply
    set reply [secs_xact $spname S16F29R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect ACKA
        # ACKA TF:1 (always)  request success
        if {[lindex $TSN_data 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $TSN_data 1]
        return ;# finished ok
        } ;# end while(ok)

S17F1RData Report Create Req Sent by Host Only

    # S17F1R Tcl Receive message - add next line to setup
    $spname whenever S17F1 [list recv_S17F1R $spname]

# receive procedure 
proc recv_S17F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID RPTID DATASRC {L:n VID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # RPTID U4:1 (varies)  report ID
        # DATASRC A:n (always)  identifies a data source, use length 0 to mean the default
        # VID A:n (varies)  A variable ID
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID RPTID DATASRC Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $RPTID 1]
        if {[string first "A:" [lindex $DATASRC 0]] != 0} {set ok 0; break}
        set DATASRC [lindex $DATASRC 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach VID [lreplace $Ln 0 0] {
            #vset [split [lindex $VID 0] :] {typeVID lengthVID}
            set VID [lindex $VID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F1R

S17F2Data Report Create Ack Sent by Equipment Only

    # S17F2 Tcl Parse reply
    set reply [secs_xact $spname S17F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 RPTID ERRCODE
        # RPTID U4:1 (varies)  report ID
        # ERRCODE U4:1 (varies)  error code
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {RPTID ERRCODE}
        #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $RPTID 1]
        #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
        set ERRCODE [lindex $ERRCODE 1]
        return ;# finished ok
        } ;# end while(ok)

S17F3RData Report Delete Req Sent by Host Only

    # S17F3R Tcl Receive message - add next line to setup
    $spname whenever S17F3 [list recv_S17F3R $spname]

# receive procedure 
proc recv_S17F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n RPTID
        # RPTID U4:1 (varies)  report ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach RPTID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F3R

S17F4Data Report Del Ack Sent by Equipment Only

    # S17F4 Tcl Parse reply
    set reply [secs_xact $spname S17F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 ACKA {L:m {L:3 RPTID ERRCODE ERRTEXT}}
        # ACKA TF:1 (always)  request success
        # RPTID U4:1 (varies)  report ID
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACKA Lm}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {RPTID ERRCODE ERRTEXT}
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S17F5RTrace Create Req Sent by Host Only

    # S17F5R Tcl Receive message - add next line to setup
    $spname whenever S17F5 [list recv_S17F5R $spname]

# receive procedure 
proc recv_S17F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:6 DATAID TRID CEED {L:n RPTID} {L:8* TOTSMP REPGSZ EVNTSRC CEIDSTART EVNTSRC2 CEIDSTOP TRAUTOD RPTOC}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # TRID A:n (varies)  trace request ID
        # CEED TF:1 (always)  collection event or trace enablement, true is enabled
        # RPTID U4:1 (varies)  report ID
        # TOTSMP U4:1 (varies)  total samples to be made, should be an even multiple of REPGSZ
        # REPGSZ U4:1 (varies)  reporting group size, TOTSMP modulo REPGSZ should be 0
        # EVNTSRC A:n (always)  identifies an event source, use length 0 to specify the default
        # CEIDSTART U4:1 (varies)  the CEID of a start event
        # EVNTSRC2 A:n (always)  a second event source EVNTSRC
        # CEIDSTOP U4:1 (varies)  the CEID of a stop event
        # TRAUTOD TF:1 (always)  delete upon completion flag
        # RPTOC TF:1 (always)  send only changed data trace report flag
        if { [lindex $TSN_data 0] != "L:6" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID TRID CEED Ln L8opt_n1}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        if {[lindex $CEED 0] != "TF:1"} {set ok 0; break}
        set CEED [lindex $CEED 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RPTID [lreplace $Ln 0 0] {
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            }
        if {!$ok} break
        if { [lindex $L8opt_n1 0] == "L:8" } {  ;# 8 optional items found
            vset [lreplace $L8opt_n1 0 0] {TOTSMP REPGSZ EVNTSRC CEIDSTART EVNTSRC2 CEIDSTOP TRAUTOD RPTOC}
            #vset [split [lindex $TOTSMP 0] :] {typeTOTSMP lengthTOTSMP}
            set TOTSMP [lindex $TOTSMP 1]
            #vset [split [lindex $REPGSZ 0] :] {typeREPGSZ lengthREPGSZ}
            set REPGSZ [lindex $REPGSZ 1]
            if {[string first "A:" [lindex $EVNTSRC 0]] != 0} {set ok 0; break}
            set EVNTSRC [lindex $EVNTSRC 1]
            #vset [split [lindex $CEIDSTART 0] :] {typeCEIDSTART lengthCEIDSTART}
            set CEIDSTART [lindex $CEIDSTART 1]
            if {[string first "A:" [lindex $EVNTSRC2 0]] != 0} {set ok 0; break}
            set EVNTSRC2 [lindex $EVNTSRC2 1]
            #vset [split [lindex $CEIDSTOP 0] :] {typeCEIDSTOP lengthCEIDSTOP}
            set CEIDSTOP [lindex $CEIDSTOP 1]
            if {[lindex $TRAUTOD 0] != "TF:1"} {set ok 0; break}
            set TRAUTOD [lindex $TRAUTOD 1]
            if {[lindex $RPTOC 0] != "TF:1"} {set ok 0; break}
            set RPTOC [lindex $RPTOC 1]
            }
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F5R

S17F6Trace Create Ack Sent by Equipment Only

    # S17F6 Tcl Parse reply
    set reply [secs_xact $spname S17F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TRID ERRCODE
        # TRID A:n (varies)  trace request ID
        # ERRCODE U4:1 (varies)  error code
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TRID ERRCODE}
        #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
        set TRID [lindex $TRID 1]
        #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
        set ERRCODE [lindex $ERRCODE 1]
        return ;# finished ok
        } ;# end while(ok)

S17F7RTrace Delete Req Sent by Host Only

    # S17F7R Tcl Receive message - add next line to setup
    $spname whenever S17F7 [list recv_S17F7R $spname]

# receive procedure 
proc recv_S17F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n TRID
        # TRID A:n (varies)  trace request ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach TRID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
            set TRID [lindex $TRID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F7R

S17F8Trace Delete Ack Sent by Equipment Only

    # S17F8 Tcl Parse reply
    set reply [secs_xact $spname S17F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 ACKA {L:m {L:3 TRID ERRCODE ERRTEXT}}
        # ACKA TF:1 (always)  request success
        # TRID A:n (varies)  trace request ID
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACKA Lm}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {TRID ERRCODE ERRTEXT}
            #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
            set TRID [lindex $TRID 1]
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S17F9RCollection Event Link Req Sent by Host Only

    # S17F9R Tcl Receive message - add next line to setup
    $spname whenever S17F9 [list recv_S17F9R $spname]

# receive procedure 
proc recv_S17F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 DATAID EVNTSRC CEID {L:n RPTID}
        # DATAID U4:1 (varies)  an identifier to correlate related messages
        # EVNTSRC A:n (always)  identifies an event source, use length 0 to specify the default
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DATAID EVNTSRC CEID Ln}
        #vset [split [lindex $DATAID 0] :] {typeDATAID lengthDATAID}
        set DATAID [lindex $DATAID 1]
        if {[string first "A:" [lindex $EVNTSRC 0]] != 0} {set ok 0; break}
        set EVNTSRC [lindex $EVNTSRC 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach RPTID [lreplace $Ln 0 0] {
            #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
            set RPTID [lindex $RPTID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F9R

S17F10Collection Event Link Ack Sent by Equipment Only

    # S17F10 Tcl Parse reply
    set reply [secs_xact $spname S17F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 EVNTSRC CEID ERRCODE
        # EVNTSRC A:n (always)  identifies an event source, use length 0 to specify the default
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # ERRCODE U4:1 (varies)  error code
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EVNTSRC CEID ERRCODE}
        if {[string first "A:" [lindex $EVNTSRC 0]] != 0} {set ok 0; break}
        set EVNTSRC [lindex $EVNTSRC 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
        set ERRCODE [lindex $ERRCODE 1]
        return ;# finished ok
        } ;# end while(ok)

S17F11RCollection Event Unlink Sent by Host Only

    # S17F11R Tcl Receive message - add next line to setup
    $spname whenever S17F11 [list recv_S17F11R $spname]

# receive procedure 
proc recv_S17F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 EVNTSRC CEID RPTID
        # EVNTSRC A:n (always)  identifies an event source, use length 0 to specify the default
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EVNTSRC CEID RPTID}
        if {[string first "A:" [lindex $EVNTSRC 0]] != 0} {set ok 0; break}
        set EVNTSRC [lindex $EVNTSRC 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $RPTID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F11R

S17F12Collection Event Unlink Ack Sent by Equipment Only

    # S17F12 Tcl Parse reply
    set reply [secs_xact $spname S17F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 EVNTSRC CEID RPTID ERRCODE
        # EVNTSRC A:n (always)  identifies an event source, use length 0 to specify the default
        # CEID U4:1 (varies)  collection event identifier, GEM requires type Un
        # RPTID U4:1 (varies)  report ID
        # ERRCODE U4:1 (varies)  error code
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {EVNTSRC CEID RPTID ERRCODE}
        if {[string first "A:" [lindex $EVNTSRC 0]] != 0} {set ok 0; break}
        set EVNTSRC [lindex $EVNTSRC 1]
        #vset [split [lindex $CEID 0] :] {typeCEID lengthCEID}
        set CEID [lindex $CEID 1]
        #vset [split [lindex $RPTID 0] :] {typeRPTID lengthRPTID}
        set RPTID [lindex $RPTID 1]
        #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
        set ERRCODE [lindex $ERRCODE 1]
        return ;# finished ok
        } ;# end while(ok)

S17F13RTrace Reset Req Sent by Host Only

    # S17F13R Tcl Receive message - add next line to setup
    $spname whenever S17F13 [list recv_S17F13R $spname]

# receive procedure 
proc recv_S17F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n TRID
        # TRID A:n (varies)  trace request ID
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach TRID [lreplace $TSN_data 0 0] {
            #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
            set TRID [lindex $TRID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S17F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S17F13R

S17F14Trace Reset Ack Sent by Equipment Only

    # S17F14 Tcl Parse reply
    set reply [secs_xact $spname S17F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 ACKA {L:m {L:3 TRID ERRCODE ERRTEXT}}
        # ACKA TF:1 (always)  request success
        # TRID A:n (varies)  trace request ID
        # ERRCODE U4:1 (varies)  error code
        # ERRTEXT A:80 (always)  description of ERRCODE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {ACKA Lm}
        if {[lindex $ACKA 0] != "TF:1"} {set ok 0; break}
        set ACKA [lindex $ACKA 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {TRID ERRCODE ERRTEXT}
            #vset [split [lindex $TRID 0] :] {typeTRID lengthTRID}
            set TRID [lindex $TRID 1]
            #vset [split [lindex $ERRCODE 0] :] {typeERRCODE lengthERRCODE}
            set ERRCODE [lindex $ERRCODE 1]
            if {[string first "A:" [lindex $ERRTEXT 0]] != 0} {set ok 0; break}
            set ERRTEXT [lindex $ERRTEXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S18F1RRead Attribute Req Sent by Host Only

    # S18F1R Tcl Receive message - add next line to setup
    $spname whenever S18F1 [list recv_S18F1R $spname]

# receive procedure 
proc recv_S18F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TARGETID {L:n ATTRID}
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID Ln}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach ATTRID [lreplace $Ln 0 0] {
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F1R

S18F2Read Attribute Data Sent by Equipment Only

    # S18F2 Tcl Parse reply
    set reply [secs_xact $spname S18F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TARGETID SSACK {L:n ATTRDATA}
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK Ln}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach ATTRDATA [lreplace $Ln 0 0] {
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S18F3RWrite Attribute Req Sent by Host Only

    # S18F3R Tcl Receive message - add next line to setup
    $spname whenever S18F3 [list recv_S18F3R $spname]

# receive procedure 
proc recv_S18F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TARGETID {L:n {L:2 ATTRID ATTRDATA}}
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # ATTRID A:40 (varies)  identifies an attribute type, chars 0x20-0x7e but not >, :, ?, *, or ~.  Does not begin or end with space.
        # ATTRDATA A:n (varies)  a specific attribute value of any data type
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID Ln}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {ATTRID ATTRDATA}
            #vset [split [lindex $ATTRID 0] :] {typeATTRID lengthATTRID}
            set ATTRID [lindex $ATTRID 1]
            #vset [split [lindex $ATTRDATA 0] :] {typeATTRDATA lengthATTRDATA}
            set ATTRDATA [lindex $ATTRDATA 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F3R

S18F4Write Attribute Ack Sent by Equipment Only

    # S18F4 Tcl Parse reply
    set reply [secs_xact $spname S18F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TARGETID SSACK STATUSLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK STATUSLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S18F5RRead Request Sent by Host Only

    # S18F5R Tcl Receive message - add next line to setup
    $spname whenever S18F5 [list recv_S18F5R $spname]

# receive procedure 
proc recv_S18F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 TARGETID DATASEG DATALENGTH
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # DATASEG A:n (varies)  identifies data requested, E87 requires text
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID DATASEG DATALENGTH}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        #vset [split [lindex $DATASEG 0] :] {typeDATASEG lengthDATASEG}
        set DATASEG [lindex $DATASEG 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F5R

S18F6Read Data Sent by Equipment Only

    # S18F6 Tcl Parse reply
    set reply [secs_xact $spname S18F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 TARGETID SSACK DATA {L:s STATUS}
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # DATA A:n (varies)  unformatted data
        # STATUS A:n (always)  subsystem status data
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK DATA Ls}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        #vset [split [lindex $DATA 0] :] {typeDATA lengthDATA}
        set DATA [lindex $DATA 1]
        if {[string first L: [lindex $Ls 0]] != 0} {set ok 0; break}
        foreach STATUS [lreplace $Ls 0 0] {
            if {[string first "A:" [lindex $STATUS 0]] != 0} {set ok 0; break}
            set STATUS [lindex $STATUS 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S18F7RWrite Data Request Sent by Host Only

    # S18F7R Tcl Receive message - add next line to setup
    $spname whenever S18F7 [list recv_S18F7R $spname]

# receive procedure 
proc recv_S18F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TARGETID DATASEG DATALENGTH DATA
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # DATASEG A:n (varies)  identifies data requested, E87 requires text
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        # DATA A:n (varies)  unformatted data
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID DATASEG DATALENGTH DATA}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        #vset [split [lindex $DATASEG 0] :] {typeDATASEG lengthDATASEG}
        set DATASEG [lindex $DATASEG 1]
        #vset [split [lindex $DATALENGTH 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $DATALENGTH 1]
        #vset [split [lindex $DATA 0] :] {typeDATA lengthDATA}
        set DATA [lindex $DATA 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F7R

S18F8Write Data Ack Sent by Equipment Only

    # S18F8 Tcl Parse reply
    set reply [secs_xact $spname S18F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TARGETID SSACK STATUSLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK STATUSLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S18F9RRead ID Req Sent by Host Only

    # S18F9R Tcl Receive message - add next line to setup
    $spname whenever S18F9 [list recv_S18F9R $spname]

# receive procedure 
proc recv_S18F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TARGETID
        # TARGETID A:n (always)  the OBJSPEC for the target object
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F9R

S18F10Read ID Data Sent by Equipment Only

    # S18F10 Tcl Parse reply
    set reply [secs_xact $spname S18F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:4 TARGETID SSACK MID STATUSLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK MID STATUSLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S18F11RWrite ID Req Sent by Host Only

    # S18F11R Tcl Receive message - add next line to setup
    $spname whenever S18F11 [list recv_S18F11R $spname]

# receive procedure 
proc recv_S18F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TARGETID MID
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID MID}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F11R

S18F12Write ID Ack Sent by Equipment Only

    # S18F12 Tcl Parse reply
    set reply [secs_xact $spname S18F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TARGETID SSACK STATUSLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK STATUSLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S18F13RSubsystem Command Sent by Host Only

    # S18F13R Tcl Receive message - add next line to setup
    $spname whenever S18F13 [list recv_S18F13R $spname]

# receive procedure 
proc recv_S18F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:3 TARGETID SSCMD {L:n CPVAL}
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSCMD A:n (always)  subsystem action command
        # CPVAL A:n (varies)  command parameter value, any scalar type
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSCMD Ln}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSCMD 0]] != 0} {set ok 0; break}
        set SSCMD [lindex $SSCMD 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach CPVAL [lreplace $Ln 0 0] {
            #vset [split [lindex $CPVAL 0] :] {typeCPVAL lengthCPVAL}
            set CPVAL [lindex $CPVAL 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F13R

S18F14Subsystem Command Ack Sent by Equipment Only

    # S18F14 Tcl Parse reply
    set reply [secs_xact $spname S18F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TARGETID SSACK STATUSLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK STATUSLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S18F15RRead 2D Code Cond Req Sent by Host Only

    # S18F15R Tcl Receive message - add next line to setup
    $spname whenever S18F15 [list recv_S18F15R $spname]

# receive procedure 
proc recv_S18F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TARGETID
        # TARGETID A:n (always)  the OBJSPEC for the target object
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S18F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S18F15R

S18F16Read 2D Code Cond Data Sent by Equipment Only

    # S18F16 Tcl Parse reply
    set reply [secs_xact $spname S18F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:5 TARGETID SSACK MID STATUSLIST CONDITIONLIST
        # TARGETID A:n (always)  the OBJSPEC for the target object
        # SSACK A:2 (always)  two character codes for success or failure
        # MID A:16 (varies)  material ID, E40 restricts to A:n
        # STATUSLIST (list)L (always)  subsystem status data strings in a fixed order
        # CONDITIONLIST (list)L (always)  a list of Ascii values sent in a fixed order, each string provides condition info for a component
        if { [lindex $TSN_data 0] != "L:5" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETID SSACK MID STATUSLIST CONDITIONLIST}
        if {[string first "A:" [lindex $TARGETID 0]] != 0} {set ok 0; break}
        set TARGETID [lindex $TARGETID 1]
        if {[string first "A:" [lindex $SSACK 0]] != 0} {set ok 0; break}
        set SSACK [lindex $SSACK 1]
        #vset [split [lindex $MID 0] :] {typeMID lengthMID}
        set MID [lindex $MID 1]
        if {[string first ":" [lindex $STATUSLIST 0]] != 0} {set ok 0; break}
        set STATUSLIST [lreplace $STATUSLIST 0 0]
        if {[string first ":" [lindex $CONDITIONLIST 0]] != 0} {set ok 0; break}
        set CONDITIONLIST [lreplace $CONDITIONLIST 0 0]
        return ;# finished ok
        } ;# end while(ok)

S19F1RRequest Process Definition Element (PDE) Directory Sent by Host and Equipment

    # S19F1R Tcl Receive message - add next line to setup
    $spname whenever S19F1 [list recv_S19F1R $spname]

# receive procedure 
proc recv_S19F1R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 {L:m {L:3 PDEATTRIBUTENAME COMPARISONOPERATOR PDEATTRIBUTEVALUE}} {L:n PDEATTRIBUTE}
        # PDEATTRIBUTENAME U1:1 (always)  identifies a PDE attribute type
        # COMPARISONOPERATOR U1:1 (always)  choice of comparison operators.  Interpreted as "target <op> <const>" where <op> is this value and <const> is supplied in the expression
        # PDEATTRIBUTEVALUE A (varies)  contains the value of a PDE Attribute, may be type L, A, TF, U1
        # PDEATTRIBUTE U1:1 (always)  a reportable PDE attribute type, not necessarily useable in a filter expression
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm Ln_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Lm 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {PDEATTRIBUTENAME COMPARISONOPERATOR PDEATTRIBUTEVALUE}
            if {[lindex $PDEATTRIBUTENAME 0] != "U1:1"} {set ok 0; break}
            set PDEATTRIBUTENAME [lindex $PDEATTRIBUTENAME 1]
            if {[lindex $COMPARISONOPERATOR 0] != "U1:1"} {set ok 0; break}
            set COMPARISONOPERATOR [lindex $COMPARISONOPERATOR 1]
            #vset [split [lindex $PDEATTRIBUTEVALUE 0] :] {typePDEATTRIBUTEVALUE lengthPDEATTRIBUTEVALUE}
            set PDEATTRIBUTEVALUE [lindex $PDEATTRIBUTEVALUE 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Ln_n1 0]] != 0} {set ok 0; break}
        foreach PDEATTRIBUTE [lreplace $Ln_n1 0 0] {
            if {[lindex $PDEATTRIBUTE 0] != "U1:1"} {set ok 0; break}
            set PDEATTRIBUTE [lindex $PDEATTRIBUTE 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F2 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F1R

S19F2PDE Directory Data Sent by Host and Equipment

    # S19F2 Tcl Parse reply
    set reply [secs_xact $spname S19F1R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 DIRRSPSTAT STATUSTXT {L:m {L:2 UID {L:n {L:2 PDEATTRIBUTE PDEATTRIBUTEVALUE}}}}
        # DIRRSPSTAT U1:1 (always)  get dir status response
        # STATUSTXT A:80 (always)  status response description
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # PDEATTRIBUTE U1:1 (always)  a reportable PDE attribute type, not necessarily useable in a filter expression
        # PDEATTRIBUTEVALUE A (varies)  contains the value of a PDE Attribute, may be type L, A, TF, U1
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {DIRRSPSTAT STATUSTXT Lm}
        if {[lindex $DIRRSPSTAT 0] != "U1:1"} {set ok 0; break}
        set DIRRSPSTAT [lindex $DIRRSPSTAT 1]
        if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
        set STATUSTXT [lindex $STATUSTXT 1]
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {UID Ln_2}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[string first L: [lindex $Ln_2 0]] != 0} {set ok 0; break}
            foreach L2_3 [lreplace $Ln_2 0 0] {
                if { [lindex $L2_3 0] != "L:2" } {set ok 0; break}
                vset [lreplace $L2_3 0 0] {PDEATTRIBUTE PDEATTRIBUTEVALUE}
                if {[lindex $PDEATTRIBUTE 0] != "U1:1"} {set ok 0; break}
                set PDEATTRIBUTE [lindex $PDEATTRIBUTE 1]
                #vset [split [lindex $PDEATTRIBUTEVALUE 0] :] {typePDEATTRIBUTEVALUE lengthPDEATTRIBUTEVALUE}
                set PDEATTRIBUTEVALUE [lindex $PDEATTRIBUTEVALUE 1]
                }
            if {!$ok} break
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F3RPDE Delete Request Sent by Host Only

    # S19F3R Tcl Receive message - add next line to setup
    $spname whenever S19F3 [list recv_S19F3R $spname]

# receive procedure 
proc recv_S19F3R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n UID
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach UID [lreplace $TSN_data 0 0] {
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F4 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S19F3R

S19F4PDE Delete Acknowledge Sent by Equipment Only

    # S19F4 Tcl Parse reply
    set reply [secs_xact $spname S19F3R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:n {L:3 UID DELRSPSTAT STATUSTXT}
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # DELRSPSTAT U1:1 (always)  Response code for the PDE deletion request, non-zero means not deleted
        # STATUSTXT A:80 (always)  status response description
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L3 [lreplace $TSN_data 0 0] {
            if { [lindex $L3 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3 0 0] {UID DELRSPSTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $DELRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set DELRSPSTAT [lindex $DELRSPSTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F5RPDE Header Data Request Sent by Host and Equipment

    # S19F5R Tcl Receive message - add next line to setup
    $spname whenever S19F5 [list recv_S19F5R $spname]

# receive procedure 
proc recv_S19F5R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n UID
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach UID [lreplace $TSN_data 0 0] {
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F6 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F5R

S19F6PDE Header Data Reply Sent by Host and Equipment

    # S19F6 Tcl Parse reply
    set reply [secs_xact $spname S19F5R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TCID {L:n {L:3 UID GETRSPSTAT STATUSTXT}}
        # TCID A:36 (always)  The identity of a transfer container specified as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # GETRSPSTAT U1:1 (always)  Response code for PDE queries, non-zero indicates failure
        # STATUSTXT A:80 (always)  status response description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TCID Ln}
        if {[string first "A:" [lindex $TCID 0]] != 0} {set ok 0; break}
        set TCID [lindex $TCID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {UID GETRSPSTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $GETRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set GETRSPSTAT [lindex $GETRSPSTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F7Rrequest the transfer of PDEs via Stream 13 Sent by Host and Equipment

    # S19F7R Tcl Receive message - add next line to setup
    $spname whenever S19F7 [list recv_S19F7R $spname]

# receive procedure 
proc recv_S19F7R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n UID
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach UID [lreplace $TSN_data 0 0] {
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F8 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F7R

S19F8PDE Transfer Reply Sent by Host and Equipment

    # S19F8 Tcl Parse reply
    set reply [secs_xact $spname S19F7R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 TCID {L:n {L:3 UID GETRSPSTAT STATUSTXT}}
        # TCID A:36 (always)  The identity of a transfer container specified as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # GETRSPSTAT U1:1 (always)  Response code for PDE queries, non-zero indicates failure
        # STATUSTXT A:80 (always)  status response description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TCID Ln}
        if {[string first "A:" [lindex $TCID 0]] != 0} {set ok 0; break}
        set TCID [lindex $TCID 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {UID GETRSPSTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $GETRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set GETRSPSTAT [lindex $GETRSPSTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F9RRequest to Send PDE Sent by Host and Equipment

    # S19F9R Tcl Receive message - add next line to setup
    $spname whenever S19F9 [list recv_S19F9R $spname]

# receive procedure 
proc recv_S19F9R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TCID TRANSFERSIZE
        # TCID A:36 (always)  The identity of a transfer container specified as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens
        # TRANSFERSIZE U8:1 (always)  SIze in bytes of the TransferContainer.   An 8 byte value but HSMS uses 4 byte message lengths!!!
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TCID TRANSFERSIZE}
        if {[string first "A:" [lindex $TCID 0]] != 0} {set ok 0; break}
        set TCID [lindex $TCID 1]
        if {[lindex $TRANSFERSIZE 0] != "U8:1"} {set ok 0; break}
        set TRANSFERSIZE [lindex $TRANSFERSIZE 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F10 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F9R

S19F10Initiate PDE transfer Reply Sent by Host and Equipment

    # S19F10 Tcl Parse reply
    set reply [secs_xact $spname S19F9R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:3 TCID RTSRSPSTAT STATUSTXT
        # TCID A:36 (always)  The identity of a transfer container specified as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens
        # RTSRSPSTAT U1:1 (always)  PDE transfer request reply code, non-zero means denied
        # STATUSTXT A:80 (always)  status response description
        if { [lindex $TSN_data 0] != "L:3" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TCID RTSRSPSTAT STATUSTXT}
        if {[string first "A:" [lindex $TCID 0]] != 0} {set ok 0; break}
        set TCID [lindex $TCID 1]
        if {[lindex $RTSRSPSTAT 0] != "U1:1"} {set ok 0; break}
        set RTSRSPSTAT [lindex $RTSRSPSTAT 1]
        if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
        set STATUSTXT [lindex $STATUSTXT 1]
        return ;# finished ok
        } ;# end while(ok)

S19F11RSend PDE Sent by Host and Equipment

    # S19F11R Tcl Receive message - add next line to setup
    $spname whenever S19F11 [list recv_S19F11R $spname]

# receive procedure 
proc recv_S19F11R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect TCID
        # TCID A:36 (always)  The identity of a transfer container specified as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens
        if {[string first "A:" [lindex $TSN_data 0]] != 0} {set ok 0; break}
        set TCID [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F12 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F11R

S19F12Send PDE Acknowledge Sent by Host and Equipment

    # S19F12 Tcl Parse reply
    set reply [secs_xact $spname S19F11R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S19F13RTransferContainer Report Sent by Host and Equipment

    # S19F13R Tcl Receive message - add next line to setup
    $spname whenever S19F13 [list recv_S19F13R $spname]

# receive procedure 
proc recv_S19F13R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:n {L:4 UID SENDRSPSTAT VERIFYRSPSTAT STATUSTXT}
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # SENDRSPSTAT U1:1 (always)  Return codes for the Send PDE request, non-zero means failure
        # VERIFYRSPSTAT U1:1 (always)  PDE verification result, 0 success, 10 none, other error
        # STATUSTXT A:80 (always)  status response description
        if {[string first L: [lindex $TSN_data 0]] != 0} {set ok 0; break}
        foreach L4 [lreplace $TSN_data 0 0] {
            if { [lindex $L4 0] != "L:4" } {set ok 0; break}
            vset [lreplace $L4 0 0] {UID SENDRSPSTAT VERIFYRSPSTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $SENDRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set SENDRSPSTAT [lindex $SENDRSPSTAT 1]
            if {[lindex $VERIFYRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set VERIFYRSPSTAT [lindex $VERIFYRSPSTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F14 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F13R

S19F14TransferContainer Report Ack Sent by Host and Equipment

    # S19F14 Tcl Parse reply
    set reply [secs_xact $spname S19F13R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # no data expected
        return ;# finished ok
        } ;# end while(ok)

S19F15RRequest PDE Resolution Sent by Host Only

    # S19F15R Tcl Receive message - add next line to setup
    $spname whenever S19F15 [list recv_S19F15R $spname]

# receive procedure 
proc recv_S19F15R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:2 TARGETPDE {L:n {L:2 PDEREF RESOLUTION}}
        # TARGETPDE A:36 (always)  the UID of the target PDE, a 36 character string with runs of 8,4,4,4, and 12 characters joined by hyphens.
        # PDEREF A:36 (always)  The UID of a PDE or of a PDE group formatted as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens.
        # RESOLUTION A:36 (always)  the UID of a PDE
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETPDE Ln}
        if {[string first "A:" [lindex $TARGETPDE 0]] != 0} {set ok 0; break}
        set TARGETPDE [lindex $TARGETPDE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {PDEREF RESOLUTION}
            if {[string first "A:" [lindex $PDEREF 0]] != 0} {set ok 0; break}
            set PDEREF [lindex $PDEREF 1]
            if {[string first "A:" [lindex $RESOLUTION 0]] != 0} {set ok 0; break}
            set RESOLUTION [lindex $RESOLUTION 1]
            }
        if {!$ok} break
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F16 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S19F15R

S19F16PDE Resolution Data Sent by Equipment Only

    # S19F16 Tcl Parse reply
    set reply [secs_xact $spname S19F15R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 {L:m {L:2 PDEREF RESOLUTION}} {L:n {L:3 UID RESPDESTAT STATUSTXT}}
        # PDEREF A:36 (always)  The UID of a PDE or of a PDE group formatted as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens.
        # RESOLUTION A:36 (always)  the UID of a PDE
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # RESPDESTAT U1:1 (always)  status codes for PDE resolution
        # STATUSTXT A:80 (always)  status response description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {Lm Ln_n1}
        if {[string first L: [lindex $Lm 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Lm 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {PDEREF RESOLUTION}
            if {[string first "A:" [lindex $PDEREF 0]] != 0} {set ok 0; break}
            set PDEREF [lindex $PDEREF 1]
            if {[string first "A:" [lindex $RESOLUTION 0]] != 0} {set ok 0; break}
            set RESOLUTION [lindex $RESOLUTION 1]
            }
        if {!$ok} break
        if {[string first L: [lindex $Ln_n1 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln_n1 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {UID RESPDESTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $RESPDESTAT 0] != "U1:1"} {set ok 0; break}
            set RESPDESTAT [lindex $RESPDESTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F17RVerify PDE Request Sent by Host Only

    # S19F17R Tcl Receive message - add next line to setup
    $spname whenever S19F17 [list recv_S19F17R $spname]

# receive procedure 
proc recv_S19F17R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect L:4 TARGETPDE {L:n {L:2 PDEREF RESOLUTION}} VERIFYTYPE VERIFYDEPTH
        # TARGETPDE A:36 (always)  the UID of the target PDE, a 36 character string with runs of 8,4,4,4, and 12 characters joined by hyphens.
        # PDEREF A:36 (always)  The UID of a PDE or of a PDE group formatted as a 36 character string with runs of 8, 4, 4, 4, and 12 characters joined by hyphens.
        # RESOLUTION A:36 (always)  the UID of a PDE
        # VERIFYTYPE U1:1 (always)  chooses the type of verification
        # VERIFYDEPTH U1:1 (always)  whether to check only the target, or the target and all referenced PDEs
        if { [lindex $TSN_data 0] != "L:4" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {TARGETPDE Ln VERIFYTYPE VERIFYDEPTH}
        if {[string first "A:" [lindex $TARGETPDE 0]] != 0} {set ok 0; break}
        set TARGETPDE [lindex $TARGETPDE 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L2_1 [lreplace $Ln 0 0] {
            if { [lindex $L2_1 0] != "L:2" } {set ok 0; break}
            vset [lreplace $L2_1 0 0] {PDEREF RESOLUTION}
            if {[string first "A:" [lindex $PDEREF 0]] != 0} {set ok 0; break}
            set PDEREF [lindex $PDEREF 1]
            if {[string first "A:" [lindex $RESOLUTION 0]] != 0} {set ok 0; break}
            set RESOLUTION [lindex $RESOLUTION 1]
            }
        if {!$ok} break
        if {[lindex $VERIFYTYPE 0] != "U1:1"} {set ok 0; break}
        set VERIFYTYPE [lindex $VERIFYTYPE 1]
        if {[lindex $VERIFYDEPTH 0] != "U1:1"} {set ok 0; break}
        set VERIFYDEPTH [lindex $VERIFYDEPTH 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F18 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    # bad data 
    eq_S9_reply $spname 7
    } ;# end recv_S19F17R

S19F18PDE Verification Result Sent by Equipment Only

    # S19F18 Tcl Parse reply
    set reply [secs_xact $spname S19F17R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect L:2 VERIFYSUCCESS {L:n {L:3 UID VERIFYRSPSTAT STATUSTXT}}
        # VERIFYSUCCESS TF:1 (always)  True if no errors were found
        # UID A:36 (always)  See SEMI E139.  A unique identifier for a PDE consisting of a 36 character string with runs of 8, 4, 4, 4, and 12 characters separated by hyphens 
        # VERIFYRSPSTAT U1:1 (always)  PDE verification result, 0 success, 10 none, other error
        # STATUSTXT A:80 (always)  status response description
        if { [lindex $TSN_data 0] != "L:2" } {set ok 0; break}
        vset [lreplace $TSN_data 0 0] {VERIFYSUCCESS Ln}
        if {[lindex $VERIFYSUCCESS 0] != "TF:1"} {set ok 0; break}
        set VERIFYSUCCESS [lindex $VERIFYSUCCESS 1]
        if {[string first L: [lindex $Ln 0]] != 0} {set ok 0; break}
        foreach L3_1 [lreplace $Ln 0 0] {
            if { [lindex $L3_1 0] != "L:3" } {set ok 0; break}
            vset [lreplace $L3_1 0 0] {UID VERIFYRSPSTAT STATUSTXT}
            if {[string first "A:" [lindex $UID 0]] != 0} {set ok 0; break}
            set UID [lindex $UID 1]
            if {[lindex $VERIFYRSPSTAT 0] != "U1:1"} {set ok 0; break}
            set VERIFYRSPSTAT [lindex $VERIFYRSPSTAT 1]
            if {[string first "A:" [lindex $STATUSTXT 0]] != 0} {set ok 0; break}
            set STATUSTXT [lindex $STATUSTXT 1]
            }
        if {!$ok} break
        return ;# finished ok
        } ;# end while(ok)

S19F19RS19 Multi-block Inquire Sent by Host and Equipment

    # S19F19R Tcl Receive message - add next line to setup
    $spname whenever S19F19 [list recv_S19F19R $spname]

# receive procedure 
proc recv_S19F19R {spname} {
    global $spname
    set TSN_data [set ${spname}(lastrmsg)]
    set send_reply [expr [string first R [set ${spname}(lastrSFR)]] > 0]
    set ok 1
    while {$ok} {   ;# break out of loop on error
        # expect DATALENGTH
        # DATALENGTH U4:1 (varies)  total bytes of the message body 
        #vset [split [lindex $TSN_data 0] :] {typeDATALENGTH lengthDATALENGTH}
        set DATALENGTH [lindex $TSN_data 1]
        if {$send_reply} {
            # TBD create reply data
            $spname put S19F20 $TBD_replydata
            }
        return ;# finished ok
        } ;# end while(ok)
    } ;# end recv_S19F19R

S19F20S19 Multi-block Grant Sent by Host and Equipment

    # S19F20 Tcl Parse reply
    set reply [secs_xact $spname S19F19R $TBD_senddata]
    set ok 1
    while {$ok} {  ;# break out of loop on error
        if { $reply == "TIMEOUT" } {  ;# abort, S9, or timeout
            set failure [secs_xact_failure $spname]
            set ok 0 ; break   ;# TBD handle failure here and return? 
            }
        set TSN_data $reply
        # expect GRANT
        # GRANT B:1 (always)  multiblock grant code
        if {[lindex $TSN_data 0] != "B:1"} {set ok 0; break}
        set GRANT [expr [lindex $TSN_data 1]]  ;# expr converts 0xhh to int
        return ;# finished ok
        } ;# end while(ok)