I was not able to reproduce this issue, but I suppose it may be at least in part attributed to data overlap, the int data type in our macro work space is used to represent a 32-bit integer. When a variable of an int data type is used within a GetData() command, value1 as in this example will be read from both LW-0 and LW-1 as 2 HMI registers are needed to hold 32-bit data. Can you please change the data type to short and advise if this resolves the issue?
macro_command main()
short value1 // value1 is a 16bit word
short value2 // value2 is a 16bit word
short result // result is a 16bit word
GetData(value1, “Local HMI”, “Tag_5”, 1) // get value1 from HMI LW0
GetData(value2, “Local HMI”, “Tag_6”, 1) // get value2 from HMI LW1
result = value1 - value2 - 1 // result = value1 - value2
SetData(result, “Local HMI”, “Tag_10”, 1) // put result in LW 10
end macro_command