How does an HMI send a string to an external connected device?

Normally a string can be sent directly via a pre-defined driver with a string input button and the selected address as its destination. But if there is no pre-defined driver or standard Modbus connection, there is also another method to send strings. This method requires the HMI macro function. Initially, a string can be saved in the internal memory of the HMI in the initial macro (e.g. HELLO). Next, create a button so that when this button is pressed, the string is sent. (This can be written in the ON macro script). Start the macro with an initcom() function to define the communication parameters. Then use the selectcom() function to choose which COM PORT will be receiving the string. Finally, use putchars() function to select and send the string that was saved in the internal memory of the HMI.

Faq tags: