Chapter 3: Commands and Programming Chapter 3: Commands and Programming This chapter describes how to set up the data analyzer and control it using commands sent from a connected CFX-9850G or CFX-9800G graphic scientific calculator. Command Conventions and Formats ................................ 24 Programming ..................................................................... 26 Sending Commands from a Calculator to the Data Analyzer ....................................................
Chapter 3: Commands and Programming Command Conventions and Formats Commands sent from a connected CFX-9850G or CFX-9800G graphic scientific calculator can be used to make various settings and control operations of the data analyzer. Commands Commands can be written as CFX-9850G list data or CFX-9800G matrix data in the format shown below. {m,n,n,n,n,...} Command number Parameter number There are a total of 10 commands numbered from 0 through 9. The following describes the function of each command.
Chapter 3: Commands and Programming Number 6 Description MULTIMETER MODE SETUP This command sets the Multimeter Mode unit of measurement for a particular channel. 7 REQUEST STATUS This command creates a data list concerning the data analyzer’s current status (error status, probe connection data, etc.) being requested by the connected calculator. 8 SAMPLING START This command causes the data analyzer to start sampling immediately.
Chapter 3: Commands and Programming Programming Programs can be input on the CFX-9850G graphic scientific calculator and then sent to the data analyzer to make it perform a series of tasks. • Note that data analyzer control programs can be input on the CFX-9850G graphic scientific calculator only. The CFX-9800G can be used to send commands one-by-one. Tasks Normally Controlled by Programs The following outline describes the normal sequence of a data analyzer system control program. 1.
Chapter 3: Commands and Programming Example Program The following is an example program written for the CFX-9850G. Cls ↵ CFX-9850G graph clear operation {1,0} → List 6 ↵ Send(List 6) ↵ Clears all channel settings and data. {1,1,1} → List 6 ↵ Send(List 6) ↵ Specifies sampling with Auto-ID probe connected to CH1. {3,0.5,100,1} → List 6 ↵ Send(List 6) ^ Specifies sample time of 0.5 seconds, 100 samples, and absolute time recording on.
Chapter 3: Commands and Programming the list. When using the Send(List) command, you should specify the list that contains the commands by replacing “List” with a CFX-9850G List variable (List 1 through List 6). • Sending a new setup command (Command 1 or Command 3) clears all previously sampled data from data analyzer memory. To input the “Send(” command on the CFX-9850G 1.
Chapter 3: Commands and Programming 7. Repeat steps 5 and 6 as many times as necessary to send any other matrix data that you want. Matrix Data Example The following describes a typical example procedure for sending commands that set up the data analyzer for sampling of distance data with a distance sensor. 1. Input the following matrix data on the CFX-9800G. 1 0 Channel clear 1 Command 1 4 Channel: SONIC 2 Unit: meters 3 Command 3 0.5 Sampling duration: 0.
Chapter 3: Commands and Programming Transferring Sampled Data to a Calculator This section explains how to send sampled data between the data analyzer and a connected CFX-9850G or CFX-9800G graphic scientific calculator for graphing and analysis. Transferring Data to the CFX-9850G The following explanations all apply to transferring data from the data analyzer to the CFX-9850G only. To use the “Receive(” command to fetch data 1. Connect the data analyzer to the CFX-9850G. 2.
Chapter 3: Commands and Programming P.34 • Note that the data transferred by a Receive(List) command execution is somewhat different when statistical post-processed data is involved. See “Using Receive(List) to Fetch Statistical Post-Processed Data”. The following are detailed explanations of how the Receive( command works with each type of parameter that can be specified with it. Receive(Variable) This format assigns received data to a variable.
Chapter 3: Commands and Programming Sample Operation Using Receive(List) The following program fetches sampled data items and assigns them to CFX9850G list variables. Receive(List 1) Fetches up to 255 data items from the lowest numbered channel*, and stores them in List 1. Receive(List 2) Fetches up to 255 data items starting from the next active channel, and stores them in List 2.
Chapter 3: Commands and Programming with the first derivative calculated for CH1 sample data, and the second derivative calculated for the SONIC channel. P.52 P.37 P.52 DATA RANGE SETUP parameters (Command 5) can be used to specify the data groups and data range to be transferred to the CFX-9850G. This command comes in handy when you want to fetch only specific data items, or when there are more than 255 data items in data analyzer memory.
Chapter 3: Commands and Programming Two Receive(List) cycles are required in this example because there are more than 255 samples. Following the first two Receive(List) commands, a single Send(List) is necessary to verify the data fetches from the SONIC channel. The next Send(List) command specifies the data range of Receive(List4) and Receive(List5). The following shows how data is stored in the different lists after execution of this program is complete. List 1 .... CH1 data samples (1 to 255) List 4 ....
Chapter 3: Commands and Programming Using Receive( to Fetch Time Data P.45 Either relative or absolute time data recording can be specified with the time recording parameter of the SAMPLE AND TRIGGER SETUP (Command 3). Specifying 1 (absolute time on) or 2 (relative time on) records time data in seconds whenever data is being sampled. Let’s say, for example that we want to sample temperature data with only CH1 is active, and the time recording parameter set to 1 (absolute time on).
Chapter 3: Commands and Programming Example CFX-9800G Operation Following Data Transfer 1. Enter the REG Mode. 2. Press [SHIFT] [SETUP] to enter the Setup Mode, and then set the following parameters. S-data: STO S-graph: DRAW 3. Use [Range] to specify the graph screen range (window) in accordance with the sampled data. 4. Use the following key sequence to clear any existing statistical data: [SHIFT] [CLR] [F2] (Scl) [EXE]. 5. Press [F6] (CAL) to recalculate the statistical data and plot the data. 6.
Chapter 3: Commands and Programming Command 1 - CHANNEL SETUP Command 1 specifies various parameters for a channel where a probe is connected. Executing Command 1 clears all sampled data currently stored in data analyzer memory. Clears all previously stored data and returns all channels to their initial defaults. Syntax {1, Channel, Operation, Post-processing, Stat Samples, Trigger Threshold, Trigger Edge} The following syntax is used for DIG OUT: {1, 6, Number of Data Elements, Data Elements} P.
Chapter 3: Commands and Programming 1 Auto-ID If Auto-ID is not activated, voltage in the range 0 to 5V is used. 2 Voltage (±10V) 3 Current (±10A) Based on Vin input, 1V = 1A. 4 Resistance (1kΩ to 100kΩ) 5 Period (0.000004 to 50 seconds) P.68 See “Period and Frequency Measurement” in Appendix A. 6 P.68 Frequency (0.02Hz to 250kHz) See “Period and Frequency Measurement” in Appendix A.
Chapter 3: Commands and Programming Trigger Threshold Parameter This parameter is used when period (5) or frequency (6) is specified as the operation parameter to set the level at which measurement starts. The initial default for this parameter is 1. A value in the range of –10 to +10 can be specified for this parameter to set in input voltage threshold value of –10V to +10V. P.68 • See “Period and Frequency Measurement” in Appendix A.
Chapter 3: Commands and Programming Only the d/dt indicator is on the display when this type of postprocessing is selected. 2 d/dt and d2/dt2 (first derivative and second derivative) The d/dt and d 2/dt2 indicators are on the display when this type 3 Statistics (mean, standard deviation, minimum, maximum) of post-processing is selected. Derivative and statistical post-processing are performed using values produced by conversion equations.
Chapter 3: Commands and Programming Channel 6 (DIG OUT) The following parameter settings apply only when Channel 6 (DIG OUT) is specified by the Command 1 channel parameter. Number of Data Elements Parameter This parameter applies to digital output only. It specifies the number of data elements included in a list. The initial default for this parameter is 1. 0 Clears the digital output channel. 1 to 22 Number of output data elements See “Channel Clear” for details.
Chapter 3: Commands and Programming Stat Point Raw Data 1 2 Post-processing Result x x σn 1.0, 1.2, 1.1, 1.3 1.15 0.11 1.0 1.3 2.3, 4.0, 2.6, 3.2 3.03 0.65 2.3 4.0 3 3.5, 2.6, 3.7, 4.8 3.65 0.78 2.6 4.8 4 3.7, 4.2, 4.5, 5.2 4.4 0.54 3.7 5.2 5 4.8, 5.6, 4.3, 5.4 5.03 0.51 4.3 5.6 minX maxX ↓ ↓ ↓ ↓ ↓ Cleared List1 List2 List3 List4 To CFX-9850G Channel Setting Example The following two examples are for analog channels.
Chapter 3: Commands and Programming Command 2 - DATA TYPE AND DISPLAY SETUP Command 2 specifies the data type for data sent to a connected graphic scientific calculator. It is also used to specify whether or not channel data should be displayed during sampling. Syntax {2, Data Display CH, Data Type, REG X Data, REG Y Data, X-Data PostProcessing, Y-Data Post-Processing} Data Display CH Parameter P.
Chapter 3: Commands and Programming Data Type 1 (REG) The following are the parameter settings when the data type parameter setting is 1: REG X data, REG Y data, X-data post-processing, Y-data postprocessing. REG X Data Parameter This parameter specifies which channel should be assigned as REG X data. The initial default for this parameter is 0.
Chapter 3: Commands and Programming 1 2 d/dt (first derivative) d2/dt2 (second derivative) • Whenever 1 (first derivative) or 2 (second derivative) is specified for this parameter, you must also use Command 1 to specify the same setting for post-processing.
Chapter 3: Commands and Programming Sample Time Parameter This parameter specifies how long sampling should be performed in seconds. Setting 0.001 for this parameter specifies that sampling should be performed for 1 millisecond. The initial default for this parameter is 0.5. 0.001 to 16000 Number of seconds • Set the sample time to 0.5 whenever an external clock is specified as the clock source.
Chapter 3: Commands and Programming Time Recording Parameter This parameter specifies whether time recording during sampling should be performed using absolute time or relative time. The initial default for this parameter is 0. 0 Off Time recording is not performed. 1 Absolute time recording Actual time is recorded in seconds when sampling starts. 2 Relative time recording The time between samples is recorded.
Chapter 3: Commands and Programming Trigger Threshold Parameter This parameter specifies the trigger level when any external trigger (any trigger other than manual triggering with the [TRIGGER] key) is specified for the trigger source parameter. The initial default for this parameter is 1. The trigger threshold setting range depends on the source specified by the trigger source parameter, as shown below.
Chapter 3: Commands and Programming • Whenever 5 (period) or 6 (frequency) is specified for the operation parameter of Command 1 and 2 (CH1), 3 (CH2), or 4 (CH3) is specified for the clock source parameter of Command 3, the setting for the clock source parameter channel specified in by Command 3 must match the channel parameter of Command 1. In this case, clock level and clock edge parameter settings made with Command 1 take priority over clock level and clock edge settings made with Command 3.
Chapter 3: Commands and Programming 0 No filtering 1 5-point S-G smoothing 2 9-point S-G smoothing 3 17-point S-G smoothing 4 25-point S-G smoothing 5 3-point median filtering 6 5-point median filtering • No filtering is performed when the number of samples parameter of Command 3 is –1 (real-time sampling). SAMPLING/TRIGGER SETUP Example {3,0.2,50} 3 = SAMPLING/TRIGGER SETUP 0.2 = Sampling every 0.2 second 50 = 50 samples Initial defaults are used for triggering and other parameters. {3, 0.
Chapter 3: Commands and Programming * Even if 0 is specified for this parameter, the conversion equation function remains enabled if the EQ indicator is on the display. Equation Type Parameter This parameter specifies the type of equation to be used for conversion. The initial default for this parameter is 1. P.66 0 Clears equation selected by the equation number parameter.
Chapter 3: Commands and Programming CONVERSION EQUATION SETUP Examples {4,1,1,0,0,12,34} 4 = CONVERSION EQUATION SETUP 1 = Conversion equation 1 1 = Polynomial 0 = No display of units 0 = Constant K o 12 = Constant K1 34 = Constant K2 {4,2,3,2,2,5} 4 = CONVERSION EQUATION SETUP 2 = Conversion equation 2 3 = Power 2 = Units display (°C) 2 = Constant K o 5 = Constant K1 Command 5 - DATA RANGE SETUP Command 5 specifies the channel number and whether sampled data or post-processed data should be transferred
Chapter 3: Commands and Programming 0 Raw data Filtered data is returned when data filtering is turned on with the filter parameter of Command 3. 1 d/dt Filtered data when data filtering is on. 2 d2/dt2 Filtered data when data filtering is on. 3 Raw data Filter setting is ignored. 4 d/dt Filter setting is ignored. 5 d2/dt2 Filter setting is ignored.
Chapter 3: Commands and Programming DATA RANGE SETUP Examples {5,1,2} 5 = DATA RANGE SETUP 1 = Transfer data from CH1 2 = Filtered d 2/dt 2 data (when filtering is turned on with Command 1) {5,2,0,256,300} 5 = DATA RANGE SETUP 2 = Transfer data from CH2 0 = Filtered raw data (when filtering is turned on with Command 1) 256 = Starting sample number 300 = Ending sample number Command 6 - MULTIMETER MODE SETUP Command 6 specifies a channel for multimetering.
Chapter 3: Commands and Programming 4 Channel 4 (SONIC) 5 DIG IN channel Operation Parameter This parameter specifies the sampling unit for the Multimeter Mode. The following are the available operation parameter settings whenever Channel 1 (CH1), Channel 2 (CH2), or Channel 3 (CH3) is specified by the channel select parameter. 1 Auto-ID If Auto-ID is not activated, voltage in the range 0 to 5V is used. 2 Voltage (±10V) 3 Current (±10A) 4 Resistance value (1kΩ to 100kΩ) 5 Period (0.
Chapter 3: Commands and Programming Command 7 - REQUEST STATUS Command 7 creates data analyzer status data, which can be sent to a connected CFX-9850G. Syntax {7} Request Status This command creates a list that shows the system status and settings of the data analyzer. The following items are included within the list. • Device code: 1 (device code identifier) • Last error code: 0 = no errors An error causes a 3-digit error code to appear on the display.
Chapter 3: Commands and Programming Command 9 - PROBE CALIBRATE Command 9 tells calibrates probe sampling values and is used to calibrate sampling levels when a high level of accuracy is required or when multiple probes are being used. Calibration is approximated using a linear equation and quadratic equation, with coefficients specified using this command’s coefficient parameter.
Chapter 3: Commands and Programming Coefficient Parameter This parameter specifies the coefficients of the calibration equation being used. Two coefficients (a, b) are specified for the linear equation (ax + b), while three coefficients (a, b, c) are specified for a quadratic equation (ax2 + bx + c). CALIBRATE PROBE Examples Example 1: Calibrating the light probe to a reference value The light probe can perform sampling at a distance of one to four meters from a light source.
Chapter 3: Commands and Programming Example 2: Calibrating multiple probe levels The following example produces calibration values for use with temperature probes connected to two different data analyzers. Three calibration points are used. {1,0}→List 6↵ Send(List 6)↵ {1,1,1}→List 6↵ Send(List 6)↵ {1,2,1}→List 6↵ Send(List 6)↵ Specifies that the reference temperature probe is connected to CH1. Specifies that the temperature probe being calibrated to the reference probe is connected to CH2.
Chapter 3: Commands and Programming Example 3: Improving probe accuracy The following example produces calibration values for improving the accuracy of sampling using a light probe. • When performing calibration to improve accuracy, it is necessary to first produce reference values using a high-accuracy measuring instrument.