![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Serial port handler in Rhapsody Topic Summary: Created On: 19-Oct-2005 14:52 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Is it possible to get rhapsody to produce code that responds to windows events/interrupts for the serial ports on a windows system.
Outside of Rhapsody I would create a thread that used setCommMask and WaitCommEvent to wait on an EV_RXCHAR event. However I can not see how I would acheive the same thing within Rhapsody. The closest I can get is to use a state machine that polls the serial port but this is not very efficient and the smallest resolution is 1ms. Is it possible to produce such an event handler in Rhapsody? Paul |
|
![]() |
|
![]() |
|
Well, you can do just about anything in Rhapsody that you can do outside of it. If you need to use OS specific calls, then you wouldn't be able to code gen for another OS without changes however.
You can make an object it's own thread bu making it active instead of sequential on the features tab. If you just want an object to go into a loop doing blocked reads, make the object a thread usinf the "active" tag and then put your code loop inside a state in the object. The state model could eventually evolve to reset itself and reinitialize on faults, but always ends up in the looping state when connected, with a while or other looping construct. |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Serial port handler in Rhapsody
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.