Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Add new message type to FIT format

Rank

Total Posts: 2

Joined 2016-11-22

PM

Hi,

I want to create a new message type for the fit format which also includes new variables.
I already figured out that I have to add the new message type including its properties to the config.csv and then run the FitGen.exe

When running FitGen it complains that it cannot find the newly added message in profile.

I tried to add the new message type to the "Messages" register of Profile.xlsx as well as under "mesg_num" in the "Types" register of Profile.xlsx.

However FitGen.exe still complains.

Does anyone know where I have to add the new message definition besides the config.csv?

Thanks for your help!      
RankRankRank

Total Posts: 68

Joined 0

PM

Hey!

Adding a custom message is done by creating a messages.csv file and a types.csv file with your new message number and passing it to FitGen.

FitGen.exe -messages messages.csv -types types.csv 


messages.csv
"Message Name","Field Def #","Field Name","Field Type","Array","Components","Scale","Offset","Units","Bits","Accumulate","Ref Field Name","Ref Field Value","Comment","Products:","EXAMPLE"
"new_message"
,,,,,,,,,,,,,,,
,
0,"some_field","uint8",,,,,,,,,,,,
,
1,"some_other_field","uint16",,,,,,,,,,,, 


types.csv
"Type Name","Base Type","Value Name","Value","Comment"
"mesg_num"
,"uint16",,,
,,
"new_message","0xFF01"



     
Rank

Total Posts: 4

Joined 2017-04-25

PM

Hi,

thanks for this instruction. It helped me creating my custom FIT resources for C++ and Java.
However it doesn't include the new message types into the c resources (example.h).

I tried adding numbers in the "Product" column of Messages.csv but somehow it did not solve the problem.
Do I have to add anything more so it also adds the custom messages in the c resources?      
RankRankRank

Total Posts: 68

Joined 0

PM

Generating the C resources requires running FitGen twice. The first time will generate a config.csv file with your custom messages added to the end, you then need to enable your message and its fields in the config.csv, once that is complete run FitGen a second time providing the config.csv as an argument:

FitGen.exe -messages messages.csv -types types.csv -config config.csv 


This should generate the C resources for your new message.      
Rank

Total Posts: 4

Joined 2017-04-25

PM

Thanks a lot.
That fixed the problem.