|
|
| Author |
Message |
dle User

Joined: 10 Jan 2007
Posts: 4
|
Posted: Mon Feb 05, 2007 8:19 pm Post subject: PT104 PT100 Protocol |
|
|
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.
|
|
| Back to top |
|
 |
ziko Site Admin

Joined: 01 Dec 2006
Posts: 667
Location: St Neots
|
Posted: Fri Feb 09, 2007 4:28 pm Post subject: |
|
|
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:
value =(((long) buffer [1] << 24) + ((long) buffer [2] << 16) + ((long) buffer [3] << 8) + (long) buffer [4]);
result = (value - 0x20000000L ) * 2500000) / 0x10000000;
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.
"
Hope this helps.
| Description: |
|
 Download |
| Filename: |
pt104 protocol.txt |
| Filesize: |
3.37 KB |
| Downloaded: |
45 Time(s) |
|
|
| Back to top |
|
 |
dle User

Joined: 10 Jan 2007
Posts: 4
|
Posted: Wed Feb 28, 2007 10:03 pm Post subject: |
|
|
I am still having trouble getting an accurate resistance reading from my PT104. I am reading the following values from the PT104:
Channel Calibration: 2645882117.0
Measurement 1: 536762239.0
Measurement 2: 591613331.0
Measurement 3: 592001185.0
Measurement 4: 651850059.0
Using the equation given in the manual, I get the following:
resistance_x1e6 = 2886925491.3300071
resistance ~= 2886
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?
|
|
| Back to top |
|
 |
ziko Site Admin

Joined: 01 Dec 2006
Posts: 667
Location: St Neots
|
Posted: Tue Mar 13, 2007 10:57 am Post subject: |
|
|
Hi and thank you for your post.
You are reading your bytes in the wrong order!
Hope this helps.
|
|
| Back to top |
|
 |
markB Site Admin

Joined: 27 Mar 2007
Posts: 80
Location: Cambridgeshire,UK
|
Posted: Wed May 02, 2007 2:46 pm Post subject: |
|
|
To correct Ziko, you were reading your calibration bytes in the wrong order, your measurements were correct. Here are your correct values:
Channel Calibration: 99988637
Measurement 1: 536762239
Measurement 2: 591613331
Measurement 3: 592001185
Measurement 4: 651850059
Result 109.0991468
|
|
| Back to top |
|
 |
|