Meter Upload Development

31 posts, 6 contributors

Search the DAFNE Online Forums

 
NiVZ DAFNE Graduate
NHS Grampian
82 posts

Good news and bad news tonight.

Good news is I managed to read all 500 dates, times and BG's from my UltraEasy meter. Bad news is on the second attempt there was a COM read error at record 217 which knocked everything out by 1 character so this means I'll need to add more error checking when receiving messages (either that or I was trying to read too quickly - might try a slight pause first and see if that helps)

NiVZ

Simon Site Administrator
Sheffield Teaching Hospitals
578 posts

I think the best thing to do would be to make entries keyed on the date and time (so that there could only be one for each minute of the day, say). That way we could overwrite/update any duplicate entries to maintain consistency with the database on the meter.

Not sure how COM/Serial ports work so can't advise I'm afraid!

Simon

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hi Simon,

I've got something ready that can read the dates, times and BG from the UltraEasy meter and display them in a window.

I tried to email it to your dafneonline email address but the .exe attachment keeps getting returned (even when zipped)

Any ideas how I can get it to you?

Cheers,

NiVZ

Simon Site Administrator
Sheffield Teaching Hospitals
578 posts

Hi NiVZ,

Great stuff - I've sent you a message with another email to try - not sure why this one is being blocked.

Simon

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hello,

Any Lifescan OneTouch UltraEasy users fancy doing some 'beta' testing?

If so, please reply here or drop me a private message.

At the moment it won't upload, but it will read all the BG data from your meter and display it on the PC screen, but if the reading part works then the uploading should be fairly straight forward (famous last words)

Thanks,

NiVZ

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hello,

Just to say I haven't forgotten about this. I can get the UltraEasy working, but unfortunately it appears there aren't that many people on here that use this meter.

Work on the UltraSmart has stalled. I can get the data from the meter onto the PC and I managed to figure out the date part of the entry, but I'm struggling to convert the computer (hex) numbers to real BG numbers. Some work ok, but really high or really low numbers don't seem to follow the same pattern.

Unfortunately Lifescan give you the technical specification for all meters EXCEPT the UltraSmart. Other people have managed it, so it is do-able. I've even got a C++ program that is supposed to be able to do it, but I'm struggling to understand it. Something about Bitshifting and bitstuffing. Don't suppose Marke or Simon know anything about this?

The UltraSmart would be the best meter to figure out, since it stores BG, Carbs, QI and BI taken. The Optium Xceed also looks fairly straight forward, but it is BG only and I don't have one to test with Surprised(

NiVZ

marke Site Administrator
South East Kent PCT
675 posts

Hi,
Bit shifting, bit stuffing I should coco, for my sins I started life in 'low level' hardware programming before 'maturing' to websites. If you can email mail
us the C++ or the link where you got it I would be glad to take a look. Also any other software you have developed for the Ultra Smart. I have one of these meters so can test it as well. To be honest it would be fun to get my hands dirty with some 'real' code again, instead of all this web stuff :-)
Just email it to the address in the contact at the bottom of each page, I will receive it.

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hi Marke,

The UltraSmart code is a fair bit behind the UltraEasy. What I'll try and do is get it into a state where it connects to the meter and then just dumps the raw hex requests and responses onto the screen. That way more people can have a go at decoding them.

In the meantime, for anyone who fancies a go at some code cracking, here is some code, shamelessly borrowed from someone else's attempt:


std::cout << " glucose level";
int bloodglucoselevel = 0;
bloodglucoselevel = (int) ((unsigned char) buf[6] & 0x03) << 8;
bloodglucoselevel |= (unsigned char)buf[5];
std::cout << " " << bloodglucoselevel << " mg/dL";
if(buf[6] & 0x4) std::cout << " control";
switch(buf[6] >> 4)


I'm afraid I'm struggling to understand the C++ logic operators.


I'm afraid I don't have the details of a low reading I was struggling with (and I'd have to go hypo again to re-create them!). However, two normal readings are:

If buff[5] is hex 'EC' and buff[6]is hex '20' then the BG reading should be 236 (in US format) which is then divided by 18 to give UK format of 13.1

Another reading is buff[5] is hex '95' and buff[6] is '50' then the BG reading should be 149 (in US format) which is then divided by 18 to give UK format of 8.2

Unfortunately, both these examples work if you just convert buff[5] to decimal and divide by 18, ignoring buff[6] altoghether. however, I know for high and low readings this did not work and that the value in buff[6] is significant for these.

Thanks,

NiVZ

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hello,

Just a quick update. With Mark and Simon's help we've now got it readng date/time, BG and comment (before/after meal) from the UltraSmart :-)

It's very rough and ready just now, but at least it's getting the data in a suitable format now. I've also made the program more 'modular' with the hope it will make it easy to add other meters in the future.

NiVZ

NiVZ DAFNE Graduate
NHS Grampian
82 posts

Hello,

It's getting really close now. I have a program that can handle BG readings from UltraEASY and UltraSMART now, and we've started work on the uploading part.

So far I can login, request BG records and create new ones from the website. Theres a little bit more to do, but it's definitely heading in the right direction.

Stay tuned.....

NiVZ