Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 4 of 9

CBL 2 Technical Reference: Programming the CBL 2, pages 17 to 26

Pages 17 to 26 of 63, from CBL 2 Technical Reference

The original document is the PDF (424 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Texas Instruments CBL2 System

Page 17

Programming the CBL 2 Digital Output Buffer The digital output buffer (DOB) is a circular buffer that contains up to 32 elements. The output from the buffer is 4-bits wide, and the outputs are CMOS (0-5V) compatible. The data in Command 1 is entered as decimal representation of the digital value that is output. For example, 0=0000, 5=0101, and 15=1111. At the beginning of each sample, a pointer into the digital output buffer is incremented and the next available data is sent to the output lines. The electrical characteristics of the digital outputs are: ♦

Voutput-high ‚ 3.7V @ M400uA

♦

Voutput-low 0.65V @ 1.6mA

The number of times that the DOB outputs the contents of the buffer depends on the number of data elements defined in Command 1 and the number of samples defined in Command 3.

Digital Output Buffer Example Command 1 list is {1,31,5,1,2,3,4,5} where:

Command 3 list is {3,1,100} where:

1=Channel Setup.

3=Sample and Trigger Setup.

31=DIG OUT.

1=One second sample time.

5=Five data elements.

100=One hundred samples.

1=0001 (digital nibble).

(Trigger Type defaults to manual triggering.)

2=0010 (digital nibble). 3=0011 (digital nibble). 4=0100 (digital nibble). 5=0101 (digital nibble).

CBL 2 Technical Reference

17

Page 18

The DOB outputs pulses that correspond to the five digital nibbles (1234512345...12345 etc.). This sequence is repeated 20 times (100 samples/5 data elements) to the DIG OUT channel. The diagram below shows a portion of this output for the first five data elements. Sample Clock D3 D2 D1 D0 1

2

3

4

5

1

Figure 1. Digital Output Example

Triggering and Thresholds Two types of triggering thresholds can be set in the CBL 2: ♦

Hardware triggering is set to trigger on a specific voltage level established by the trigger threshold parameter.

♦

Software triggering is set to begin data collection on either the rising edge or falling edge of the signal, depending on the trigger type and trigger threshold selected.

The THRESHOLD parameter specified in Command 3 can be used for two purposes: ♦

If the operation in Command 1 is frequency, period, or count (operation = 5, 6, or 7 on Channel 1 only), then the threshold parameter in Command 3 sets a voltage level in the CBL 2 hardware. The signal on the Vin pin of CH 1 must pass through this voltage for the CBL 2 to see the signal change states.

♦

If the operation in Command 1 is anything other than 5, 6, or 7, then the threshold parameter in Command 3 specifies a trigger level and is measured in the units of the sensor selected.

When triggering, sampling does not start until the signal on the trigger channel (also specified in Command 3) passes through this level once in the direction specified. This comparison of trigger level and signal level occurs in software, so any level in the proper range can be selected. Also, either the Vin or VinLow pin (on any of the analog channels or the sonic channel) can be used as the trigger channel. CBL 2 knows whether to use the Vin or VinLow pin by looking at which operation was set up in Command 1.

18

CBL 2 Technical Reference

Page 19

If a conversion equation is enabled for the trigger channel, then the threshold specified in Command 3 should be a converted level. For example, if a pH probe is plugged into CH 2 with a conversion equation loaded into CBL 2 and the trigger channel specified as CH 2, the threshold level should be entered as a pH level in the range 0-14, not as a voltage in the range 0-5V.

Measuring Period and Frequency Period and frequency apply only to CH1 and only CH1 can be active if the operation is set to 5 (Period) or 6 (Frequency). Period and frequency are measured on Vin pin (pin 1) of CH1. Period and frequency measurements always use the hardware threshold. The CBL 2 measures period and frequency by counting edges for 0.25 seconds, or by measuring the time between the selected edges for one period - whichever is larger (see figure below). If a significant number of edges are counted during the 0.25-second period, the count is used to compute both period and frequency; otherwise, the period and frequency are computed from the time interval for one period. +

+

-

T=

0

1

2

3

Figure 2. Period and Frequency Measurement

Trigger Type

Measuring Points

2 3 4 5

++ (T=0 to 2) N N (T=1 to 3) N + N (T=0 to 1) N N + (T=1 to 2)

The crossover point between the two computations is about 600 Hz. Because there can be a one-count uncertainty during the 0.25-second period, the accuracy around 600 Hz is approximately ±4 Hz (about 0.7%). The resolution of the timer measuring the time between edges is 6.4 microseconds; therefore, the percentage accuracy improves for frequencies above and below 600 Hz. If the CBL 2 is set up using Command 3 to make multiple measurements at a particular sample time, the CBL 2 waits for the sample time that you specified after it completes the current measurement. It then initiates the next cycle of period/frequency measurement. The minimum sampling time for period and frequency is 0.25 seconds. Note: Period and frequency measurements using Trigger Type 4 or 5 are only possible on nonrepetitive signals or on repetitive signals that are less then 600 Hz. This is because at 600 Hz, the edge counts will prevail.

CBL 2 Technical Reference

19

Page 20

The parameters shown in this table are used when measuring period or frequency.

Trigger Type

Edge Polarity Used

Hardware Threshold Used

0

Rising (+)

Trigger Threshold parameter

2–5

Specified by trigger type

Trigger Threshold parameter

6

Not allowed (E.34 error).

Example: Measuring Frequency Assume a frequency measurement is requested on CH 1, and 20 measurements are desired at a .5 second sample time. The following commands would set up the CBL 2 for this example: {1,1,6} {3,.5,20,2,0,1} 3 = Sample and Trigger setup command .5 = Sample time of 0.5 seconds 20 = Number of samples to take 2 = Trigger from rising edge to rising edge for frequency 0 = Trigger channel not applicable 1 = Trigger at 1 Volt Assume a ±10 Volt, 20 Hz sine wave is the input signal on pin 1. The CBL 2 follows the sequence of steps indicated below when the first trigger occurs (a trigger occurs every 0.05 seconds). 1. Trigger occurs on the rising edge. 2. Start counter and timer. 3. Stop timer at next rising edge. 4. Wait until 0.25 seconds has elapsed. 5. Stop counter (count should be about 5). 6. Count is less than 150 (or 600 Hz); therefore, frequency is computed from the time interval for one period. 7. Wait for 0.5 seconds specified in Sample Time. 8. Wait for additional processing time to complete. (This time depends on what processing is currently being performed and is typically about 0.25 additional seconds.) 9. Repeat steps 1 through 8 for nineteen more samples. In this example, the CBL 2 takes approximately 15 seconds to complete all the sampling and turn on the DONE indicator in the display.

20

CBL 2 Technical Reference

Page 21

Asynchronous/ Synchronous Triggering versus Record Time Actual triggering is asynchronous from the internal sampling clock when Trigger Type in Command 3 is set to 1 or 6 (manual triggering). If sampling at very fast rates, the actual trigger may be slightly different from the commanded trigger. The user should take this into account when calculating prestore and trigger levels. The actual sample time for the trigger point depends on whether or not prestore is selected in Command 3. When prestore and relative record time are selected, the sample time for the trigger point will generally not be identical to times around it. The time recorded for the trigger point will be the actual time between the previous sampled point on the internal sampling clock interval and the asynchronous trigger event. The sample taken after the trigger point will be at the specified sample time since the clock is reset each time the trigger event occurs (pressing START/STOP or the hardware threshold trigger event). When Trigger Type is set to 6 (Manual and Sample Trigger) in Command 3, the recorded sample times are the actual relative times when START/STOP is pressed. When no prestore is selected, the first sample time will be the trigger point. Its recorded time will not be the internal sample clock time because the CBL 2 is always sampling on the internal clock interval that you selected and is storing points (if you selected prestore) until the trigger event occurs.

Example Assume the following: ♦

Input to CH1, set to measure ±10 Volts, is a 0.01 Hz sine wave.

♦

Sample Time is set to 10 seconds and Number of Samples is set to collect 30 points.

♦

Trigger Channel is set to 1.

♦

Trigger Threshold is set to 1.0 and Trigger Type is set to 2 (trigger on rising edge).

The CBL 2 will collect and store a sample every 10 seconds. The recorded time for each sample will be 10 seconds. The trigger event (signal rising through 1.0 Volts) occurs 1.5 seconds after the previous sample, so a sample collected at the trigger point is taken and stored with a recorded time of 1.5. The next sample is taken 10 seconds after the trigger sample, not 8.5 seconds later as would have happened if the internal sample clock had not been reset. The Record Time returned (around the trigger point) will be the list: {...10,10,10,1.5,10,10,...}.

CBL 2 Technical Reference

21

Page 22

CBL 2 Command Summary The table below lists the commands you can use in writing programs for CBL 2. Detailed explanations of each command and its syntax can be found beginning on the page number shown in the third column.

Command Number

22

Command Description

See Page

0

Reset: Resets all channels to default conditions.

23

1

Channel Setup: sets up a channel for data collection.

23

2

Data Type: This command is not used and should not be sent. It is included only for compatibility with older CBL programs.

26

3

Trigger Setup: Sets up the trigger parameters for an experiment.

26

4

Conversion Equation Setup (Analog Channels): Sets up parameters to convert physical units measured by CBL 2 into a more useful measurement unit such as Newtons or ¡C.

28

Sonic Temperature Compensation (Sonic Channel): Sets the unit of measurement for sonic data.

30

5

Data Control: Selects the type of data to be retrieved, as well as the starting and ending data points to be retrieved by a TI calculator.

30

6

System Setup: Turns sound on or off; sets an ID number for the CBL 2; selects a filter to be applied to data.

30

7

Request System Status: Generates and prepares to return status information.

31

8

Request Channel Status: Generates and prepares to return sensor type, last valid data, and last valid data position for the requested channel.

32

9

Request Channel Data: Generates and prepares to return one data point before sampling starts. Used to verify that setup is correct.

33

10

Advanced Data Reduction: Sets up CBL 2 to process certain time-intensive algorithms instead of processing them in the calculator.

33

12

Digital Data Capture: Sets up the capture or measurement of motion data from the digital input channel.

34

102

Power Control Command: Sets the power to always on; power-saving; or designated power up.

41

CBL 2 Technical Reference

Page 23

Command Number

Command Description

See Page

115

Check Set-up Information: Returns status information for the designated channel.

41

116

Check Long Sensor Name: Returns long sensor name.

42

117

Check Short Sensor Name: Returns short sensor name.

43

1998

Set LED Command: Turns LEDs on and off on command.

43

1999

Sound Command: Specifies length and frequency of CBL 2 sounds.

43

2001

Direct Output to Digital-Out Port: Outputs data to the digital output port during a sampling run.

43

201

Archive Operations Command: Allows the calculator to determine the contents of the CBL 2’s FLASH memory.

44

Detailed information about each command is given below. The table following each syntax lists valid values. Default values appear in boldface type.

Command 0

Reset CBL 2 RAM

Syntax: {0} This command has no parameters or options. Clears data memory back to power-up state. Clears error information. Resets only the RAM; does not clear FLASH memory. This command should be sent at the beginning of each program.

Command 1

Channel Setup

This command sets up a channel for data collection. It has six syntaxes, as shown below.

Syntax: {1,0} Clears all channels.

Syntax: {1,channel,0} Turns off the selected channel.

Channel 1-3 = Analog 11 = Sonic 21 = Digital Input 31 = Digital Output

CBL 2 Technical Reference

23

Page 24

Syntax: {1,channel,operation,post-processing,(delta) 1,equ} Use this syntax to set up analog channels.

Channel

Operation/ Sensor Type

1-3 = Analog

0 = Turn channel off 1 = Auto-ID this sensor (default is 0-5V sensor) 2 = TI Voltage „10V 3 = Current „10A

Post-Processing

Conversion Equation

0 = None (RT 2 and NON-RT 3)

0 = Off

1 = d/dt (NON-RT)

1 = On (must also send Command 4)

2 = d/dt and d 2/dt 2 (NON-RT)

4 = Resistance 5 4 = Measure period on „10V input line (CH 1 only) 64 = Frequency on „10V input line (CH 1 only) 75 = Count transitions on „10V input line (CH 1 only) 10 = TI Temperature or Stainless Steel Temperature (Centigrade) 11 = TI Temperature or Stainless Steel Temperature (Fahrenheit) 12 = TI Light 14 = Low voltage (0-5V) 1

This parameter is ignored. RT: REALTIME mode sampling. 3 NON-RT: NON-REALTIME mode sampling. 4 When using Command 1 operation 5 or 6, Trigger Type in Command 3 must be 2, 3, 4 or 5. 5 When using Command 1 operation 7, Trigger Type in Command 3 must be 0. 2

24

CBL 2 Technical Reference

Page 25

Syntax: {1,11,operation,post-processing,(delta)1 ,equ} Use this syntax to set up the sonic channel.

Operation

Post-Processing

Conversion Equation

0 = Resets channel

0 = None (RT 2 and NON-RT 3)

0 = Off

1 = Meters – Returns distance and @time (RT and NON-RT) 2 = Meters – Returns distance and @time (RT and NON-RT)

1 = d/dt (NON-RT) 2 = d/dt and d 2/dt 2 (NON-RT)

1 = On (must also send Command 4 for temperature compensation)

3 = Feet – Returns distance and @time (RT and NON-RT) 4 = Meters – Returns distance, velocity, and @time (RT) or distance and @time (NON-RT) 5 = Feet – Returns distance, velocity, and @time (RT) or distance and @time (NON-RT) 6 = Meters – Returns distance, velocity, acceleration, @time (RT) or distance and @time (NON-RT) 7 = Feet – Returns distance, velocity, acceleration, @time (RT) or distance and @time (NON-RT) 1

This parameter is ignored. RT: REALTIME mode sampling. 3 NON-RT: NON-REALTIME mode sampling. 2

Note: When post-processing is enabled in non-realtime sampling mode, all operations will return the first derivative and the second derivative.

Syntax: {1,channel,operation} Use this syntax to set up the digital input channel.

Channel

Operation

21 = Digital Input

0 = Off 1 = On

CBL 2 Technical Reference

25

Page 26

Syntax: {1,channel,operation,list of values} Use this syntax to set up the digital output channel.

Channel

Operation

List of Values

31 = Digital Output

0 = Clears the channel

Lists values output to digital output port

1-32 = Count (number of data elements in list)

Note: the list of values must have one value for each count.

The CBL 2 outputs one element for each sample. Between samples, the output returns to 0 unless the user has commanded the power to remain on (using Command 102, M1). Caution: Using Command 102, M1 can drain the CBL 2 batteries.

Command 2

Data Type

This command is not used and should not be sent. However, it is included for compatibility with older CBL 2 programs.

Command 3

Trigger Setup

This command sets up the trigger parameters for an experiment. It has three syntaxes.

Syntax: {3, .1} Repeats last Command 3 (used to quickly collect new data).

Syntax: {3,samptime,numpoints,0,0,0,0,0,0,filter } Use this syntax for realtime data collection.

Sample Time

Number of Points

Filter

>0 to 16000

.1 = REALTIME mode

0 = None

Default = 0.5

0 = Invalid

7 = Light Realtime tracking filter 8 = Medium Realtime tracking filter 9 = Uses Heavy Realtime tracking filter

26

CBL 2 Technical Reference