I always appreciate your help.
I want to receive data via RS-232.
I know the general stuff.
I want to receive data via RS-232, receive CR or LF, or store it in a variable if it exceeds 33 characters and send it back. I refer to the contents of the forum but it does not work. I do not know what mistake I made.
Help me.
Thank you.
RS232 serial Communication LF CR Please help me!
Moderator: Benj
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
RS232 serial Communication LF CR Please help me!
- Attachments
-
- PRT2COM_Test.fcfx
- (17.47 KiB) Downloaded 165 times
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: RS232 serial Communication LF CR Please help me!
I modified my program. use circulabuffer.
But not work.
Sombody Help me.
But not work.
Sombody Help me.
- Attachments
-
- PRT2COM_Test2.fcfx
- (19.45 KiB) Downloaded 163 times
-
- Valued Contributor
- Posts: 661
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 184 times
- Been thanked: 203 times
- Contact:
Re: RS232 serial Communication LF CR Please help me!
Hi
I don't have a copy of FC with me at present (traveling) so I can't look at your code, but I was going to suggest the use of a Circular Buffer but you beat me to it <s>
There are many examples of using the buffer and many related posts. I needed assistance last year in using the RS232 / CB components.
I ended up with an interrupt on RxInt which branched to a handling macro. In the macro I would place each incoming byte into the circular buffer and return upon timeout (i.e. when nothing more was coming in). In the main program I would look for certain characters (Look for Value command) to be present in the buffer (e.g. CR / LF whatever) before branching to a further handling routine if found.
I could then parse or do whatever, and if any further transmissions were received they would "interrupt" and fill more of the CB ensuring I lost nothing whilst processing data.
If you still need help when I return, I will dig out the project and perhaps it may help you, but that won't be until next week sometime.
Regards
I don't have a copy of FC with me at present (traveling) so I can't look at your code, but I was going to suggest the use of a Circular Buffer but you beat me to it <s>
There are many examples of using the buffer and many related posts. I needed assistance last year in using the RS232 / CB components.
I ended up with an interrupt on RxInt which branched to a handling macro. In the macro I would place each incoming byte into the circular buffer and return upon timeout (i.e. when nothing more was coming in). In the main program I would look for certain characters (Look for Value command) to be present in the buffer (e.g. CR / LF whatever) before branching to a further handling routine if found.
I could then parse or do whatever, and if any further transmissions were received they would "interrupt" and fill more of the CB ensuring I lost nothing whilst processing data.
If you still need help when I return, I will dig out the project and perhaps it may help you, but that won't be until next week sometime.
Regards