1) LW-9576 - (32bit) : received data count (bytes) (Ethernet MODBUS server) - подходит ?
Сделал с помощью регистра из этой группы такой макрос. Запускается каждую секунду. Пока все работает как и хотел, косяков не наблюдаю
- Код: Выделить всё
- macro_command main()
unsigned int received_data_count = 0
unsigned int saved_data_count = 0
unsigned short received_data_count_offset = 9572
unsigned short plc_no_response_window_number = 13
unsigned short main_window_number = 10
GetData(saved_data_count, "Local HMI", "saved_modbus_data_count_address", 1)
GetData(received_data_count, "Local HMI", LW, received_data_count_offset, 1)
if saved_data_count == received_data_count then
SetData(plc_no_response_window_number, "Local HMI", "change_window_control_address", 1)
else
SetData(main_window_number, "Local HMI", "change_window_control_address", 1)
end if
SetData(received_data_count, "Local HMI", "saved_modbus_data_count_address", 1)
end macro_command