The screen number being displayed on a cMT2128X

The screen number being displayed on a cMT2128X
none 0.0 0

Hi @jkumbera ,

Great question. There are a few different ways to determine which window is being displayed on the HMI and transfer that information to another device.

One option is to use a PLC Control object. A PLC Control object allows you to write data to a device that includes the current base window ID. Each time the base window changes, the window number is written to the trigger address assigned to the object. The example shown below demonstrates how you might configure a PLC Control object for this purpose. Instead of selecting Local HMI as the device, you would select your PLC from the device drop-down menu so that the current window number is written directly to the PLC address.

Another option is to use a Data Transfer object, which can send the current window data using a Global Data Transfer. This transfer can be configured as either time-based or bit-triggered and will move data from a source address to a destination address. We have a forum article that walks through this process in more detail: https://forum.weintekusa.com/t/how-to-convert-protocols-and-transfer-data/696?u=brendon.s

A Macro can also be used to retrieve the current window number and write it to another register. The system tag for the current base window ID is LW-9050. In the example below, the GetData function reads the value from LW-9050, and the SetData function writes it to an unused register, LW-1000, which can then be referenced elsewhere in the project or transferred to a PLC.

macro_command main()
	bool data = false
	GetData(data, "Local HMI", LW, 9050, 1)
	SetData(data, "Local HMI", LW, 1000, 1)
end macro_command
1 Like