# Sending a Carriage Return to from TCP Node

**URL:** <https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366>\
**Category:** General\
**Created:** [17 August 2018 14:31 UTC](https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366 "2018-08-17T14:31:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)\
**Post date:** [17 August 2018 14:31 UTC](https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366/1 "2018-08-17T14:31:00Z")

</div>

I have an application in which the equipment sends a continuous stream of data out serially, but an internal serial to ethernet card allows me to get the data which is being used in Node-Red. (TCP In Node) The equipment can accept some Serial commands to simulate an operator pushing buttons on on the face of the equipment. Using a different program I am able to sent it KSOFT$0D (KSOFT CR). I am looking to send KSOFT Hex Carriage Return from a Node payload. Any help on how this can be accomplished? I have tried the inject node with the payload set to KSOFT$0D, and using the TCP out Node. This has not been successful yet.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2018 15:10 UTC](https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366/2 "2018-08-17T15:10:52Z")

</div>

I don't know about an inject node, but you can do it in a function with  
`msg.payload = "KSOFT\r";`  
or if you actually need CRLF then  
`msg.payload = "KSOFT\r\n";`

---

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [17 August 2018 15:42 UTC](https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366/3 "2018-08-17T15:42:24Z")

</div>

If you want to set it from the inject node, choose JSON as the payload type with :  
`"KSOFT\r"`

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [18 August 2018 13:05 UTC](https://discourse.nodered.org/t/sending-a-carriage-return-to-from-tcp-node/2366/4 "2018-08-18T13:05:30Z")

</div>

Pretty tricky there, Mr. Nat...

OR, you can set the inject node to "Buffer" mode, and enter an array of hex character values:  
`[75,83,79,70,84,13]`
