User Data in Kvaser Devices

User Data is 8 bytes of data that can be permanently stored in a Kvaser Device. The User Data is associated with a user number and password, which both are administered by Kvaser and cannot be changed. The password is needed in order to write User Data, reading is not restricted so anyone can read the User Data.

Note
The User Data is stored in a flash memory and the number of write cycles is limited. The ideal application is to write the data once, or a few times. A license key that your software validates would be a typical way of using this feature.

Trying out the concept

The user number "100" and the corresponding password, "upHXy1" (without the quotes) is revealed and freely available in sample code. You are encouraged to try your implementation using this to verify that the User Data concept fits your application. If you decide to use this user number and password for "production use", please remember that the password is known to everyone. Contact sales.nosp@m.@kva.nosp@m.ser.c.nosp@m.om for more information about how to obtain your own user number and password.

Writing user data

To write user data, you use a command line program. Depending on your device, it is filo_setparam_userdata.exe for older devices or hydra_setparam_userdata.exe for newer devices. Please contact suppo.nosp@m.rt@k.nosp@m.vaser.nosp@m..com for more information.

Obtaining your own password

Please contact sales.nosp@m.@kva.nosp@m.ser.c.nosp@m.om for more information about how to obtain your own user number and password.

Reading User Data

The User Data can be read using kvReadDeviceCustomerData().

Note
Anyone can read the user data. The writing is protected by a password but reading is not.

Program to read User Data

/*
** This software is furnished as Redistributable under the Kvaser Software Licence
** https://www.kvaser.com/canlib-webhelp/page_license_and_copyright.html
** Program to read User Data
*/
#include <stdio.h>
#include <windows.h>
#include <canlib.h>
int main(int argc, char **argv)
{
int i;
canHandle hnd;
canStatus stat;
unsigned char buf[8];
if (argc != 2) {
printf("Usage: read_customer_data channel\n");
exit(1);
}
hnd = canOpenChannel(atoi(argv[1]), 0);
if (hnd < 0) {
printf("Cannot open channel %s, error code %d\n", argv[1], hnd);
exit(1);
}
100 /*userNumber*/,
0, /* reserved, MBZ */
buf, sizeof(buf));
if (stat != canOK) {
printf("kvReadDeviceCustomerData returned error code %d\n", stat);
exit(1);
}
printf("User data: ");
for (i=0; i<(signed)sizeof(buf); i++) {
printf("%02x ", buf[i]);
}
printf("\n");
canClose(hnd);
return 0;
}