Author Topic: [MicroLogix] Read PLC Values  (Read 782 times)

rp

  • Newbie
  • *
  • Posts: 7
    • View Profile
[MicroLogix] Read PLC Values
« on: September 22, 2019, 02:44:27 PM »
Hi all,

I am using a MicroLogix 1100 by EthernetIP communication (so, i am using the EthernetIPforSLCMicroCom driver).

My application has 5 pages, and in each page I need read differents variables each 2 seconds. The maximum variables number is 100 INT.

So, what is the best choice to read this 100 INT? The DataSubscriber or use a Timer (Windows Component) and each 2 seconds read variables with PLC.Read() function ?

Another question, how I can detect that PLC is disconnected? I need a flag/bit/int that indicates the PLC Communication state.

Thank you,

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: [MicroLogix] Read PLC Values
« Reply #1 on: September 22, 2019, 04:40:04 PM »
Your best choice would probably be to set the driver's PollRateOverride to 2000ms and subscribe to your addresses with DataSubscriber2, similar to the picture in this post:

https://www.advancedhmi.com/forum/index.php?topic=2451.msg15109#msg15109


rp

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: [MicroLogix] Read PLC Values
« Reply #2 on: September 23, 2019, 03:13:39 PM »
Thank you.

About a flag that indicates the plc communication status, there is any function or bit?

Thanks

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: [MicroLogix] Read PLC Values
« Reply #3 on: September 23, 2019, 04:58:14 PM »
Try using one or all of the driver's events to see if they work for you:

Code: [Select]
    Private Sub EthernetIPforSLCMicroCom1_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforSLCMicroCom1.ComError

    End Sub

    Private Sub EthernetIPforSLCMicroCom1_ConnectionClosed(sender As Object, e As EventArgs) Handles EthernetIPforSLCMicroCom1.ConnectionClosed

    End Sub

    Private Sub EthernetIPforSLCMicroCom1_ConnectionEstablished(sender As Object, e As EventArgs) Handles EthernetIPforSLCMicroCom1.ConnectionEstablished

    End Sub

or check this forum for discussions that might have something, like this one:

https://www.advancedhmi.com/forum/index.php?topic=1086.msg5804#msg5804