debug = 1 -- 1: Print() debug messages to log.txt -- Simulator datarefs AW109_CAS_Text_ref = find_dataref("aw109/CAS_text") -- CAS Text AW109_CAS_count = find_dataref("aw109/CAS_count") -- Number of CAS entries in CAS Text; each entry is separated by "|" -- AW109_CAS_Text =" " function CASDisplay() -- if ((AW109_CAS_Text_ref==nil) or (AW109_CAS_Text_ref=="")) then -- AW109_CAS_Text = "*********************************empty" -- else -- AW109_CAS_Text = AW109_CAS_Text_ref -- end if debug == 1 then print ("AW109_CAS_Text: ", AW109_CAS_Text_ref) end if debug == 1 then print ("AW109_CAS_count: ", AW109_CAS_count) end if AW109_CAS_count > 0 then -- Execute only if there is data in the queue if debug == 1 then print ("======================================Function Execution CASDisplay()======================================") end end -- end AW109_CAS_count > 0 end -- end function CASDisplay() run_at_interval(CASDisplay, 0.2)