The following is a sample of how you can build and write ECS watch commands.
...
action DefineWatchForWelcome is
#----------------------------------------------------------------
# build the watch criteria
#----------------------------------------------------------------
call EcsClearWatch ( Watch_SV )
copy errorlevel to ErrorLevel_IV
call ProcessEcsError ( ErrorLevel_IV )
copy 3 to Row_IV
copy 1 to Column_IV
call EcsWatchForCursorAt ( Row_IV, Column_IV, Watch_SV )
copy errorlevel to ErrorLevel_IV
call ProcessEcsError ( ErrorLevel_IV )
copy 2 to Row_IV
copy 1 to Column_IV
copy "WELCOME" to WatchFor_SV
call EcsWatchForStringAt ( Row_IV, Column_IV, WatchFor_SV, Watch_SV )
copy errorlevel to ErrorLevel_IV
call ProcessEcsError ( ErrorLevel_IV )
copy 100 to SettleTime_IV
call EcsWatchForIIOff ( SettleTime_IV, Watch_SV )
copy errorlevel to ErrorLevel_IV
call ProcessEcsError ( ErrorLevel_IV )
#----------------------------------------------------------------
# write it out to the textual region
#----------------------------------------------------------------
copy "WatchForWelcome" to WatchName_SV
call WriteEcsCommand ( EcsTextRegion_SV, WatchName_SV, Watch_SV )
response to start
copy "WatchCommands_TR" to EcsTextRegion_SV
#----------------------------------------------------------------
# define all your watch command strings
#----------------------------------------------------------------
action DefineWatchForWelcome
action Define...
...
#---------------------------------------------------------------
# write the command strings out to a file
#----------------------------------------------------------------
copy "ecscmdsv.dat" to EcsCommandFile_SV
call WriteEcsCommandFile ( EcsCommandFile_SV, EcsTextRegion_SV, Clear_BV )
#----------------------------------------------------------------