PICO PT-104 Manual

Programmer's Guide
usbpt104pg r8
USB/Ethernet PRT Data Logger
PT-104


IUSB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
Contents
1 Introduction ......................................................................................................................... 1
1 Overview ................................................................................................................................................. 1
2 Legal information ................................................................................................................................... 1
3 Trademarks ............................................................................................................................................ 2
2 Driver information ............................................................................................................... 3
3 API functions ...................................................................................................................... 4
1 UsbPt104CloseUnit ................................................................................................................................ 5
2 UsbPt104Enumerate .............................................................................................................................. 6
3 UsbPt104GetUnitInfo ............................................................................................................................. 7
4 UsbPt104GetValue ................................................................................................................................. 8
5 UsbPt104IpDetails ................................................................................................................................. 9
6 UsbPt104OpenUnit .............................................................................................................................. 10
7 UsbPt104OpenUnitViaIp ...................................................................................................................... 11
8 UsbPt104SetChannel ........................................................................................................................... 12
9 UsbPt104SetMains .............................................................................................................................. 13
4 Constants and enumerated types ................................................................................... 14
5 Ethernet protocol .............................................................................................................. 15
1 Enabling the Ethernet module ............................................................................................................. 15
2 Finding Ethernet PT-104s .................................................................................................................... 15
1 Commands ............................................................................................................................... 15
3 Unlocked unit response ....................................................................................................................... 16
4 Locked unit responses ......................................................................................................................... 16
5 To calculate a resistance ..................................................................................................................... 17
6 Technical reference .......................................................................................................... 18
Index ..................................................................................................................................... 23


USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 1
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
1 Introduction
1.1 Overview
The PT-104 is a four-channel, high-resolution data logger for use with
PT100 and PT1000 type platinum resistance thermometer (PRT) sensors.
As well as temperature, it can also be used to measure resistance and
voltage.
Additional information
For instructions on connecting and using the device, and setting it up with
the PicoLog software, please see the PT-104 Data Logger User's Guide
available on www.picotech.com.
1.2 Legal information
The material contained in this release is licensed, not sold. Pico Technology grants a license to the person
who installs this software, subject to the conditions listed below.
Access. The licensee agrees to allow access to this software only to persons who have been informed of
these conditions and agree to abide by them.
Usage. The software in this release is for use only with Pico products or with data collected using Pico
products.
Copyright. Pico Technology Limited claims the copyright of, and retains the rights to, all material (software,
documents etc.) contained in this release. You may copy and distribute the entire release in its original state,
but must not copy individual items within the release other than for backup purposes.
Liability. Pico Technology and its agents shall not be liable for any loss, damage or injury, howsoever
caused, related to the use of Pico Technology equipment or software, unless excluded by statute.
Fitness for purpose. No two applications are the same: Pico Technology cannot guarantee that its
equipment or software is suitable for a given application. It is your responsibility, therefore, to ensure that
the product is suitable for your application.
Mission-critical applications. This software is intended for use on a computer that may be running other
software products. For this reason, one of the conditions of the license is that it excludes usage in mission-
critical applications, for example life support systems.
Viruses. This software was continuously monitored for viruses during production. However, you are
responsible for virus-checking the software once it is installed.
Support. If you are dissatisfied with the performance of this software, please contact our technical support
staff, who will try to fix the problem within a reasonable time. If you are still dissatisfied, please return the
product and software to your supplier within 14 days of purchase for a full refund.
Upgrades. We provide upgrades, free of charge, from our web site at www.picotech.com. We reserve the
right to charge for updates or replacements sent out on physical media.

Introduction2
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
1.3 Trademarks
Pico Technology, and PicoLog are trademarks of Pico Technology Limited, registered in the United Kingdom
and other countries.
PicoLog and Pico Technology are registered in the U.S. Patent and Trademark Office.
Windows is a registered trademark of Microsoft Corporation in the USA and other countries.

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 3
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
2Driver information
The USB PT-104 driver is available in 32-bit and 64-bit versions of the PicoSDK from www.picotech.com.
Example code is available from repositories under the "picotech" organization in GitHub.
The driver is supplied as a Windows DLL, usbpt104.dll, which can be used with many programming
languages.

API functions4
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
3API functions
These are the API functions provided by the driver:
UsbPt104CloseUnit
Close the port (do this each time you finish using the device!)
UsbPt104Enumerate
Get list of attached devices.
UsbPt104GetUnitInfo
Retrieve information about this PT-104.
UsbPt104GetValue
Get the most recent data reading from a channel.
UsbPt104IpDetails
Read or write IP settings.
UsbPt104OpenUnit
Open the device through its USB interface.
UsbPt104OpenUnitViaIp
Open the device through its Ethernet interface.
UsbPt104SetChannel
Specify the sensor type and filtering for a channel.
UsbPt104SetMains
Change the mains noise filtering setting to 60 Hz. The default is 50 Hz.
The normal calling sequence for these functions is as follows:
Load driver
Open unit
Set channels
While you want to read data
Get data
End while
Close unit
Unload driver*
* Happens automatically when application is terminated.

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 5
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
3.1 UsbPt104CloseUnit
PICO_STATUS UsbPt104CloseUnit (
int16_t handle
)
This function disconnects the driver from the device.
Arguments:
handle, identifies the device to close
Returns:
defined in PicoStatus.h

API functions6
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
3.2 UsbPt104Enumerate
PICO_STATUS UsbPt104Enumerate (
int8_t * details,
uint32_t * length,
COMMUNICATION_TYPE type
)
This function returns a list of all the attached PT-104 devices of the specified port type.
Arguments:
details, a string buffer to receive a maximum of length characters. The string is a
comma-separated list of attached devices of the selected type. The buffer must be
long enough to accommodate the expected string.
USB devices are listed in this format:
USB:Serial Number
Example: USB:CT264/118
Ethernet devices are listed in this format:
IP:Serial Number[IP Address:port]
Example: IP:CT264/118[192.168.1.253:6500]
length,
input:
the length of the details buffer
output:
the length of the information string returned
type, the communication type used by the PT-104. Can be any of the following
enumerated types:
CT_USB = 0x00000001 (lists only USB-connected devices)
CT_ETHERNET = 0x00000002 (lists only Ethernet-connected devices)
CT_ALL = 0xFFFFFFFF (lists all devices regardless of connection type)
Returns:
defined in PicoStatus.h

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 7
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
3.3 UsbPt104GetUnitInfo
PICO_STATUS UsbPt104GetUnitInfo (
int16_t handle,
int8_t * string,
int16_t stringLength,
int16_t * requiredSize,
PICO_INFO info
)
This function obtains information on a specified device.
Arguments:
handle, identifies the device whose information is required
string, output: the information requested
stringLength, input: the length of the string buffer
requiredSize, output: the length of the information string requested. If this is longer than
stringLength then only the first stringLength characters of the requested
information are written to string.
info, the type of information required. The following types are defined in
PicoStatus.h:
PICO_DRIVER_VERSION
PICO_USB_VERSION
PICO_HARDWARE_VERSION
PICO_VARIANT_INFO
PICO_BATCH_AND_SERIAL
PICO_CAL_DATE
PICO_KERNEL_DRIVER_VERSION
PICO_MAC_ADDRESS
Returns:
defined in PicoStatus.h

API functions8
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
3.4 UsbPt104GetValue
PICO_STATUS UsbPt104GetValue (
int16_t handle,
USBPT104_CHANNELS channel,
int32_t * value,
int16_t filtered
)
Once you open the driver and define some channels, the driver begins to take continuous readings from the
PT-104. When you call this function, it immediately sets data to the most recent reading for the specified
channel.
The scaling of measurements is as follows:
Range
Scaling
Temperature
value × 1/1000 °C
Voltage (0 to 2.5 V)
value × 10 nV
Voltage (0 to 115 mV)
value × 1 nV
Resistance (0 to 375
W
)
value × 1 µ
W
Resistance (0 to 10 k
W
)
value × 1 m
W
Arguments:
handle, identifies the device from which to get data
channel, the number of the channel to read, from 1 to 4 in differential mode or 1 to 8
in single-ended mode
value, output: the requested reading
filtered, if set to TRUE, the driver returns a low-pass filtered value of the temperature.
The time constant of the filter depends on the channel parameters as set by
UsbPt104SetChannel, and on how many channels are active.
Returns:
defined in PicoStatus.h

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 9
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
3.5 UsbPt104IpDetails
PICO_STATUS UsbPt104IpDetails (
int16_t handle,
int16_t * enabled,
int8_t * ipaddress,
uint16_t * length,
uint16_t * listeningPort,
IP_DETAILS_TYPE type
)
This function either reads or writes the IP details of a specified device. The type argument controls
whether the operation is a read or a write.
Arguments:
handle, identifies the device that is the target of the operation
enabled, input: 1 to enable the device, 0 to disable
output: 1 if the device is enabled, 0 if disabled
ipaddress, input or output: the IP address of the device
Example: 192.168.1.253
length, input or output: the length of the IP address string
listeningPort, input or output: the local IP port connected to the device
type, the type of operation to be performed. Can be either of the following types:
IDT_GET, to read information from the driver
IDT_SET, to write information to the driver
Returns:
defined in PicoStatus.h

API functions10
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
3.6 UsbPt104OpenUnit
PICO_STATUS UsbPt104OpenUnit (
int16_t * handle,
int8_t * serial
)
This function obtains a handle for the PT-104 device with the given serial number.
If you wish to use more than one PT-104, you must call the function once for each device.
Arguments:
handle, output: handle of the device that was opened. This value is used to identify the
device in all further function calls.
serial, input: serial number string of device, null-terminated
Returns:
defined in PicoStatus.h

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 11
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
3.7 UsbPt104OpenUnitViaIp
PICO_STATUS UsbPt104OpenUnitViaIp (
int16_t * handle,
int8_t * serial,
int8_t * ipAddress
)
This function obtains a handle for the Ethernet-connected PT-104 device, identified by either its IP address
or its serial number.
·
Using IP address identification, a device anywhere on the internet or local network can be opened.
·
Using serial number identification, only a device on the local network can be opened.
If you wish to use more than one PT-104, you must call the function once for each device.
To control the device directly through the Ethernet port without using the usbpt104 DLL, see Ethernet
protocol.
Arguments:
handle, output: handle of the device that was opened. This value is used to identify the
device in all further function calls.
serial, input: serial number of device as a null-terminated string, or a null pointer if
ipAddress is used
ipAddress, input: the IP address of the device as a null-terminated string, or a null
pointer if serial is used
Example: for IP address 192.168.1.253 and listening port 6500, use the string:
192.168.1.253:6500
Returns:
defined in PicoStatus.h

API functions12
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
3.8 UsbPt104SetChannel
PICO_STATUS UsbPt104SetChannel (
int16_t handle,
USBPT104_CHANNELS channel,
USBPT104_DATA_TYPES type,
int16_t noOfWires
)
This function configures a single channel of the specified PT-104. It can be called any time after calling
UsbPt104OpenUnit.
The fewer channels selected, the more frequently they will be updated. Measurement takes about 720 ms
per active channel.
If a call to UsbPt104SetChannel has a type of single-ended, then the specified channel's 'sister' channel
is also enabled. For example, enabling 3 also enables 7.
Arguments:
handle, identifies the device to be configured
channel, which channel you want to set the details for. It should be between 1 and 4 if
using single-ended inputs in voltage mode.
type, the type of reading you require. Choose from the table below.
noOfWires, how many wires the PT100 or PT1000 sensor has (2, 3 or 4)
Returns:
defined in PicoStatus.h
USBPT104_DATA_TYPES
Data type
USBPT104_OFF
0
disable channel
USBPT104_PT100
1
PT100
USBPT104_PT1000
2
PT1000
USBPT104_RESISTANCE_TO_375R
3
resistance 0 to 375 Ω
USBPT104_RESISTANCE_TO_10K
4
resistance 0 to 10 kΩ
USBPT104_DIFFERENTIAL_TO_115MV
5
differential voltage 0 to 115 mV
USBPT104_DIFFERENTIAL_TO_2500MV
6
differential voltage 0 to 2.5 V
USBPT104_SINGLE_ENDED_TO_115MV
7
single-ended voltage 0 to 115 mV
USBPT104_SINGLE_ENDED_TO_2500MV
8
single-ended voltage 0 to 2.5 V

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 13
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
3.9 UsbPt104SetMains
PICO_STATUS UsbPt104SetMains (
int16_t handle,
uint16_t sixty_hertz
)
This function is used to inform the driver of the local mains (line) frequency. This helps the driver to filter out
electrical noise.
Arguments:
handle, identifies the device to be configured
sixty_hertz, for 50 Hz set to 0; for 60 Hz set to 1
Returns:
defined in PicoStatus.h

Constants and enumerated types14
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
4Constants and enumerated types
#define USBPT104_MIN_WIRES 2
#define USBPT104_MAX_WIRES 4
typedef enum enUsbPt104Channels
{
USBPT104_CHANNEL_1 =1,
USBPT104_CHANNEL_2,
USBPT104_CHANNEL_3,
USBPT104_CHANNEL_4,
USBPT104_CHANNEL_5,
USBPT104_CHANNEL_6,
USBPT104_CHANNEL_7,
USBPT104_CHANNEL_8,
USBPT104_MAX_CHANNELS =USBPT104_CHANNEL_8
}USBPT104_CHANNELS;
typedef enum enUsbPt104DataType
{
USBPT104_OFF,
USBPT104_PT100,
USBPT104_PT1000,
USBPT104_RESISTANCE_TO_375R,
USBPT104_RESISTANCE_TO_10K,
USBPT104_DIFFERENTIAL_TO_115MV,
USBPT104_DIFFERENTIAL_TO_2500MV,
USBPT104_SINGLE_ENDED_TO_115MV,
USBPT104_SINGLE_ENDED_TO_2500MV,
USBPT104_MAX_DATA_TYPES
}USBPT104_DATA_TYPES;
typedef enum enIpDetailsType
{
IDT_GET,
IDT_SET,
}IP_DETAILS_TYPE;
typedef enum enCommunicationType
{
CT_USB =0x00000001,
CT_ETHERNET =0x00000002,
CT_ALL =0xFFFFFFFF
}COMMUNICATION_TYPE;

USB PT-104 USB/Ethernet RTD Data Logger Programmer's Guide 15
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved. usbpt104pg r8
5Ethernet protocol
Using the protocol described below, the PT-104 can be controlled directly through the Ethernet port without
using the usbpt104 DLL.
5.1 Enabling the Ethernet module
By default the Ethernet module is disabled to save power. To enable it, plug the connector into a USB port
and use the Ethernet settings application installed with PicoLog. Once an IP address and port are assigned,
the module will be enabled. The unit may then be used by powering from USB or PoE.
5.2 Finding Ethernet PT-104s
To discover all PT-104 data loggers on a network:
·
Send a UDP packet to port 23 from port 23 (telnet) to destination 255.255.255.255 with this character
string:
fff
(three bytes of 0x66 - that is, 0x666666)
·
All PT-104s will reply from port 23 to port 23. The data will be the string:
PT104 Mac:XXXXXX Lock:Y Port:ZZ
where:
XXXXXX is the 6-byte MAC address of the PT-104 replying
Yis 0x00 for unlocked and 0x01 for locked
ZZ is the port it will listen on (two bytes, MSB first).
5.2.1 Commands
To lock a PT-104 to a machine, send a UDP packet containing the data string lock destined for the device's
listening port and IP address. This is required before the PT-104 is usable.
UDP packet data in the form Command + Data bytes:

Ethernet protocol16
Copyright © 2010–2017 Pico Technology Ltd. All rights reserved.usbpt104pg r8
Command
Data bytes
Function
0x30
0x00 for 50 Hz
Any other byte for 60 Hz
Change mains frequency rejection
0x31
One byte, bit 0 is LSB
Bit 0: enable channel 1
Bit 1: enable channel 2
Bit 2: enable channel 3
Bit 3: enable channel 4
Bit 4: channel 1 gain
Bit 5: channel 2 gain
Bit 6: channel 3 gain
Bit 7: channel 4 gain
Start converting
enable:
0 - off
1 - on
gain:
0 - x1
1 - x21 (for 375 Ω range)
0x32
-
Read EPROM
0x33
-
Unlock
0x34
-
Keep alive
Unlock / timeout stops the transfer of any channel data. Use Unlock when the application no longer requires
the unit so that it is unlocked for use with other machines.
5.3 Unlocked unit response
The response from an unlocked unit is described in Finding Ethernet PT-104s.
5.4 Locked unit responses
·
Lock Success
·
Lock Success (already locked to this machine)
·
Unlocked
·
The string EEPROM= followed by a byte[128] array (see table below)
·
Converting
·
Mains Changed
·
Unknown Command
·
Alive
·
[hex] 00 XX XX XX XX 01 XX XX XX XX 02 XX XX XX XX 03 XX XX XX XX
data from channel 1
where XX is a byte of the 4-byte measurement value, most-significant byte first.
The 4-byte values are measurements 0, 1, 2 and 3.
·
[hex] 04 XX XX XX XX 05 XX XX XX XX 06 XX XX XX XX 07 XX XX XX XX
data from channel 2
·
[hex] 08 XX XX XX XX 09 XX XX XX XX 0a XX XX XX XX 0b XX XX XX XX
data from channel 3
·
[hex] 0c XX XX XX XX 0d XX XX XX XX 0e XX XX XX XX 0f XX XX XX XX
data from channel 4
A unit that has been locked will reply Lock Success or, if currently locked by this machine, Lock
Success (already locked to this machine).
Converting is an acknowledgment of any convert request received. Once a setting has been made the unit
will continue to convert and send back data. This means there will be incoming data approximately every
720 ms. To stop all converting, send a converting command with data 0x00 to turn off all channels.
Other manuals for PT-104
2
Table of contents
Other PICO Other manuals
Popular Other manuals by other brands

Schatten Design
Schatten Design Dualie Inside’R installation instructions

brennenstuhl
brennenstuhl SOL 2x4 Instructions for installation and use

Calix
Calix M147 Assembly instructions

Future Motion
Future Motion ONEWHEEL+ owner's manual

Sony
Sony MDS-MX101 Service manual

wellbots
wellbots FREEFLY VR instruction manual