Sending a Carriage Return to from TCP Node


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.



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";



If you want to set it from the inject node, choose JSON as the payload type with :

1 Like


Pretty tricky there, Mr. Nat...

OR, you can set the inject node to "Buffer" mode, and enter an array of hex character values: