Knowledge Base

The HMI430/700 has one RS485 port which may be used for MODBUS, custom serial communications or Xwire.

RS485 MODBUS or Custom

When using MODBUS or custom communications, the address for this port is 254.

The easiest way to configure this port for MODBUS or custom communications is to use the #Open_Serial instruction together with the #Port() directive.  Here’s an example of opening COM485 for user communications at 38400 baud and sending a “Hello World” message:

   #Include     File( "hmi430_io.spt" )       ;include the HMI430 I/O map (this sets "COM485" to 254)
#Open_Serial Port(COM485) User(38400,8,N) ;open COM485 @ 38400
iiPrintText COM485,"Hello World",13,10 ;send text out COM485

The HMI430 fully supports both MODBUS Master and MODBUS Slave.

RS485 Xwire

At power on, Xwire is set to use the Xwire TTL port.  If you want to switch Xwire to use the RS485 port instead, then use the XwirePhys instruction.  On the HMI XwirePhys can take one of two values:

  • 0: Set Xwire to use the dedicated TTL Xwire port.  RS485 is available for MODBUS or custom communications.
  • 1: Set Xwire to use the RS485 port.  MODBUS or custom communications is now unavailable on this port.

You may call XwirePhys at any time and may even switch back and forth at any time.