Logged Data Dump with Controller Query SelmaWare Solutions INIT: !MACR .OBJECTS ' Run macro on New Plots !NPSU ON ' Use analog data for macro !USEA ON ' Data File name !NAMD logged.txt ' Save data to file !SAVD ON ' Set number of bytes !NUMB 0 ' Use binary checksum !CSUM ON ' Set Queue size !QSIZ 6536 ' Set analog span !SPAN 0, 250 ' Set max time !TMAX 120 ' Set X label !XLBL Time ' Title plot !TITL Logged Data Dump ' Flush old data !FLSH ON ' Show real time !RTIM ON ' Set display information !DISP D9 G2 A0 S0 B15 R ENDMAC OBJECTS: !POBJ Clear !PPER 80,100 !POBJ oBack=7 ' Obj1 -- OLABEL ***** !POBJ oLabel.Obj1=81.,98.,15.,3.,Start Date Time:,,0,9,0 ' txtStart -- OTEXT ***** !POBJ oText.txtStart=83.,94.,15.,5.6,03/12/02 12:19:35,15,0,9 !POBJ txtStart.tip=Enter data starting date (optional) and time. ' butSTime -- OBUTTON ***** !POBJ oButton.butSTime=83.,89.,15.,5.,Set to current,8 !POBJ butSTime.tip=Sets Date Time to current. '-- Event Code !POBJ butSTime.C=!POBJ txtStart=(DATE) (RTIME) ' txtInt -- OTEXT ***** !POBJ oText.txtInt=90.,63.,5.,4.,-10,15,0,9 !POBJ txtInt.tip=Interval between logged data in seconds. (use negative value for plotting backwards in time) ' Obj5 -- OLABEL ***** !POBJ oLabel.Obj5=83.,64.,6.,8.,Interval (sec):,,0,9,0 ' butSet -- OBUTTON ***** !POBJ oButton.butSet=86.,47.,10.,5.,Set,8 !POBJ butSet.V=0 !POBJ butSet.tip=Configure plot to accept logged data '-- Event Code !POBJ butSet.C=!NAMD (txtLog).txt(;) !RSET(;) !USEA ON(;) !PNTS (txtNum)(;) !RSET(;) 'configure based on forward or backwads plotting(;) !IFTH (txtInt),<,0,!HISS (txtEnd)(CR)!TMAX (txtEnd)(CR)!TMIN [(TMAX),+,[(txtInt),*,(txtNum)]](;) !IFTH (txtInt),>,0,!HISS (txtStart)(CR)!TMAX [(txtInt),*,(txtNum)](;) !RTIME ON(;) !PLOT ON ' Obj7 -- OLABEL ***** !POBJ oLabel.Obj7=82.,56.,9.,8.,Sample Number:,,0,9,0 ' txtNum -- OTEXT ***** !POBJ oText.txtNum=90.,56.,6.,4.,200,15,0,9 !POBJ txtNum.tip=Enter anticipated number of samples recorded ' DA_Process -- OBUTTON ***** !POBJ oButton.DA_Process=48.,7.,10.,5.,Obj9,8 !POBJ DA_Process.V=0 '-- Event Code !POBJ DA_Process.C=!HISD (txtInt),(AINVAL0),(AINVAL1),(AINVAL2),(AINVAL3),(AINVAL4),(AINVAL5)(;) ' lblEnd -- OLABEL ***** !POBJ oLabel.lblEnd=83.,81.,10.,3.,End Date Time,,0,9,0 ' txtEnd -- OTEXT ***** !POBJ oText.txtEnd=83.,77.,15.,5.6,03/12/02 12:30:43,15,0,9 !POBJ txtEnd.tip=Enter data ending date (optional) and time. ' butETime -- OBUTTON ***** !POBJ oButton.butETime=83.,71.,15.,5.,Set to current,8 '-- Event Code !POBJ butETime.C=!POBJ txtEnd=(DATE) (RTIME) ' chkLog -- OCHECK ***** !POBJ oCheck.chkLog=83.,37.,20.,5.,Log data to file,1,,0,9 '-- Event Code !POBJ chkLog.C=!SAVD ((ME)) ' butData -- OBUTTON ***** !POBJ oButton.butData=83.,32.,15.,5.,Open Data File,8 '-- Event Code !POBJ butData.C=!NAMD (txtlog).txt(;) !APPA (DATALOG)(;) ' Obj17 -- OLABEL ***** !POBJ oLabel.Obj17=84.,48.,15.,3.,Log File Name:,,0,9,0 ' ButDelData -- OTEXT ***** !POBJ oText.ButDelData=83.,26.,15.,5.,Delete Data,8,7,8 !POBJ ButDelData.tip=Deleted named data file !POBJ ButDelData.F=Arial,8,1,0 '-- Event Code !POBJ ButDelData.C=!NAMD (txtlog).txt(;) !MREQ N,30,Delete log file?\nY/N,50(;) !IFTH %m50,~,Y,!DELD(;) ' cmdMain -- OBUTTON ***** !POBJ oButton.cmdMain=90.,5.,10.,5.,Plot Select,8 '-- Event Code !POBJ cmdMain.C=!MREQ N,30,Return to plot selection?\nY\N,99(;) !IFTH %m99,=,Y,!MACS(;) !IFTH %m99,=,y,!MACS(;) (;) ' butTest -- OBUTTON ***** !POBJ oButton.butTest=90.,11.,10.,5.,Test Data,8 !POBJ butTest.tip=Sends random and anolog test data. Ensure Plotting is enabled '-- Event Code !POBJ butTest.C=!MACR wizards/randomdata ' chkDump -- OCHECK ***** !POBJ oCheck.chkDump=83.,18.,15.,5.,Dump Data,0,,0,9 !POBJ chkDump.tip=Select to inform controller to send data !POBJ chkDump.F=Arial,9,1,0 ' ButDelData -- OBUTTON ***** !POBJ oButton.ButDelData=83.,26.,15.,5.,Delete Data,8 !POBJ ButDelData.tip=Deleted named data file '-- Event Code !POBJ ButDelData.C=!NAMD (txtlog).txt(;) !MREQ N,30,Delete log file?\nY/N,50(;) !IFTH %m50,~,Y,!DELD(;) ' txtLog -- OTEXT ***** !POBJ oText.txtLog=83.,44.,15.,4.1,Logged,15,0,9 ENDMAC