************************************* StampPlot1 Class Methods rev f Martin Hebel -- 5/18/02 martin@selmaware.com http://www.stampplot.com ************************************* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> THIS CLASS OBJECT ASSUMES YOU ARE USING THE JAVELIN DEMO BOARD NON-PROGRAMMING COMM PORT PER THE JAVELIN MANUAL FIGURE 4.8 FOR STAMPPLOT COMMs. DO NOT CONNECT CTS/RTS ON P1 and P2, LEAVE UNUSED FOR NOW PLEASE. P0 --> COM Port 2 connection P1 -- Unconnected P2 -- Unconnected P3 --> COM Port 3 connection <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The StampPlot1 class is currently configured for Comms on P0 and P3 per the Javelin manual. Depending on your board configuration, this may be modified. Currently, please do not use connections on RTS/CTS (leave them uncommitted). All data from StampPlot is acquired using the readControls() method. This parses the data for switches and sliders into variables, which are used when performing a control read, such as readSW(); The request for data, and the returning data accepted, may not be totally in synch. If your program reads data infrequently (in the seconds), you may want to increase the retries (below) to ensure the current returning data is accepted. A method, dataRetyr(int), is used to define the number of retries to perform when awaiting returning data. Depending on your PC speed this may be increased or decreased. The default is 1000. If the value is too small, non-synchronization of requests may occur, though the longer the value, the slower the controller processing will be when not connected to StampPlot. This class may used with StampPlot for general plotting and logging without initializing StampPlot.init();. This class may be used for general StampPlot plotting and control for: - All Configuration methods. - All Plotting - Digital and Analog - methods. - All logging methods. - All Data Value methods - All General methods. The following methods should NOT be used if the init() plot configuration (or similar) is NOT used: - All Gauge, Switch, Slider and LED methods. ****************************************** Call to initialize StampPlot configuration once connect on COMM port StampPlot1.init(); Reads all controls from StampPlot. CALL PRIOR TO USING ANY INDIVIDUAL CONTROL READS. StampPlot1.readControls(); ************ Configuration Set min and max Y scales StampPlot1.plotset(int min,int max); Enable/disable plotting StampPlot1.plot(true/false); Reset the plot StampPlot1.reset(); ******************** Plotting ************** ************** Analog Plot a point on channel 0 StampPlot1.plot(int value); *** IF YOU WILL BE USING DATA LOGGING, USE THE plotValues METHODS *** *** Also, use these in using the installed StampPlot configurations **** Plot 1 analog value (same function as plot(int value)) StampPlot1.plotValues(int value); Plot 2 analog values StampPlot1.plotValues(int value1, int value2); Plot 3 analog values StampPlot1.plotValues(int value1, int value2, int value3); Plot 4 analog values StampPlot1.plotValues(int value1, int value2, int value3, value4); Plot a point on defined channel (0-9) with value StampPlot1.plot(int channel, int value); Plot a point on defined channel (0-9) with value and color (0-15) StampPlot1.plot(int channel, int value, int color); ************* Digital Plot a single digital value StampPlot1.plotDigital(true/false); Plot 2 digital values StampPlot1.plotDigital(true/false, true/false); Plot 3 digital values StampPlot1.plotDigital(true/false, true/false, true/false); Plot 4 digital values StampPlot1.plotDigital(true/false, true/false, true/false, true/false); Plot digital from a decimal value for specified number of bits up to 8 StampPlot1.plotDigital(int value,int bits) ************** Logging data to a text file **************** If you need to log analog data, be sure to use the plotValues() methods for plotting Name the log file StampPlot1.logData("string"); Enable Logging StampPlot1.logData(true/false); Enable logging and delete current data file StampPlot1.logData(log true/false, kill true/false); ************************ LEDS ****************************** Set status of StampPlot LED by number and true/false StampPlot1.setLED(int LED number, true/false); Set all LED with value between 0-255 StampPlot1.setLED(int value of byte); Set text label for selected LED StampPlot1.setLED(int led number, "text"); ********************** SWITCHES ************************ Set the value of a switch by number and true/false StampPlot1.setSW(int switch number,true/false); Set entire switch bank by byte value 0-255 StampPlot1.setSW(int byte value); Set the text label of a switch StampPlot1.setSW(int switch number, "text"); Read the entire bank as a byte intVal = StampPlot1.readSW(); Read a particular switch by number, returns true/false boolVal = StampPlot1.readSW(int switch number); ************************ Gauges ************************* Set a gauge value StampPlot1.setGauge(int gauge number, int gauge value); Set the text label for a gauge StampPlot1.setGauge(int gauge number, "text"); Set the min, max, alarm min and alarm max for a gauge StampPlot1.setGauge(int gauge number, int min, int max, int alarm min, int alarm max); Set whether a gauge alarms at setpoints StampPlot1.setGauge(int gauge number,true/false); ******************* SLIDERS ************************ Sets a current value for a slider StampPlot1.setSlider(int slider number,int value); Sets text label for a slider StampPlot1.setSlider(int slider number,"text"); Reads the value of the slider StampPlot1.readSlider(int slider number); ****************** Data Value ********************* Can be used for StampPlot processing of data and reading by Javelin Set the data value: StampPlot1.dataVal("String"); Get the StampPlot Data value StampPlot1.dataVal(); **************************** General methods **************** sounds a WAV file alarm on StampPlot StampPlot1.alarm(); Sets a message in the status box StampPlot1.status("text string"); StampPlot1.status(int value); Sends a raw string to processing for use of other StampPlot instructions StampPlot1.raw ("text string"); Sends a raw string, does not append a carraige return (CR 13) StampPlot1.raw("text string",false); Sets how many retries to perfrom when awaiting returning data requests. dataWait(int retries)