Hi,
Don't worry, all UDP messages are translated to bytes before they can be transferred over the network. HEX is just easier to write than plain bits! And a normal string is even more easy to write than HEX.
See here an example of how the same message can be written in ASCII, HEX or Binary :
ASCII: | s | e | t | I | n | p | u | t | <Space> | T | e | s | t | <Space> | 1 | <Space> | <CR> |
Hex: | 73 | 65 | 74 | 49 | 6E | 70 | 75 | 74 | 20 | 54 | 65 | 73 | 74 | 20 | 31 | 20 | 0D |
Binary: | 01110011 | 01100101 | 01110100 | 01001001 | 01101110 | 01110000 | 01110101 | 01110100 | 00100000 | 01010100 | 01100101 | 01110011 | 01110100 | 00100000 | 00110001 | 00100000 | 00001101 |
But as control characters like Carriage Return (what you need) are not something you can easily write, many systems have thought of a way to circumvent that. Unfortunately, this means many systems have different ways of doing this... As I can see from your topic on the dataton forum, WATCHOUT uses "$0D" to write the carriage return character, which is essentially HEX as well. In C-based programming languages it is often "\r".
In the IoCore2 you can use the "Send Bytes" feature to send the UDP packet with special characters. You will need to enter the entire message you want to send in one long HEX string. (
Don't use
Send String Hex ) Start with translating your message without the control character, you can use the website I entered below. Copy that into the first parameter of the UDP task "Send Bytes". Now simply append the HEX value of your control character at the end!
This can be a nice tool to translate: (Be sure to disable "Padding" if you want to use it in the IoCore2)
https://www.binaryhexconverter.com/ascii-text-to-hex-converterTo find the HEX value of your control character, you can search for an ASCII table, like this one:
https://www.ascii-code.com/Regarding the message sending twice, I'm guessing you are using the "Execute" button. Because of the design of ShowControl, this will actually trigger your task or action twice. Once is when you press the "Execute" button, and the second one is when you release the button. When the action is triggered via (for example) GPI, you can set the trigger flank to choose between "Down", "up" and "Change". In a lot of cases, this equals the pressing and releasing of a button, much as the "Execute" button does.
Long story short, I've added an example of sending "setInput Test 1<cr>" below.
Greetings,
Bootsy