Hi
I am sendind data to a coms ports "letmein" how do I add a carriage return to this ?
Thanks
Spence
Carriage return
- 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: Carriage return
Hello
Carrage returns and line feeds are legacy items left over from the days of early dot matrix printers. The ascii values would cause the printers to move to the start of the line (carrage return) and also move to the next line (line feed). The ascii values for a carrage returna and line feed are like any other ascii value eg the ones im using to write this text. For example the ascii value for a '0' character is 48. You can test this by holding alt and typing 48 on your numeric keypad.
To send a carrage return send the number value 13.
To send a line feed send the number value 10.
So for a enter character as you would get off your keyboard you will have to send two bytes with the values 13 and 10, or 10 and 13 dont think the order you send them will effect anything.
For a full list of Ascii characters please see this website.
http://www.asciitable.com/
Carrage returns and line feeds are legacy items left over from the days of early dot matrix printers. The ascii values would cause the printers to move to the start of the line (carrage return) and also move to the next line (line feed). The ascii values for a carrage returna and line feed are like any other ascii value eg the ones im using to write this text. For example the ascii value for a '0' character is 48. You can test this by holding alt and typing 48 on your numeric keypad.
To send a carrage return send the number value 13.
To send a line feed send the number value 10.
So for a enter character as you would get off your keyboard you will have to send two bytes with the values 13 and 10, or 10 and 13 dont think the order you send them will effect anything.
For a full list of Ascii characters please see this website.
http://www.asciitable.com/
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