The RS232 component has three windows. The characters sent window seems self explanatory. Where can I find a comprehesive explanation of how to use the characters in queue / characters received windows?
Using the + button when the simulation is running opens a window which adds characters to the queue window but the only way I've found to transfer characters to the received window is to stop and re-start the simulation whereupon one character is transferred to the component.
Is there a way to simply type characters at the keyboard for input to the simulation.
tia,
Brian.
RS232 coponent rx character simulation
Moderator: Benj
-
Brian Walsh
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 coponent rx character simulation
Hello Brian
Characters can be added to the RS232 queue by running the simulation and clicking the + button. If your program is a loop that performs a RS232 read each cycle then on each RS232 read macro you should move a character through from the queue to the received window.
If no characters were received by the RS232 then you will get a return value of 255. Therefore you can check for this using a decision to let you know if you have received any data or not.
Characters can be added to the RS232 queue by running the simulation and clicking the + button. If your program is a loop that performs a RS232 read each cycle then on each RS232 read macro you should move a character through from the queue to the received window.
If no characters were received by the RS232 then you will get a return value of 255. Therefore you can check for this using a decision to let you know if you have received any data or not.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
Sean
- Valued Contributor

- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: RS232 coponent rx character simulation
Hello Brian,
Characters are transferred from the queue window to the receive window as they are read by the RS232 receive macros. This is a true representation of how the system would operate, especially if hardware handshaking is implemented.
Characters remaining in the queue have not been read by a corresponding read macro, but remain active and can be read by subsequent macro calls.
Characters in the received window are no longer active. This is simply a record of the characters that have been processed.
The queue system allows multi-character strings to be created (useful in many applications) before being submitted.
Characters are transferred from the queue window to the receive window as they are read by the RS232 receive macros. This is a true representation of how the system would operate, especially if hardware handshaking is implemented.
Characters remaining in the queue have not been read by a corresponding read macro, but remain active and can be read by subsequent macro calls.
Characters in the received window are no longer active. This is simply a record of the characters that have been processed.
The queue system allows multi-character strings to be created (useful in many applications) before being submitted.
-
Brian Walsh
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
Re: RS232 coponent rx character simulation
Thanks for the replies guys.
There is no RS232 receive in my main loop. The main loop simply flashes an LED. There is an RS232 receive in the preamble, which was suggested by one of you, to clear any error conditions. When I run the simulation it is this call to the component macro which moves the first character from the queue into the pseudo usart and the received characters window.
The preamble also enables an interrupt which calls a macro containing another RS232 component call and it is the behaviour of this ISR that I am trying to debug.
So, having started the simulation and witnessed the RS232 component in the preamble move the first character from the queue into the psuedo usart and received character window, how do I force remaining characters out of the queue and into the pseudo usart to test the interrupt response.
tia,
Brian.
There is no RS232 receive in my main loop. The main loop simply flashes an LED. There is an RS232 receive in the preamble, which was suggested by one of you, to clear any error conditions. When I run the simulation it is this call to the component macro which moves the first character from the queue into the pseudo usart and the received characters window.
The preamble also enables an interrupt which calls a macro containing another RS232 component call and it is the behaviour of this ISR that I am trying to debug.
So, having started the simulation and witnessed the RS232 component in the preamble move the first character from the queue into the psuedo usart and received character window, how do I force remaining characters out of the queue and into the pseudo usart to test the interrupt response.
tia,
Brian.
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: RS232 coponent rx character simulation
Simulation of the timer interrupt is quite slow, so you could try reducing the interrupt period. If you are using an RX interrupt, then this is currently not simulatable.