Messages sent to the host

You can program a drive/motor to send messages to your host. The messages are all of type “Take Data 2” (see Communication Protocols: RS232 & RS485 or CAN) i.e. return the value of a TML data, like if the drive/motor would have had received a “Give Me Data 2” request from the host to return that TML data.

The message transmission can be triggered by:

Conditions which change the status registers SRL, SRH or the error register MER
The execution of the TML command SEND from your TML program. Through this command you can send to your host the contents of any TML data

In the first case, you can select the registers bits, which will trigger a message when are changed. The selection is done via 3 masks, one for each register, set in TML parameters: SRL_MASK, SRH_MASK, MER_MASK. A bit set in a mask, enables a message transmission when the same bit from the corresponding register changes.  

When the transmission is triggered by a bit change in SRH (high part) or SRL (low part), the message sent contains these 2 registers grouped together as a single 32-bit register/data, with SRH on bits 31-16. When the transmission is triggered by a bit change in MER, the message sent contains this register.

The host ID is specified via the TML parameter MASTERID. This contains the host ID (an integer value between 1 and 255), multiplied by 16, plus 1. For example, if the host ID is 1, the value of MASTERID must be 1 *16 + 1 = 17.

Remark: By default, at power on, the MASTERID is set for a host ID equal with the drive/motor axis ID. Therefore, the messages will be sent via RS-232 serial communication. If the host ID is set different from the drive/motor axis ID, the messages are sent via the other communication channels: CAN bus, RS485, etc

 

Parameters

MASTERID                Provides the host ID (address), according with formula:

MASTERID = host ID * 16 + 1

SRL_MASK                Mask for SRL register. A bit set to 1, enables to send SRH and SRL when the same bit from SRL changes

SRH_MASK                Mask for SRH register. A bit set to 1, enables to send SRH and SRL when the same bit from SRH changes

MER_MASK                Mask for MER register. A bit set to 1, enables to send MER when the same bit from MER changes

 

Variables

SRL        TML register. Low part of the 32-bit status register grouping key information about the drive/motor status

SRH        TML register. High part of the 32-bit status register grouping key information concerning the drive/motor status

MER                TML register. Groups all the errors conditions

 

Instructions

SEND var        Sends a “Take Data 2” message with var contents. Var can be any 16-bit or 32-bit TML data: register, parameter or variable

Programming Examples

MASTERID = 33; // Set host ID / address = 2

//Send SRH & SRL if motion complete or pos. trigger 1 bits change

SRH_MASK = 0x0002;

SRL_MASK = 0x0400;

MER_MASK = 0xFFFF; // send MER on any bit change

SEND CAPPOS; // Send to host contents of variable CAPPOS

 

See also:

Communication Protocols – RS232 & RS485

Communication Protocols – CAN

TML Description