beautypg.com

Vernier LabPro User Manual

Page 22

background image

Revision Date: 08/02/02

LabPro Technical Manual

22

the active channels, just as it does in the ASCII or calculator mode. For instance, with two channels active,
the following would be returned:


g (sent by host)

Pt1_Ch1_MSB Pt1_Ch1_LSB Pt2_Ch1_MSB Pt2_Ch1_LSB ... PtN_Ch1_MSB PtN_Ch1_LSB Chk

g (sent by host)

Pt1_Ch2_MSB Pt1_Ch2_LSB Pt2_Ch2_MSB Pt2_Ch2_LSB ... PtN_Ch2_MSB PtN_Ch2_LSB Chk


As in the real time mode, each case, the checksum is a single byte computed by exclusive-ORing all bytes
in the line and ones-complementing the result (serial port only, does not apply to USB communications).
After the checksum, transmission stops, i.e., no carriage return, linefeed or other stop character is sent
after the data.

Serial Port Communication Details

The serial port transmits commands and data requests in ASCII. Serial port setup is 38400,N,8,1. LabPro
will return command/response information in ASCII but has the option of returning collected data in either
ASCII or binary.


When communicating over the serial port, a carriage return character follows each command.


Since LabPro may be running from batteries, it may be in a low power state. In that case, if the host is
communicating over the serial port, the first byte will be missed. For safety, if the time since the last
communications is unknown, then the host should send an “s” followed by a carriage return to wake up the
LabPro. If it is not asleep, the “s” will be ignored. As an example, a status request would look like:


s

s{7}


While a setup sequence would look like:


s

s{0}

s{1,1,14}

s{3,.1,-1,0}

USB Communication Details

If the host is connected with USB, each time the program requests data, LabPro will send the data as soon
as the sampling occurs. If the program does not ask for the data often enough, data could be lost. If the
host is a computer connected through the serial port, LabPro automatically sends a continuous stream to
the host. This continues until the host stops data collection or resets the unit.

The LabPro enumerates with VID=08f7 and PID=0x0001.

There is 1 input bulk endpoint and 1 output bulk endpoint.

The USB packet size for bulk transfers is 64 bytes.

Transfers from LabPro to PC are always in multiples of 64 bytes.


The USB connection operates in much the same way as the serial port. It transmits commands and data
requests in ASCII. LabPro will return information in ASCII but has the option of returning collected data
in ASCII or binary. Some differences should be noted due to transport.