TAOS TCS230 Example Martin Hebel SelmaWare Solutions 8-8-2005 INIT: 'Set as default macro !DEFS (ME) !MACR .OBJECTS ' Set as default/startup macro !DEFS (ME) ' Run macro on New Plots !NPSU ON ' Use analog data for macro !USEA ON ' Use RESET Macro routine !USER ON ' Use DLBCLICK Routine !USEC ON ' Message file name !NAMM Taos_Color_msg.txt ' Data File name !NAMD Taos_Color_dat.txt ' Autosave snapshot name !NAMS Taos_Color ' Append date/time off !APDT OFF ' Save data to file !SAVD ON ' Auto based on time !AUTT ' Set Queue size !QSIZ 7748 ' Set analog span !SPAN 0, 300 ' Set max time !TMAX 60 ' Set number of samples !PNTS 5000 ' Stop at max time !MAXT ' Set analog mask !AMSK 0.00 ' Clear min/max on reset !CMMR ON ' Shift left at max !SHFT ON ' Title plot !TITL TAOS TCS230 Color Sensor Interface ' Flush old data !FLSH ON ' Set display information !DISP D9 G2 A0 S0 B15 R ' Set analog width !AWTH 3 ENDMAC OBJECTS: !POBJ Clear !PPER 75,80 ' Set Back Color ******** !POBJ oBack=misc\background.jpg ' Analog Arrival Code ******* !POBJ oAnalog.C=(;) ' DA_lblFrame -- OLABEL ***** !POBJ oLabel.DA_lblFrame=1.,19.,98.,18.3, ,1,0,9,1 !POBJ DA_lblFrame.F=Arial,9,0,0 ' ComPort -- ODROP ***** !POBJ oDrop.ComPort=11.,17.,5.,3.6,8,1,2,3,4,5,6,7,8,9,10,1 !POBJ ComPort.F=Arial,8,0,0 !POBJ ComPort.tip=Select the COM port being used. '-- Event Code !POBJ ComPort.C=!PORT ((ME))(;) !SREG comport,(ComPort)(;) (;) ' txtCP -- OCHECK ***** !POBJ oCheck.txtCP=17.,18.,14.,5.,Connect and Plot,0,1,15,9 !POBJ txtCP.F=Arial,9,0,0 '-- Event Code !POBJ txtCP.C=!PLOT ((ME))(;) !CONN ((ME)) ' lblCom -- OLABEL ***** !POBJ oLabel.lblCom=2.,16.,8.,3.,COM Port:,,15,9,0 !POBJ lblCom.F=Arial,9,0,0 ' chkLog -- OCHECK ***** !POBJ oCheck.chkLog=22.,13.,9.,3.2,Log Data,1,1,15,9 !POBJ chkLog.F=Arial,9,0,0 !POBJ chkLog.tip=Check to save data to file ' cmdOpenLog -- OBUTTON ***** !POBJ oButton.cmdOpenLog=22.,9.7,9.,3.,Open Log,8 !POBJ cmdOpenLog.F=Arial,8,0,0 !POBJ cmdOpenLog.tip=Click to open data log file. Saved to StampPlot Data directory. '-- Event Code !POBJ cmdOpenLog.C=!APPA (NAMD)(;) ' cmdDelLog -- OBUTTON ***** !POBJ oButton.cmdDelLog=22.,6.,9.,3.,Delete Log,8 !POBJ cmdDelLog.F=Arial,8,0,0 !POBJ cmdDelLog.tip=Delete current data log file '-- Event Code !POBJ cmdDelLog.C=!MREQ N,30,Delete log file?\n(Y/N),99(;) !IFTH %m99,~,Y,!DELD(;) ' txtFileName -- OTEXT ***** !POBJ oText.txtFileName=11.,12.,10.,3.8,Taos_Color,15,0,8 !POBJ txtFileName.F=Arial,8,0,0 !POBJ txtFileName.tip=Enter name for plot image and data files. Files are saved to the StampPlot Data directory. TAB off to set. '-- Event Code !POBJ txtFileName.C=!NAMS ((ME))(;) !NAMD ((ME))_dat.txt(;) !NAMM ((ME))_msg.txt(;) ' lblSnap -- OLABEL ***** !POBJ oLabel.lblSnap=2.,11.,8.,7.,File Name:,1,15,9,0 !POBJ lblSnap.F=Arial,9,0,0 ' chkTime -- OCHECK ***** !POBJ oCheck.chkTime=33.,13.,17.,3.2,Real Time on X-Axis,0,1,15,9 !POBJ chkTime.F=Arial,9,0,0 !POBJ chkTime.tip=Uses real date & time on X-axis '-- Event Code !POBJ chkTime.C=!RTIM ((ME)) ' chkAutoSnap -- OCHECK ***** !POBJ oCheck.chkAutoSnap=51.,9.,16.,3.2,Snapshot Max Time,0,1,15,9 !POBJ chkAutoSnap.F=Arial,9,0,0 !POBJ chkAutoSnap.tip=Snapshot when plot reaches maximum time. '-- Event Code !POBJ chkAutoSnap.C=!AUTT(;) !ASNP ((ME))(;) ' chkAPDT -- OCHECK ***** !POBJ oCheck.chkAPDT=51.,5.,23.,3.2,Append Date/Time to Image,0,1,15,9 !POBJ chkAPDT.F=Arial,9,0,0 !POBJ chkAPDT.tip=Adds date and time to image name. '-- Event Code !POBJ chkAPDT.C=!APDT ((ME))(;) ' cmdAScale -- OBUTTON ***** !POBJ oButton.cmdAScale=11.,7.,10.,4.,Auto Scale Y,8 !POBJ cmdAScale.F=Arial,8,0,0 !POBJ cmdAScale.tip=Auto scales Y values based on data '-- Event Code !POBJ cmdAScale.C=!ASCL ' lblShift -- OLABEL ***** !POBJ oLabel.lblShift=32.,17.,10.,3.,Shift Amount:,1,15,9,0 !POBJ lblShift.F=Arial,9,0,0 ' txtSAMT -- OTEXT ***** !POBJ oText.txtSAMT=42.,18.,4.,4.,50,15,0,8 !POBJ txtSAMT.F=Arial,8,0,0 !POBJ txtSAMT.tip=Sets the percent to shift the plot when at maximum '-- Event Code !POBJ txtSAMT.C=!SAMT ((ME))(;) ' Save -- OBUTTON ***** !POBJ oButton.Save=33.,9.,7.,6.,Save Settings,8 !POBJ Save.F=Arial,8,0,0 !POBJ Save.tip=Saves current configuration settings based on File Name '-- Event Code !POBJ Save.C=!MREQ N,10,Overwrite '(txtFileName)' plot settings?\nY\N,99(;) !IFTH %m99,~,Y,!SSET (txtFileName) ' Get -- OBUTTON ***** !POBJ oButton.Get=41.,9.,7.,6.,Load Settings,8 !POBJ Get.F=Arial,8,0,0 !POBJ Get.tip=Loads saved configuration settings based on File Name '-- Event Code !POBJ Get.C=!GSET (txtSnap) ' chkForm -- OCHECK ***** !POBJ oCheck.chkForm=51.,13.,20.,3.,Snapshot entire form,0,1,15,9 !POBJ chkForm.F=Arial,9,0,0 !POBJ chkForm.tip=Check to take a snapshop entire form window instead of plot only '-- Event Code !POBJ chkForm.C=!FORM ((ME))(;) ' butSnap -- OBUTTON ***** !POBJ oButton.butSnap=51.,18.,11.,5.,Take Snapshot,8 !POBJ butSnap.F=Arial,8,0,0 !POBJ butSnap.tip=Click to take an image of the plot '-- Event Code !POBJ butSnap.C=!SNAP (txtFileName)(;) ~PWAV stapler ' butViewSnap -- OBUTTON ***** !POBJ oButton.butViewSnap=63.,18.,12.,5.,View Snapshot,8 !POBJ butViewSnap.F=Arial,8,0,0 !POBJ butViewSnap.tip=Click to view last snapshot image '-- Event Code !POBJ butViewSnap.C=!APPA (SNAPNAME)(;) ' butTextClear -- OBUTTON ***** !POBJ oButton.butTextClear=77.,7.,16.,5.,Clear Text on Plot,8 !POBJ butTextClear.F=Arial,8,0,0 !POBJ butTextClear.tip=Click to clear text on plot '-- Event Code !POBJ butTextClear.C=!CLRC(;) ' txtPlotText -- ODROP ***** !POBJ oDrop.txtPlotText=77.,13.,21.,3.9,9,X-Marks Spot !POBJ txtPlotText.F=Arial,9,0,0 !POBJ txtPlotText.tip=Double-Clicking plot will place text or value on plot ' Obj28 -- OLABEL ***** !POBJ oLabel.Obj28=76.,17.,20.,3.,Double-Click Plot to add Text,1,15,9,0 !POBJ Obj28.F=Arial,9,0,0 ' focus -- OBUTTON ***** !POBJ oButton.focus=10.,80.,12.,5.,focus,8 !POBJ focus.F=Arial,8,0,0 '-- Event Code !POBJ focus.C=!POBJ (ME).SF ' barRed -- OVBAR ***** !POBJ oVBar.barRed=77.4,92.,3.,64.,300,68 !POBJ barRed.U=(AINVAL0) ' txtRed -- OLABEL ***** !POBJ oLabel.txtRed=76.,27.,6.,5.,68,12,15,12,1 !POBJ txtRed.F=Arial,12,1,0 !POBJ txtRed.U=(AINVAL0) ' barGreen -- OVBAR ***** !POBJ oVBar.barGreen=84.4,92.,3.,64.,300,26 !POBJ barGreen.U=(AINVAL1) ' txtGreen -- OLABEL ***** !POBJ oLabel.txtGreen=83.,27.,6.,5.,26,2,15,12,1 !POBJ txtGreen.F=Arial,12,1,0 !POBJ txtGreen.U=(AINVAL1) ' barBlue -- OVBAR ***** !POBJ oVBar.barBlue=91.6,92.,3.,64.,300,35 !POBJ barBlue.U=(AINVAL2) ' txtBlue -- OLABEL ***** !POBJ oLabel.txtBlue=90.,27.,6.,5.,35,9,15,12,1 !POBJ txtBlue.F=Arial,12,1,0 !POBJ txtBlue.U=(AINVAL2) ' banner -- OBANNER ***** !POBJ oBanner.banner=76.,99.,23.,5.9,TAOS TCS230 Color Sensor Example adapted by SelmaWare Solutions .... ,9,14,12,2 !POBJ banner.F=Arial,12,0,0 ENDMAC RESET: 'Enter reset code ENDMAC DBLCLICK: @TEXT (XR),(YR),1.2R,13,(txtPlotText) ENDMAC