setting time data to fit file

Hi,
I have been playing around with the fit contributor and there is one thing I cant seem to find a solution for:

Time format data!

lets look at pace as an example.
1. Garmin Connect shows pace as this type of format natively "6:00 min/km"
2. avg speed in fit file (per fit SDK) is stored as UINT16.
3. Activity.info of avg speed is in meters per second.

the question is:
how do I store pace in the fit file in a way that the axis that will show in GC will be a "5:50,6:00,6:10..." time axis and not a meters per second one?
or how do i convert the Meters per second float coming from the activity.info (while storing it in a UINT16) to something that GC will recognize to show as pace later and act accordingly?

thanks,
  • how do I store pace in the fit file in a way that the axis that will show in GC will be a "5:50,6:00,6:10..." time axis and not a meters per second one?

    i have the same issue with my swimming app. typically swimming pace is expressed in min/100m . I don't think you can. if you take a look at existing FIT files, you will see that actually they store the data in fit file in m/s as a float. GC displays afterwards the data in min/km, because GC knows that this is typical for running. but you cannot do the same with connectiq fields (as far as i know...)

    or how do i convert the Meters per second float coming from the activity.info (while storing it in a UINT16) to something that GC will recognize to show as pace later and act accordingly?

    i think that speed is stored in UINT16 only when data is transmitted over ANT+ (the excel file provided with ant+ sdk also describes which scale do you have to used. as far as i remember scale is 100 for SPEED). but actually the data in the fit file is written as a float, not as a UINT16. i have opened serveral fit files and i have found always float data.
  • If you are intending to replace the normal pace graphs, have you tried adding :nativeNum to the options passed to createField? It seems that your values would be interpreted correctly then.

    Of course this won't work if you are trying to implement a time-based data field that doesn't already have a native representation (7s average pace for example).

    Travis
  • If you are intending to replace the normal pace graphs, have you tried adding :nativeNum to the options passed to createField? It seems that your values would be interpreted correctly then.

    Of course this won't work if you are trying to implement a time-based data field that doesn't already have a native representation (7s average pace for example).

    Travis


    Thanks Travis. I already tried the nativeNum (assuming the fit profile csv "Field Def #" is the native number...) but it didnt help.
    other ideas are welcome.
    Tx
    DGAZ
  • Did you ever achieve any resolution on this?
    I would like to record and display grade, which is a native field in the FIT SDK, and is stored as SINT16, with a scale factor of 100. However, if I follow this and assign the :nativeNum to my contributed field and store the value as SINT16 (i.e. 6.85% => 685), it is displayed in MonkeyGraph as the integer, not scaled to the decimal.
  • Did you ever achieve any resolution on this?
    I would like to record and display grade, which is a native field in the FIT SDK, and is stored as SINT16, with a scale factor of 100. However, if I follow this and assign the :nativeNum to my contributed field and store the value as SINT16 (i.e. 6.85% => 685), it is displayed in MonkeyGraph as the integer, not scaled to the decimal.


    My guess is that the type and scale in the fit sdk relates to how the data has to be sent over ANT+ (for instance, how a power meter should transfer watts to the forerunner). but i think that it is expected that the data are stored as float in the file.
    i have been watching several pool swimming fit files generated by both a FR910 and a FR920, and the speed is stored as a float there, in m/s. no scale, or whatsoever.

    in GC speed data are displayed as min/m (for the 910 and the 920), but ConnectIQ data is displayed as stored in file => float, m/s.

    what i have done is create two different fields. one is declared as native, so that 3rd party sites can display it (3rd party sites which support Fit2, will do the translation properly to suitable units => min/100m). for this field I dont draw a chart in GC.
    I calculate also a 2nd field, without nativeNum, which i use to display a chart in GC. for this one i calculate seconds/100m. this way i get a chart in GC in the expected units. this field wont be detected by 3rd party sites because nativeNum has not been set.
  • what i have done is create two different fields. one is declared as native, so that 3rd party sites can display it (3rd party sites which support Fit2, will do the translation properly to suitable units => min/100m). for this field I dont draw a chart in GC.
    I calculate also a 2nd field, without nativeNum, which i use to display a chart in GC. for this one i calculate seconds/100m. this way i get a chart in GC in the expected units. this field wont be detected by 3rd party sites because nativeNum has not been set.


    The Muscle Oxygen data has this same issue.

    Dynastream used to recommend writing the data to the FIT file twice exactly like you are suggesting. However, now they have adjusted their guidance on how :nativeNum data should be encoded in the FIT file via ConnectIQ. Based on how the FIT SDK works, this is better for the 3rd parties to decode. They updated the FIT SDK last week and updated the section on the Native Field Nums.

    In FIT SDK 20.16.00 see section 4.2.1.5.2.1 Native Field Num Details on page 26 of Flexible & Interoperable Data Transfer (FIT) Protocol.

    Now the guidance is to write this type of data as a float with no scaling.

    I am in the process of changing my Apps and Data Fields to comply.