Author Topic: Reading What is the last Address trying to read before ComError happening  (Read 142 times)

Zumping Snake

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi
I have some dificulty solving this
So I have ModbusTCPCom object called modBus
then I try reading address like this
Code: [Select]
modBus.BeginRead("40020", 20);
modBus.BeginRead("40100", 15);
modBus.BeginRead("40120", 5);
normally, DataReceived will be triggered, but this time I try to make it error so that ComError can be triggered
how do I know which BeginRead that failed to retreived??
Thank you

bachphi

  • Hero Member
  • *****
  • Posts: 699
    • View Profile
If the network cable is disconnected, the ComError event will be triggered regardless of which BeginRead was called — because all Modbus communication will fail. In that case, it doesn’t seem very meaningful to identify exactly which BeginRead failed, since they’re all impacted by the same underlying issue. That’s why I’m not seeing why it would be such a big deal to distinguish between them .
UCL =================
This is NOT alt.read.my.mind.No such thing is sh^t-for-brains
unless you are posting to alt.read.my.mind. Savvy?
My understanding of computer is well below six Σ.
Unless what I say is logically defined in a PLC, everything else might be beyond my control.
LCL ================