Programming Examples; Example 1: Temperature Non-Realtime Data Collection; Example 2: Temperature Realtime Data Collection; Example 3: Distance And Velocity Non-Realtime Data Collection - Texas Instruments CBL 2 Reference Manual

Ti cbl 2 data collector: reference guide
Hide thumbs Also See for CBL 2:
Table of Contents

Advertisement

Programming Examples

Programs are created on a TI calculator to set up specific CBL 2 operations, depending
on the experiment that you want to perform. Samples of various types of programs
follow. Each program includes both program commands and comments explaining
what the commands do.

Example 1: Temperature Non-Realtime Data Collection

:ClrAllLists
:ClrHome
:Send({0})
:Send({6,4})
:Send({1,1,1})
:Send({3,.1,100,0})
:Get(L
)
2
:Get(L
)
1
:Plot1(Scatter,L
:ZoomStat

Example 2: Temperature Realtime Data Collection

:ClrAllLists
:PlotsOff:Func
:FnOff:AxesOn
:1üXmin:30üXmax:1üXscl
:M20üYmin:60üYmax:.1üYscl
:ClrHome
:Send({0})
:Send({6,4})
:Send({1,3,1})
:30üdim(L
)
2
:Send({3,1,M1,0})
:ClrDraw
:For(I,1,30,1)
:Get(L
(I))
2
:Pt-On(I,L
(I))
2
:End

Example 3: Distance and Velocity Non-Realtime Data Collection

:PlotsOff
:ClrAllLists
:ClrHome
:ClrDraw
:Send({0})
:Send({6,4})
:Send({1,11,1,1})
:Send({3,.1,100,0})
:Get(L
)
2
:Get(L
)
3
:Get(L
)
1
:Plot1(Scatter,L
:Plot2(Scatter,L
:ZoomStat
CBL 2 Technical Reference
Reset CBL 2. (This clears CBL 2 RAM.)
Turn CBL 2 sound on.
Set up Channel 1 for data collection.
Take temperature sample every .1 second.
Retrieve temperature data to L
Retrieve time data to L
,L
,.)
Plot temperature versus time.
1
2
Initalize graphing functions.
Set up the min/max range and scale factors as needed.
Reset CBL 2. (This clears CBL 2 RAM.)
Turn CBL 2 sound on.
Set up Channel 3 for data collection.
Dimension List
Take a sample once every second; re-arm immediately and get next
sample.
Get a sample and plot it on the graph for 30 points.
Reset CBL 2. (This clears CBL 2 RAM.)
Turn CBL 2 sound on.
Set up Channel 11 (Sonic) for data collection (distance and velocity).
Take a sample every .1 second.
Retrieve distance data to L
Retrieve velocity data to L
Retrieve time data to L
,L
,.)
Plot distance versus time.
1
2
,L
,+)
Plot velocity versus time.
1
3
.
2
.
1
.
2
.
3
.
1
49

Advertisement

Table of Contents
loading

Table of Contents