Question
How do I send a message greater than 254 characters using TCP Device?
Answer
In-Sight has a limitation of around 250 characters that can be placed within any cell, including function names and parameters. This means it is not possible to concatenate a string longer than that. Sometimes it is necessary to send out longer results, and having to split the message into multiple packets sent in succession makes the communication more complicated on both sides. It is possible to send a longer string when formatting it as binary data by performing the following steps:
- Set up a TCPDevice function as usual, but set the Packet Type to “Binary with Custom Terminator”.
- Concatenate the strings using the BStringf function. For example, if there are strings in B0, B1 and B2 it would look like this: BStringf(0,"%s%s%s",$B$0,$B$1,$B$2)
- Link the Data1 parameter of the WriteDevice function to the cell with the BStringf function.