PT-104 Data Logger Programmer's Guide usbpt104pg.en-2 Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
USB PT-104 Data Logger Programmer's Guide I Contents 1 Introduction .....................................................................................................................................1 1 Overview ...........................................................................................................................................1 2 Legal information .....................................................................................................................................
USB PT-104 Data Logger Programmer's Guide 1 Introduction 1.1 Overview 1 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: PT-104 Data Logger User's Guide (usbpt104.en.
2 1.2 Introduction Legal information The material contained in this release is licensed, not sold. Pico Technology grants a licence 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.
USB PT-104 Data Logger Programmer's Guide 3 2 Driver information 2.1 Introduction The PT-104 is supplied with driver routines that you can build into your own programs. Once you have installed the software, the Drivers directory contains the drivers and a selection of examples of how to use the drivers. It also contains a copy of this manual as a PDF file. The driver routine is supplied as a Windows DLL.
4 2.3 Driver information UsbPt104CloseUnit PICO_STATUS UsbPt104CloseUnit ( short handle ) This routine disconnects the driver. Arguments: handle, identifies the device to close Returns: defined in picoStatus.h usbpt104pg.en Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
USB PT-104 Data Logger Programmer's Guide 2.4 5 UsbPt104Enumerate PICO_STATUS UsbPt104Enumerate ( char * details, unsigned long * length, COMMUNICATION_TYPE type ) This routine 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 length, input: output: the length of the string buffer the length of the information string returned type, the communication type used by the PT-104.
6 2.5 Driver information UsbPt104GetUnitInfo PICO_STATUS short char short short PICO_INFO ) UsbPt104GetUnitInfo ( handle, * string, stringLength, * requiredSize, info This routine 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.
USB PT-104 Data Logger Programmer's Guide 2.6 7 UsbPt104GetValue PICO_STATUS UsbPt104GetValue ( short handle, USBPT104_CHANNELS channel, long * value, short 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 routine, 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.
8 2.7 Driver information UsbPt104IpDetails PICO_STATUS UsbPt104IpDetails ( short handle, short * enabled, char * ipaddress, unsigned short * length, unsigned short * listeningPort, IP_DETAILS_TYPE type ) This routine either reads or writes the the IP details of a specified device. The type argument controls whether the operation is a read or a write.
USB PT-104 Data Logger Programmer's Guide 2.8 9 UsbPt104OpenUnit PICO_STATUS UsbPt104OpenUnit ( short * handle, char * serial ) This routine 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 routine 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.
10 2.9 Driver information UsbPt104OpenUnitViaIp PICO_STATUS short * char * char * ) UsbPt104OpenUnitViaIp ( handle, serial, ipAddress This routine 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.
USB PT-104 Data Logger Programmer's Guide 2.10 11 UsbPt104SetChannel PICO_STATUS UsbPt104SetChannel ( short handle, USBPT104_CHANNELS channel, USBPT104_DATA_TYPES type, short noOfWires ) This routine 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 1 second per active channel.
12 2.11 Driver information UsbPt104SetMains PICO_STATUS UsbPt104SetMains ( short handle, unsigned short sixty_hertz ) This routine 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: usbpt104pg.en defined in picoStatus.h Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
USB PT-104 Data Logger Programmer's Guide 2.
14 Writing your own programs 3 Writing your own programs 3.1 C The C example is a console mode program that demonstrates the facilities of the driver. To compile the program, create a new project containing the following files from the USB PT-104 SDK: USBPT104con.c and: UsbPt104bc.lib (Borland 32-bit applications) or UsbPt104.lib (Microsoft Visual C 32-bit applications) The following file must be in the compilation directory: UsbPt104Api.
USB PT-104 Data Logger Programmer's Guide 4 Technical reference 4.1 Lookup table 15 Here is the resistance-temperature characteristic for a PT100 sensor. Temp (°C) -50 -49 -48 -47 -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 -32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 Resistance ( ) 80.306282 80.703340 81.100257 81.497036 81.893677 82.290179 82.686545 83.082774 83.478868 83.874827 84.270652 84.666343 85.061901 85.
16 Technical reference 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 usbpt104pg.en 100.390772 100.781429 101.171970 101.562396 101.952706 102.342901 102.732980 103.122944 103.512792 103.902525 104.292142 104.681644 105.071030 105.460301 105.849456 106.238496 106.627420 107.016229 107.404922 107.793500 108.181962 108.570309 108.958540 109.346656 109.734656 110.122541 110.510310 110.
USB PT-104 Data Logger Programmer's Guide 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 17 122.857942 123.241900 123.625742 124.009469 124.393080 124.776576 125.159956 125.543221 125.926370 126.309404 126.692322 127.075125 127.457812 127.840384 128.222840 128.605181 128.987406 129.369516 129.751510 130.133389 130.515152 130.896800 131.278332 131.659749 132.
18 Technical reference 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 usbpt104pg.en 144.936570 145.313829 145.690972 146.068000 146.444912 146.821709 147.198390 147.574956 147.951406 148.327741 148.703960 149.080064 149.456052 149.831925 150.207682 150.583324 150.958850 151.334261 151.709556 152.084736 152.459800 152.
USB PT-104 Data Logger Programmer's Guide 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 19 166.626656 166.997216 167.367660 167.737989 168.108202 168.478300 168.848282 169.218149 169.587900 169.957536 170.327056 170.696461 171.065750 171.434924 171.803982 172.172925 172.541752 172.910464 173.279060 173.647541 174.015906 174.384156 174.752290 175.120309 175.488212 175.856000 Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
USB PT-104 Data Logger Programmer's Guide Index S Serial number B Batch number 6 U 6 USB version C C 21 6 USBPT104_CHANNELS type 14 Calbration date 6 Channel setup 11 Closing a unit 4 COMMUNICATION_TYPE type UsbPt104CloseUnit 13 D 8 UsbPt104OpenUnit 9 UsbPt104OpenUnitViaIp 10 UsbPt104SetChannel 11 6 E UsbPt104SetMains Ethernet port Excel 14 4 UsbPt104Enumerate 5 UsbPt104GetUnitInfo 6 UsbPt104GetValue 7 UsbPt104IpDetails Driver version 13 USBPT104_DATA_TYPES type 13 USBPT104_MAX_WI
USB PT-104 Data Logger Programmer's Guide 23 Copyright © 2010-2011 Pico Technology Ltd. All rights reserved. usbpt104pg.
Pico Technology James House Colmworth Business Park ST. NEOTS Cambridgeshire PE19 8YP United Kingdom Tel: +44 (0) 1480 396 395 Fax: +44 (0) 1480 396 296 www.picotech.com usbpt104pg.en-2 28.7.11 Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.