RHAPSODY4YOU

--Independent Rational Rhapsody Forum--
It is currently Thu Mar 11, 2010 10:05 am

All times are UTC



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.




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Can I use bit field in Rational Rhapsody
PostPosted: Tue Nov 03, 2009 12:49 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: Can I use bit field in Rational Rhapsody
PostPosted: Wed Nov 04, 2009 4:09 pm 
Offline

Joined: Wed May 07, 2008 3:50 pm
Posts: 78
Location: Crawley, 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;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for: