% % IOT devices service monitor % % monitor the Factory\PostedTelem *.msg files % Md0123E25E3ED317F7FE_972384505634549.msg % *machmtrj _Msys.HasDevice { jsnow !Msys.Iots *machmtrk _Msys.HasMessages { % % there is a device to focus on, check for timely messages % "*.msg" !wilder _Device &"\" &_Subscription &"\" ofconn empty { jsnow %%% dup _Msys.GapBase sub dup _Msys.MinGap gt %%%"CK--> " &4) &" diff " &3 &" gtmin " &2 &" gtmax " second _Msys.MaxGap gt & log# %%% "endiota" log)( { % % we have passed the minimum gap that was established % check if the maximum gap has been violated % _Msys.MaxGap gt { % % maximum gap violated % "maxgap" log# *macherrj( true } { % % still within max gap % false } ifelse %%% "endiotb" log)( } { % % still within the minimum gap % pop true } ifelse %%% "endiotc" log)( ? %%% "endiotd" log)( nextfile ? % % get the time stamp that this message was captured from device message % dup "_" right$ "." left$ dup !Mstamp _Mach.PostTime gt %%% "endiote" log)( { % % have a message with proper post time, check validity % *machmsgq %%% "endiotf" log)( { % % proper message, process incoming transaction % *machcsta %%% "endiotg" log)( *machxact % % don't do more than 75 messages at a time % when they are after the valid post time % convert to .xtx % finaled %%% "endioth" log)( +Mach.CycLim 75 gt ? } { % % improper message format, rename as error-flagged file % finalerr } ifelse %%% "endioti" log)( _Mstamp !Mach.PostTime } { % % don't do more than 500 messages at a time % when they are before the valid post time % convert to .xtx % finaled +Mach.CycLim 500 gt ? %%% "endiotj" log)( } ifelse %%% "endiotk" log)( } loop filing) % % end of current batch of incoming messages, or processed 50 % reset limiter % 0 !Mach.CycLim %%% "endiotl" log)( } { true 1000 100000 *machgaps %%% "endiotm" log)( } ifelse %%% "***IOTS " log# } if