(04-26-2019 03:17 AM)djd328 Wrote: Ah, looking at other posts with cal constant sets, the Y intercept field is surely just BCD encoded. Didn't see that before, simple enough, yes those are trivially interpreted -ve numbers.
Building on the work of fenugrec, here is a simple decoder for 3468, minus the checksum which is different. I have managed to get the first 2 nibbles of that almost disentangled... simple xor sum mostly is correct, but there is a carry or something missing. The second 2 nibbles, not yet. Anyway:
Code:
MacPro$ cat hp3468B/hp3468B.cal.good
@@@@@@@@@@@@OOOOIIIIIGDOEM@EAIFHIIIIIIHODEMNOJEC@@@@@@DODCLBOMEH@@@@@@@OD@BDOBM@@@@@BD@OCKBOIENK@@@@@@@@ANAAO@LC@@@@@@@@ALMEOJMG@@@@@@@@@BKEOCNG@@@@@@@@@ABAOMN@@@@@@@@@@@ELOFOO@@@@@@@@ABNNOLLC@@@@@AF@BM@DNBLO@@@@@@@@@@@@OOOO@@@@@@@@@@@@OOOO@@@@@@@@@@@@@@@
MacPro$
MacPro$ gcc cal.c -o cal ; ./cal < hp3468B/hp3468B.cal.good
RRRR YYYYYYY GGGGG SSSS Offset Gain
0000000 00000 ffff 0000000 1.00000000
0.3v 9999974 f5d05 1968 -0000025 0.99470502
3v 9999998 f45de fa53 -0000001 0.99446803
30v 0000004 f43c2 fd58 0000004 0.99426204
300v 0000000 f4024 f2d0 0000000 0.99402404
acv 0000240 f3b2f 95eb 0000240 0.99251902
300r 0000000 01e11 f0c3 0000000 1.00081098
3kr 0000000 01cd5 fad7 0000000 1.00057507
30kr 0000000 002b5 f3e7 0000000 1.00015509
300k 0000000 00121 fde0 0000000 1.00012100
3M 0000000 0005c f6ff 0000000 1.00004590
30M 0000000 012ee fcc3 0000000 1.00117803
3A 0000016 02d04 e2cf 0000016 1.00170398
And the program itself
Code:
MacPro$ cat cal.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static char *range[] = {
"",
"0.3v", "3v", "30v", "300v",
"acv",
"300r", "3kr", "30kr", "300k", "3M", "30M",
"3A",
"", "" };
static char h[] = "0123456789abcdef";
int
main (int argc, char *argv[])
{
unsigned char cal[256];
int i, j;
signed char o;
float f, s;
read(0, cal, 255);
for (i=0; i<255; i++) cal[i] -= 0x40;
printf("RRRR YYYYYYY GGGGG SSSS Offset Gain\n\n");
for (i=0; i<13; i++) {
printf("%4s ", range[i]);
for (j=0; j<7; j++) printf("%c", h[cal[i*16 + j]]);
printf(" ");
for (j=7; j<12; j++) printf("%c", h[cal[i*16 + j]]);
printf(" ");
for (j=12; j<16; j++) printf("%c", h[cal[i*16 + j]]);
o = 0;
if (cal[i*16] > 3) o = 9;
printf(" %c", o ? '-' : ' ');
for (j=0; j<7; j++) printf("%c", o ? h[o-cal[i*16 + j]] : h[cal[i*16 + j]] );
printf(" ");
f = 1.0;
s = 100.0;
for (j=7; j<12; j++) {
o = cal[i*16 + j];
o = o > 7 ? o - 16 : o;
f += ((float) o ) / s;
s *= 10;
}
printf("%1.8f", f);
printf("\n");
}
}