Software: Cloverleaf 5.8.4 OP
I’m working on a simple TCL script that will simply execute a batch script. The batch script works fine when I manually execute it. I just need to have the TCL script execute it whenever the TCL script is run.
The line that is supposed to execute is:
exec cmd /c E:healthvisioncis5.8integratorbinDaily_SMAT_Cycle.bat
The issue is that it doesn’t seem to work…nothing is executed and I’m not sure why.
Below is the code:
######################################################################
# Name:      Cycle_SMAT
# Purpose:   This TCL script only exists to execute the batch script which performs the cycling of the threads
# UPoC type: tps
# Args:      tps keyedlist containing the following keys:
#            MODE    run mode (”start”, “run”, “time” or “shutdown”)
#            MSGID   message handle
#            CONTEXT tps caller context
#            ARGS    user-supplied arguments:
#                    
#
# Returns:   tps disposition list:
#            
#
# Notes:     Had to do this only because windows scheduler refused to work.
#
# History:   
#                 
proc Cycle_SMAT { args } {
    global HciConnName                             ;# Name of thread
    
    keylget args MODE mode                         ;# Fetch mode
    set ctx “”   ; keylget args CONTEXT ctx        ;# Fetch tps caller context
    set uargs {} ; keylget args ARGS uargs         ;# Fetch user-supplied args
    set debug 0  ;                                 ;# Fetch user argument DEBUG and
    catch {keylget uargs DEBUG debug}              ;# assume uargs is a keyed list
    set module “Cycle_SMAT/$HciConnName/$ctx” ;# Use this before every echo/puts,
                                                   ;# it describes where the text came from
set dispList {} ;# Nothing to return
    switch -exact — $mode {
        start {
            # Perform special init functions
            # N.B.: there may or may not be a MSGID key in args
            
            if { $debug } {
                puts stdout “$module: Starting in debug mode…”
            }
        }
        run {
            # ‘run’ mode always has a MSGID; fetch and process it
             exec cmd /c E:healthvisioncis5.8integratorbinDaily_SMAT_Cycle.bat
            keylget args MSGID mh
            lappend dispList “CONTINUE $mh”
        }
        time {
            # Timer-based processing
            # N.B.: there may or may not be a MSGID key in args
            
        }
        
        shutdown {
            # Doing some clean-up work
            
        }
        
        default {
            error “Unknown mode ‘$mode’ in $module”
        }
    }
    return $dispList
}
[/b]