Author Topic: ModbusRTUCom CommError event  (Read 1005 times)

quadro

  • Newbie
  • *
  • Posts: 7
    • View Profile
ModbusRTUCom CommError event
« on: April 10, 2020, 11:03:57 AM »
Hi guys,
I am new to AHMI and maybe doing something wrong but I do not see ModbusRTUCom.CommError event firing in case slave is off.
I use blank project with Beta 35 and put a label on screen which should show e.ErrorMessage.
Only if comm port is used I get event firing but in normal communication if I dissconect slave nothing happens.
Using digital panel meter I see Read Timeout BUT no CommError event.
Maybe I am using wrong event for detecting slave not communicating?
If that is a case what is a best way to detect and react on slave not responding?
I simulate slave with ModRSsim2.
Just to point that comm is working ok until I simulate slave not responding and after I put it back comm contiues ok.

Thank you

Quadro

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: ModbusRTUCom CommError event
« Reply #1 on: April 12, 2020, 02:40:14 AM »

quadro

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: ModbusRTUCom CommError event
« Reply #2 on: April 15, 2020, 12:54:33 PM »
Godra thank you for link.
I already used similar workaround by using digital panel meter TextChanged event since panel display "Read Timeout"
when slave doesn't respond in timeout time.
I already had it on form and sampling timer for other tasks so combined the two.
ConnectionClosed is not working here since slave is not responding but communication is established.
Since I am new to AHMI I was thinking that there is an event I do not see.
DigitalPanelMeter "knows" about timeout so it would be nice if Archie expose OnTimeout event to driver itself.
I mean driver job is to establish communication read data, respond to timeout or error so please Archie can you add such event in driver itself.

Thank you