Author Topic: EthernetIPforSLCMicroCom  (Read 4985 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforSLCMicroCom
« Reply #15 on: May 15, 2018, 04:59:27 PM »
1. EthernetIPforSLCMicroCom .SubscribeToAllPLCTags(100sPollrate, CallbackHandler);
100ms for a large number of value is probably beyond the limits of the hardware. SLCs and Micros typically respond in 10-15ms in an ideal situation of only the PC and PLC connected directly together. Then you have a 236 byte packet limit on the newer models, less on the older.


Each table read requires it's own packet and anything beyond about 220 elements is broken into multiple packets. So let's say you want 100 floating point values, that is 2 packets therefore 20-30ms for that alone. Add 100 integers to that and you are now up to 40-60ms.


Comparing AdvancedHMI to an OPC server such as RSLinx is not an apples to apples comparison. Many OPC servers cache data and will send you stale values which leads you to think you are getting data faster than physically possible.

AdvancedHMI returns true data even if it has to delay beyond your requested rate. For instance, you can set a PollRateOverride of 1ms, but the PLC cannot respond at that rate, so you will get callbacks in about 10-15ms.

dhananjay.j@outlook.com

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #16 on: May 16, 2018, 12:55:50 AM »
I would say that what you posted looks more like a wishful thinking.

A "solid code example" to me would be an example that I could copy and paste into a project, run it and see what responses come from a PLC.
Minor modifications to that example could be done if necessary.


Yes It's a Wishful Thinking, I called it pseudo code for a reason. Sorry about that.

I guess our main issue is have to be limited to only 1 PLC primarily... I am currently using dictionaries in .net to sync Tags using subscriptions and considering 1s delay for around 230 values subscribed, plus some 40ish individual read writes, which should be enough time to do that. The issue as stated earlier is we have to rely on read failed exceptions to know PLC is busy. We tried put a bottleneck by using C# lock(ThreadLock){ } but still it takes atleast 6 tries some time to read or write a value which is considerable after the number of subscriptions that I have and the explanation that you gave.

Is it allowed to rewrite "EthernetIPforSLCMicroCom" driver code to test some changes? I am thinking of trying to force a thread safety and PLC availability check before push, pull request. If yes, Can we submit it to you so that we may get a feedback from you if it'll work considering PLC limitations/dependencies? will that be Considered as a Chargeable service request?

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #17 on: May 16, 2018, 07:59:26 AM »
Quote
1. Can we do somthing like check if EthernetIPforSLCMicroCom.IsConnected (available to Read and write)? if there is other way to this, its Most welcome...
Amen, bro or should I say Thathaastu  or Amitabha Buddha.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #18 on: May 16, 2018, 09:37:10 AM »
An implementation of IsConected in the driver might not reflect timely responses.

This since the detection of a lost connection relies on a timeout occurring from no response from the PLC, so it could be delayed by several seconds.

Here is a simple example of implementation which does respond to the network cable being connected/disconnected:

Code: [Select]
    Private IsConnected As Boolean
    Private Sub drv_ConnectionEstablished(sender As Object, e As EventArgs) Handles drv.ConnectionEstablished
        IsConnected = True
    End Sub

    Private Sub drv_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles drv.ComError
        IsConnected = False
    End Sub

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #19 on: May 16, 2018, 12:26:17 PM »
it's still nicer to have it right out the gate. Other drivers have it.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

dhananjay.j@outlook.com

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #20 on: May 17, 2018, 02:55:29 AM »
Is there a free OPC server that we can use to subscribe to all Tags at once? I see OPC dlls with AdvancedHMI Drivers in my project can we use that without any "Other" Application. so that we need to only write tags using AdvanceHMI?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforSLCMicroCom
« Reply #21 on: May 17, 2018, 03:28:47 AM »
Is there a free OPC server that we can use to subscribe to all Tags at once?
I doubt it because that would flood the network on a PLC program with any reasonable amount of data tables.

dhananjay.j@outlook.com

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #22 on: May 17, 2018, 06:31:30 AM »
What is the TNS value (int type) that we need with Some of the Methods for this Driver(like ClearFault, ChangeMode etc.)?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforSLCMicroCom
« Reply #23 on: May 17, 2018, 08:33:07 AM »
What is the TNS value (int type) that we need with Some of the Methods for this Driver(like ClearFault, ChangeMode etc.)?
It is a transaction number that comes from the generator:

        Dim TNS As Integer = MfgControl.AdvancedHMI.Drivers.Common.TransactionNumberGenerator.GetNextTNSNumber(32767)

The normally used commands encapsulate the generation of a TNS and return it to the user for asynchronous methods. The methods that are rarely used have not been abstracted to the higher level.

dhananjay.j@outlook.com

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #24 on: May 17, 2018, 08:58:10 AM »
I know i may be too much annoying but hopefully this may be the last one


How do I subscribe to B Tag Values like I need Some Boolean Values inside  from B3:0 to B3:10(B3:0/0 ,1, 2 to B3:10,0,1,2 etc...)? I get Numeric values in Return in EventErgs. Do I need to Convert them to binary and use as true false?


Also, Is there a priority to Subscriptions? like if I do
Connection.SubscriptionDataReceived += SubscriptionDataReceivedHandler;
            Connection.DataReceived += DataReceivedHandler;
            Connection.PCCCDataReceived += PCCCDataReceivedHandler;
            var BTagsSubscriptionId = Connection.Subscribe(Tag, 16, 100, CallBackHandlerForB3);

i get value only in PCCCDataReceivedHandler and not even in CallBackHandlerForB3. What will happen in case of multiple subscriptions?

Thanks & Regards,
Dhananjay

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforSLCMicroCom
« Reply #25 on: May 17, 2018, 09:03:26 AM »
How do I subscribe to B Tag Values like I need Some Boolean Values inside  from B3:0 to B3:10(B3:0/0 ,1, 2 to B3:10,0,1,2 etc...)? I get Numeric values in Return in EventErgs. Do I need to Convert them to binary and use as true false?
There is a bug in the current version with subscribing to multiple bits. To workaround it, you need to subscribe to the words (B3:0), then parse out the bits. Within a weeks will be a new beta version that fixes this problem.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #26 on: May 17, 2018, 09:39:36 AM »
If you want to try OPC Ignition from Inductive Automation, it's very easy to use, drag & drop and you can you see all your tags in no time.
And it's free, you only need to hit reset every two hours.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforSLCMicroCom
« Reply #27 on: May 17, 2018, 02:06:35 PM »
If you want to try OPC Ignition from Inductive Automation, it's very easy to use, drag & drop and you can you see all your tags in no time.
And it's free, you only need to hit reset every two hours.
Do they have a stand-alone OPC server or is it just integrated into the Ignition software? If it works stand-alone, I'm interested in running some bench mark tests on their driver

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #28 on: May 17, 2018, 02:43:04 PM »
it stated : "Ignition OPC-UA is offered free as a stand-alone server," but I dont recall in the installation package

https://inductiveautomation.com/news/free-modbus-driver-added-ignition-opc-ua
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

dhananjay.j@outlook.com

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: EthernetIPforSLCMicroCom
« Reply #29 on: May 18, 2018, 02:29:09 AM »
How do I subscribe to B Tag Values like I need Some Boolean Values inside  from B3:0 to B3:10(B3:0/0 ,1, 2 to B3:10,0,1,2 etc...)? I get Numeric values in Return in EventErgs. Do I need to Convert them to binary and use as true false?
There is a bug in the current version with subscribing to multiple bits. To workaround it, you need to subscribe to the words (B3:0), then parse out the bits. Within a weeks will be a new beta version that fixes this problem.

Can you give me a example of how to achieve this? When I subscribe to B3:0 and put numberOfElements to some value I get numbers that dont exceed 255(8bit) but  A B3:0 should have 0 to 15(16 bits) so I should only get 1 output till 32766 (signed).  How does this work?

Also, If I am already subscribed to a F tag using Driver Instance do I need to create another instance or subscribing with the same instance should work perfetctly?
« Last Edit: May 18, 2018, 05:01:28 AM by dhananjay.j@outlook.com »