|
It is currently Thu Feb 09, 2012 12:42 am
|
View unanswered posts | View active topics
| Welcome |
|
Welcome to RHAPSODY4YOU
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today. |
 |
|
 |
|
| Author |
Message |
|
ziomocci
|
Post subject: Can I use bit field in Rational Rhapsody Posted: Tue Nov 03, 2009 12:49 pm |
Joined: Wed Oct 21, 2009 9:50 am Posts: 5
|
|
Hi all
I am trying to draw a model of an seat belt reminder system, which use a LIN bus protocol, sending a 40 bytes messages divided into five fields. I would want to manage a LIN message with a bit-field structure. I am a little bit confused, because on the Rational Rhapsody User Guide book I have read that RHapsody does not support C bit field, but I have also read here (unfortunatly I do not find the post more) that the strategy to create a bit field in Rhapsody is: #1: create a new structure #2: manually add the implementation using signature as: unsigned int %s: <number_of_bits> Auto-generating code Rhapsody substitutes by itself %s with the variable number.
I do not know what is the best solution, heeding the book or the post? Any suggestion? Thanks
Andrea
|
|
|
|
 |
|
shanz
|
Post subject: Re: Can I use bit field in Rational Rhapsody Posted: Wed Nov 04, 2009 4:09 pm |
Joined: Wed May 07, 2008 3:50 pm Posts: 148 Location: Horsham, W Sussex, England
|
|
In Rhapsody In C++ there is a property called CPP_CG:Attribute:BitField
Allows you to define a bit field for an attribute. To define a bit field, open the Features dialog for the relevant attribute and enter the number you want to use for the bit field as the value of the property BitField.
For example, if you enter 2 as the value of BitField for an attribute named attribute_1 of type int, the resulting code is:
int attribute_1 : 2;
|
|
|
|
 |
|
|
 |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|