beautypg.com

Vernier LabPro User Manual

Page 40

background image

Revision Date: 08/02/02

LabPro Technical Manual

40

Return values: No information is returned.

Example 1: Compensate motion detector for air temperature of 29

°

C.

Computer

Calculator

Note

s{4,11,13,84.2,1}
s{4,11,13,29,2}

:Send({4,11,13,84.2,1})
:Send({4,11,13,29,2})

For

°

Fahrenheit temps.

For

°

Celsius temps.

Example 2: Take 500 samples from Analog Channel 1 at 50,000/s in NRT mode and return the values in
hexadecimal values.
Computer

Calculator

Note

s{0}
s{1,14,1}
s{4,0,-1}
s{3,0.00002,500,0}
g

:Send({4,11,13,84.2,1})
:Send({4,11,13,29,2})

Reset the LabPro.
Enable 0 to +5V range input on Channel 1.
Set data to return in Hex
Start sampling
Get the samples from the LabPro

Example 3: Apply a logarithmic conversion equation to analog channel 2 data.
Computer

Calculator

s{4,2,5,0,1}

:Send({4,2,5,0,1})

Alternate Command 4 Syntaxes:

When the polynomial conversion equation (equtype = 1) is used, the syntax for Command 4 is

{4, channel, 1, N, K0, . . .Kn}

When the mixed polynomial conversion equation (equtype = 2) is used, the syntax for Command 4 is

{4, channel, 2, M, N, Km, Km-1, . . .K0, . . .Kn }

Example 3: Occasionally, data needs to be weighted by a polynomial function such as 4

th

order polynomial

as a crude frequency filter. This example demonstrates applying the polynomial function,
Y = -X^4 + 3.25X^2 – 2.25, to input data from analog channel 1.
Computer

Calculator

s{4,1,1,4,-2.25,0,3.25,0,-1.0}

:Send({4,1,1,4,-2.25,0,3.25,0,-1.0})