I'd like to download history from an EMF-390 in an automated setup. Is it possible to run it in batch with command line switches? Is the source code available? Stuart
data[0] = 0xAA; data[1] = 0X55; data[2] = (temp >> 8) & 0xFF; //EMF is 16 bits the first 12 MSB are for the integer part of EMF data[3] = temp & 0xFF; // then the 4LSB are for the decimal part. e.g 1.1 ==> 0000000000010001 // EF - bits of float type data[4] = EF[0]; data[5] = EF[1]; data[6] = EF[2]; data[7] = EF[3]; // RF same as EF data = RF[0]; data[9] = RF[1]; data[10] = RF[2]; data[11] = RF[3];
You can specify the number of data to be transmitted with the > command. But most of the commands are fast so you can just delay and wait a little bit.
You can send the first command to get 1000 bytes of data, then receive the data (check if it's 1000), if not then continue receiving. If the data is 1000, then stop. But after sometime, let's say 500ms or 1 second, if the data is still < 1000, then data is maybe corrupted so you can discard the data and repeat the command.