PM3 USB HMI interface ?

Post questions and issues with Concept2 PM3 SDK
Post Reply
User avatar
mkovalcson
Paddler
Posts: 3
Joined: June 16th, 2008, 10:22 pm
Location: Knoxville, TN

PM3 USB HMI interface ?

Post by mkovalcson » June 20th, 2008, 9:38 pm

Does the PM3 have an HMI interface definition?

Is there any good reason a .NET interface hasn't been written yet?
C2 Model C - PM3
Started Rowing July 1994

haboustak
500m Poster
Posts: 77
Joined: March 17th, 2006, 3:02 pm
Location: Cincinnati

Post by haboustak » June 21st, 2008, 10:05 am

You should be able to poll the monitor using the CSAFE_GETHRCUR_CMD command. I believe that this returns instantaneous heart rate, but not sure if I'm remembering correctly. The PM has an infamous treatment of heart rate in that the heart rate recorded for a split is the last instantaneous reading. So there's probably no HR averaging going on inside the monitor.

There have been a lot of .NET wrappers written, not sure how many were released. It's just a matter of getting the right attributed function declarations into a static wrapper class, so the work is over about as quickly as it starts.

Citroen linked to this promising page earlier: http://www.theonlineoasis.co.uk/erg.html. It appears to take the .NET thing a little beyond PInvoke and create an event-based interface. The code examples on that page are OK. I like my threading done differently (whether in straight Win32 or in .NET).

There's an ActiveX control as well, written by Chris Brett. It's a simplified wrapper that isolates you from some of the annoying parts: http://www.concept2.co.uk/software/pmi.php. I don't know if Visual Studio could generate a .NET interop assembly using the COM interface or not.


Mike

User avatar
mkovalcson
Paddler
Posts: 3
Joined: June 16th, 2008, 10:22 pm
Location: Knoxville, TN

Post by mkovalcson » June 22nd, 2008, 8:16 am

HMI is a type of USB interface. Human Machine Interface (HMI) typically very simple devices follow this format. Some others act as a storage device and others are much more complex.

Thanks for the links. I haven't had the CPP module installed in VS as far back as 2003, so this should be a treat :)
C2 Model C - PM3
Started Rowing July 1994

haboustak
500m Poster
Posts: 77
Joined: March 17th, 2006, 3:02 pm
Location: Cincinnati

Post by haboustak » June 22nd, 2008, 10:24 am

Ah, I had a feeling I had misunderstood your acronym when I had finished posting. Heart rate would be HRM interface, wouldn't it.

I've never heard of an HMI USB device, but it has a nice ring to it. The PM3/4 implements the HID (human interface device) spec. It uses the HID USB class driver on Windows, MacOS, and Linux. As a result, the monitors don't need any traditional kernel-mode drivers on those platforms. You can communicate directly with the PM using standard HID/USB protocol requests. Which is what the USB portion of the three-DLL SDK does. The other two DLLs in the set handle message routing, and message formatting/parsing.

Mike

User avatar
mkovalcson
Paddler
Posts: 3
Joined: June 16th, 2008, 10:22 pm
Location: Knoxville, TN

Post by mkovalcson » June 23rd, 2008, 7:24 am

Actually I got the acrynoym wrong. It's sad what you can forget in a couple years.

I've installed the C++ support in VS2008 and I'll see if I can get anything interesting to happen. In .NET 2.0, MS added a nice Serial Communications library. I was hoping that MS would open that up to USB devices with .NET 3.0.

I found this link on codeproject.com for a USB HID component.
http://www.codeproject.com/KB/cs/USB_HID.aspx

MS has offered XNA game studio to people wanting to write X-BOX 360 games for $99 per year. I'll see if I can get the basic physics worked out on a PC first. Unfortunately it would probably require a special wireless rowing handle with a few buttons to make things interesting. Honestly it wouldn't be that hard to retrofit a wireless remote to a handle.

I probably should take baby steps before getting too advanced:)
C2 Model C - PM3
Started Rowing July 1994

User avatar
c2scott
2k Poster
Posts: 218
Joined: March 19th, 2006, 6:31 pm

Post by c2scott » July 29th, 2008, 9:29 am

Regarding Heart Rate: When using Polar (or Acumen) receiver and Polar compatible heart rate strap, there is some heart beat averaging going on to display the heart rate; I think it's over 8 beats or so. This is what is displaed and what is available on the USB interface as a calcualted instant HR value. On a PM4, Suunto belts are provided, the HR is calculated using Suunto smoothing code. When a Garmin or generic ANT+SPORT belt is used, currently the same averaging is used as with the Polar, however we are evaluating the built in "calculated" HR value that the belt puts out -- future firmware may use this value instead to more closely match what a Garmin watch/GPS would show...

That all said, there is available the instantaneous "beat-to-beat" time that would enable further analisys such as is done with FirstBeat's software...

And yes indeed, what is recorded on the LogCard for each split/interval is not the average, but the value displayed at or near the end of each split/interval. This is typically the highest value and is thought by Concept2's performance monitor team to be more useful than the average over a split or interval. If you need better granularaty, you can set up more splits or intervals. The Summary HR is the average of the split/interval values.

Post Reply