Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bobobo

Pages: [1]
1
Support Questions / Twincat write performance
« on: December 07, 2023, 12:41:30 PM »
Hi
Is there an elegant way to group writes to Twincat?

I have an old advancedhmi application (Not sure how old, but maybe based on a 5 year old version or so) that I'm looking at improving the performance.
I noticed that each Twincatcomm1.write operation takes about 100-150ms. At some occations I do a handful writes to different avariables when a button is clicked.
A few places could be easily replaced by array-writes but when it's a bunch of different types it's not that easy.
Any suggestions? I'm thinking if there is any functionality to add variables in a sending list and then write it all?

Is the new 3.99y version that uses AMSrouter generally faster?

2
Support Questions / Write two-dimensional array with twincat driver
« on: October 30, 2015, 02:28:50 PM »
Hi
In past versions (at least v3.02) of Adv.HMI it was working to write to 2-dimensional arrays in Twincat plc by treating them as 1-dimensional in AdvancedHMI.
Like this:
Code: [Select]
Plc declaration:
  controlcurve: ARRAY [0..99,0..1] OF REAL:= 200(0);

vb.net declaration:
  Dim cc(200) As String
 
TwinCATCom1.Write(".controlcurve", cc, 200)


But now in version 3.99a application breaks with error "WriteData2b, not possible to convert the string 99,0..1 to type integer" (error message translated from Swedish so it's not the literally exact message)

 
Code: [Select]
   Public Function Write(ByVal startAddress As String, ByVal dataToWrite() As String, ByVal numberOfElements As UInt16) As Integer
        If Not DLL.ContainsKey(MyDLLInstance) OrElse DLL(MyDLLInstance) Is Nothing Then CreateDLLInstance()
        Try
            Dim Sym As MfgControl.AdvancedHMI.Drivers.TcAdsSymbolInfo
            'Dim SymIndex As Integer
            Try
                Sym = GetSymbolInfo(startAddress)
            Catch ex2 As Exception
                System.Windows.Forms.MessageBox.Show("WriteData2b. " & ex2.Message)
                Throw
            End Try

With v3.99a the following is still working, but I don't like to rewrite the plc program.
Code: [Select]
Plc declaration:
  controlcurve: ARRAY [0..199] OF REAL:= 200(0);

vb.net declaration:
  Dim cc(200) As String
 
TwinCATCom1.Write(".controlcurve", cc, 200)




Can this be solved?

I could do it by looping through the array and write one element at time, but it's not elegant...

Best Regards
Mattias

3
Support Questions / Datasubscriber2 bug? (TwinCAT)
« on: October 10, 2015, 11:10:15 AM »
Hi
My application gets unresponsive and for error tracking I made an experiment and got a result that I think indicates a bug in the component or driver...

I started a new Adv.HMI 3.99a project. I added only a basiclabel to see that plc communication is working.
Then I added a Datasubscriber2, a standard Timer (interval 1000) and a textbox.

Code: [Select]
    Dim rate As Integer

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        TextBox1.Text = rate
        rate = 0
    End Sub

    Private Sub DataSubscriber21_DataReturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataReturned
        rate = rate + 1
    End Sub

The displayed rate indicates (approx) how many calls DataReturned gets per second:
1 valid PLCaddress in DataSubscriber: 4 events/s
2 valid PLCaddresses : 12 events/s
3 valid PLCaddresses : 24 events/s
2 valid PLCaddresses and 1 invalid PLCaddress : increasing slowly over 40sec to rate of 300-330events/s
13 valid PLCaddresses: 360 events/s
13 valid PLCaddresses and 1 invalid : increasing to about 2000 events/s

All above numbers with PollRateOverride (driver) at 500, and PollRate in DataSubscriber at 0.

(With one PLCaddress in DataSubscriber and a PollrateOverride at 100 I get 20 events/s (correctly 5 times above test)
With PollrateOverride 1000 I get 2 events/s.
Equal result if I change PollrateOverride to 0 and set 100/500 and 1000 at DataSubscriber PollRate.)


What do you think?

4
Feature Request / Twincat driver add route manually
« on: October 07, 2015, 12:00:46 PM »
Hi
I am using the Twincat driver with Adv.HMI 3.99a.
It is working only if i disable all network interfaces except the one connected to plc. Sometimes it works when Wi-fi is enabled also, but Virtualbox and different VPN drivers have added more network interfaces to my system.
Also in the past (older versions of Adv.HMI), I have had a lot of trouble getting AdvancedHMI to set-up the routing properly.

I think it would be great to have a possibility to disable any attemts from Adv.HMI to set-up a route automatically and do it all manual.
The proposal would be to add a Manual/Auto route setup to the properties of the TwincatCom Control.
Then also a "AdvHMI AMSNetId" property where I put in the desired AMS id of the HMI computer.

Then I just use another computer with Twincat system manager to add a route in the plc with the AmsId and ip-address of the HMI computer.
Beijer Eletronics HMI panels work this way.

It is some more set-up work than a fully automatic route set-up, but it's less work than trial-n-error to get a "not always automatic" function to work....

Best Regards

5
Support Questions / Datasubscriber2 and NumberOfElements
« on: October 07, 2015, 11:47:52 AM »
Hi
Is the NumberOfElements property in Collection of PLCAddressValueItems meant to enable subscription to an array?

I tried, but couldn't get it to work.

I am using Twincat driver and try to subscribe an array of 8 bools in the plc.

Since Twincat stores bools as bytes I tried to set number of elements both to 8 and 64, but i only get the DataChanged event when the first bool is changing, and the e.values is always count=1.

Maybe the feature is not programmed in Adv.HMI yet? I am using 3.99a

Best Regards


Pages: [1]