05-29-2015 11:01 PM
Take the 4 bytes and typecast it to a U32. You may have to watch out for endianism, whether the first byte is most significan or least significant. In which case you can swap bytes, or reverse the array., or use Unflatten from string which has an input that allows you to pick the endianism.
02-20-2017 09:43 AM
How did you get on with this in the end? Are you a fellow type 1? I've just started using an xbridge setup and have a spare wixel - googled wixel and labview and found myself here!
Not sure if there's a way to contact users directly through here - if there is, drop me a line! Be interested to hear about your progress on this!
Cheers
Paul
02-20-2017 09:47 AM
Ignore that last message - it was from me, just signed in with the wrong account for some reason! Let me know how you got on with the Wixel!
Cheers
Paul
02-20-2017 11:16 AM
Hi, I did get it working. I'm not type 1, I work for a small startup doing glucose control in the hospital space. Here's some of the code I used, although unfortunately I can't upload the VIs (company policy) I can share the relevant sections:
Wixel Open:
Wixel Read:
Those wait VIs are just this, with milliseconds to wait defaulting to 15ms:
Then, the helper function to split our read buffer into the three relevant quanitites:
And finally Wixel close:
Now there's the matter of actual calibration. The counts are linearly correlated with the actual glucose value, so I would recommend you get a (stable!) low value and a (stable!) high value to get a good spread for your correlation.
For this bit, I used a straight up least squares approach, but I personally think Bisquare is better especially if you have outliers (we had 2 of the 10 sensors we tried get some pretty awful r^2). Here's a sample calibration VI:
For safety reasons, we chose to timestamp incoming values and toss anything older than 4 hours, so you have to get at least two points per 4 hours to get this to work properly. This is a nonreentrant functional global, as we like to be able to append calibration points in separate places to where we actually use our current calibration.
In the future this will be a method of a Sensor class, but I haven't yet gotten around to porting this code to our shiny new OOP codebase. Anyways, hope that helps!