I'm writting custom program for TC-08 (USB), using Delphi, and I found your example quite helpful. Unfortunately I can't figure out how to get device serial number using Delphi. Using PicoLog recorder software I found serial to be GJY02/154, but how can I get this info in my program.
This information is essential for my application, since I need two TC-08 devices working at the same time, and I need to distinguish them in my program.
Here is what I tried (though unsuccessfuly):
_______________________________________________
1) From C header I've seen following function which appeared to me that it might be the right one, so I translated it into delphi (usbtc08.h)
- Code: Select all
/* Structures *****************************************************/
typedef struct tUSBTC08Info
{
short size;
short DriverVersion;
short PicoppVersion;
short HardwareVersion;
short Variant;
char szSerial[USBTC08_MAX_SERIAL_CHARS];
char szCalDate[USBTC08_MAX_DATE_CHARS];
} USBTC08_INFO, *LPUSBTC08_INFO;
/*====================================================================
PREF0 PREF1 short PREF2 PREF3(usb_tc08_get_unit_info) (short handle, USBTC08_INFO * info);
Delphi version of the above function (my translation):
- Code: Select all
type
TUSBTC08_INFO = record
size: smallint;
DriverVersion: smallint;
PicoppVersion: smallint;
HardwareVersion: smallint;
Variant: smallint;
szSerial: Array[0..11] of Char;
szCalDate: Array[0..9] of Char;
end;
PUSBTC08_INFO = ^TUSBTC08_INFO;
function usb_tc08_get_unit_info (handle: smallint; info: PUSBTC08_INFO):smallint; stdcall; external 'usbtc08.dll';
This approach gave me some unreadable values for szSerial and szCalDate properties. Actually these unreadable values are same before and after calling specified function, suggesting that specified function does not use specified structure at all.
_______________________________________________
2. Tried to use usb_tc08_get_formatted_info(), but without success.
_______________________________________________
3. Tried to use usb_tc08_get_info(), but version returned is always zero (obviously not correct)
_______________________________________________
Looking forward to any help.
Regards,
Dusan
Cart

