没得捷径就只有硬写了
macro_command main()
short data[30]
// Channel 0: X+Y data
data[0] = 0 // xMin
data[1] = 200 // xMax
data[2] = -1000 // yMin
data[3] = 2000 // yMax
data[4] = 0
GetData(data[5], "Local HMI", RW, 0, 1)
data[6] = 10
GetData(data[7], "Local HMI", RW, 7, 1)
data[8] = 20
GetData(data[9], "Local HMI", RW, 14, 1)
data[10] = 30
GetData(data[11], "Local HMI", RW, 21, 1)
data[12] = 40
GetData(data[13], "Local HMI", RW, 28, 1)
data[14] = 50
GetData(data[15], "Local HMI", RW, 35, 1)
data[16] = 60
GetData(data[17], "Local HMI", RW, 42, 1)
data[18] = 70
GetData(data[19], "Local HMI", RW, 49, 1)
data[20] = 80
GetData(data[21], "Local HMI", RW, 56, 1)
data[22] = 90
GetData(data[23], "Local HMI", RW, 63, 1)
SetData(data[0], "Local HMI", LW, 4000, 30)
end macro_command |