I am trying to write serial port software for use with the PT100 protocol and there are a number of unclear instructions in the manual that I need help clearing up.
First, in the EEPROM request the manual states the following:
Byte Size
1 Checksum (byte-wise sum of all the bytes from 3 to 34, + 0xDEAD
3 Calibration version (1 = current)
4 Spare
5 Calibration date (ddmmyy followed by NULL char)
13 Batch number
19 Calibration for channel 1 (resistance * 1E6)
23 Calibration for channel 2
27 Calibration for channel 3
31 Calibration for channel 4
When I do a checksum of bytes 3-34, it does not match BYTE 1 nor does it match BYTE 1 and BYTE 2. Is BYTE 2 not used? Or is it part of the Checksum? How is the 0xDEAD value used? Should I assume that the Calibration values use 4 bytes? And also, my PT100 is returning 35 bytes of data, not 34. What is the last byte used for?
Second, for the Conversion Response, the manual states:
Byte Value
1 bits 0-1: measurement no (0 to 3)
bits 2-3: channel no (0 to 3)
bits 4-7: always zero
2-5 reading data: byte 2 is msb
0x20000000 = 0
0xE0000000 = max
My PT100 returns a response where bits 4-7 of BYTE 1 are definitely not zero. Why does that happen? And, what are those 0 and MAX values used for?
Finally, what data types are all these values stored as? I've been assuming that they are all LONG, since the C++ driver uses long to return data.
Hi and thank you for your post. One of our software engineers has had a look at this and there are a few errors in the protocol section of the help file. He has entered it as a bug report to get the fixed. A copy of the revised protocol is attached.
Here is what he had to say:
"1) The checksum bytes will always 0x55ab.
2) The first of the five byte measurement bytes should be treated as follows:
Measurement no = buffer[0] & 0x03;
Channel no = (buffer[0] >> 2) & 0x03;
buffer[0] >> 4 == 0. This is always the case, I cannot repeat your problem with the non zero bytes.
3) The 0 and the max values are the scaled min and max values. Eg if you are using the 2V5 range, a value of 0x20000000 would be 0V and a value of 0xE000000 would be 2V5. You should never get a value out of this range.
NOTE: The examples in the protocol section of the help file do not take the minimum value into account. Please see the revised protocol examples.
To get a 2V5 measurement you will need to do the following:
4) A longwould be suitable to store the value as it is 4bytes. A short (2 bytes) or a char (1 byte) would not be big enough to store all of the data.
"
These values are obviously not correct. I know the probe is working correctly because I can get an accurate reading from Pico Recorder. And I'm somewhat sure I am reading the bytes off the serial port correctly since the bytes read over serial fit the protocol format.
Is there something in the calculation of the resistance that I am missing? For example, the manual mentions the Min Value and Max Value constants but does not use then in resistance calculations for some reason, despite using them in the volt calculations.
Could someone post some known good values for Channel Calibration and Measurement so I can compare them to what I've been getting on my PT104?
Hello, I'm creating a bench which control temperature and I want to write serial port software for use with the PT100 protocol. unfortunately it is not possible to access to the attachment document "protocol.txt".
Is-it possible to have the protocol which the corrections.
The computer can send the following request to the PT-104
Command Data bytes Function
0x00 - Get Version
0x01 - Read EEPROM
0x02 one byte, bit 0 is LSB Start Converting
bit 0: enable channel 1 0 = off, 1 = on
bit 1: enable channel 2 ditto
bit 2: enable channel 3 ditto
bit 3: enable channel 4 ditto
bit 4: channel 1 gain 0 = x1, 1 = x21
bit 5: channel 2 gain ditto
bit 6: channel 3 gain ditto
bit 7: channel 4 gain ditto
0x03 bit 0: select 50/60 Hz mains 0 = 50Hz, 1 = 60Hz
Responses
At start-up, and on receipt of a version request, the PT-104 sends a version response.
Byte Value
1 xFF
2 xAA
3 x55
4 x68 Product type
5 x10 Version
On receipt of a Start Converting request, the PT-104 starts sending conversion responses - approx one every 180 milliseconds. There are four measurement points for each channel: the PT-104 automatically cycles through each of the measurements for each of the active channels. Each response is as follows:
Byte Value
1 bits 0-1: measurement no. (0 to 3)
bits 2-3: channel no. (0 to 3)
bits 4-7: always zero
2-5 reading data: byte 2 is MSB
0x20000000 = scaled min
0xE0000000 = scaled max, the result will always be in the range 0x20000000 to 0xE0000000 inclusive.
On receipt of a Read EEPROM request, the unit returns 64 bytes of EEPROM data. This data contains the following:
Byte Size
1 Checksum (always 0x55AB)
3 Calibration version (1 = current)
4 Spare
5 Calibration date (ddmmyy followed by NULL char)
13 Batch number
19 Calibration for channel 1 (resistance * 1E6)
23 Calibration for channel 2
27 Calibration for channel 3
31 Calibration for channel 4
Examples
I'm afraid we have no examples for the protocol. Do you really need to drive the device directly? There is a C example for the PT104 using the windows DLL. This API is much more simple to use.
I'm using the windows dll and copy paste the example from the demo. the function pt104_getvalue doesn't give any value or all the time the same (ex 22FF00) that's why I would like to rs232 protocol.