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.


Messages - hileta

Pages: [1]
1
Support Questions / Tablet functions
« on: April 25, 2016, 02:42:32 PM »
So I have developed my application and am pretty excited with the results. I have one obstacle left to tackle.

My application is to run on a Tablet PC and is doing so quite well, I now want to add some tablet style to it. I hope to add things such as re-sizing, Orientation change, Pinch Zoom, and scrolling. Does anyone have experience with this and know a good starting point or site/tutorial to use?

Tim

2
Archie,

That is a pretty slick program. I don't think I can convince them to use it though. Is it possible to read/write to the PLC using only Excel with a macro?

3
I have been able to read/write to a CLX using excel from a PC that has RSLinx OEM and I found a site where he uses the AdvancedHMI Driver to read from the processor, but nothing for writing.

http://plc2k.com/how-to-read-values-from-controllogix-l61-directly-in-excel/#comment-36

 I was wondering if it is possible to read/write to a CLX using excel without having RSLinx installed on the PC. My dilemma is that an array of Strings need to be maintained by office personnel who work exclusively from Excel.

Tim

4
I have redone everything to use the BasicLabel and for some reason am having better results. I still have a version with the DataSubscriber2 and will try to test it out with Wireshark today. I have never used Wireshark before, it sounds interesting.

In my project I have a MainForm that uses a button to call another form which contains the my EthernetIPforCLXCom1 connection(I also pass the IPAddress as we discussed above depending on which button is pressed), in jumping back and forth between the screens is there any maintenance that needs to happen? I've read about disposing and closing the connection to keep from multiple instances of the driver. It was an older thread so I'm wondering if it is still relevant.

Tim

5
My Replies in RED


Let's first consider what is realistic on reading that much data. On an ideal network connection, which would be a single cable between the HMI and the PLC, only AdvancedHMI communicating to the processor, and not Ethernet/IP devices being scanned by the PLC. Under that scenario you can expect and average round trip read of about 5ms per packet.

Now let's assume the worst case of data being read. If the 80 string and 80 DINTs required a packet for each read, then it would take 160 reads. 160x5=800ms

It looks like your Sheet1Bins are an array, which I will assume are the strings. The maximum packet size is 508 bytes. Each string requires 80+ bytes. Then about 25 bytes for header information. So the driver will only be able to read 4 or 5 strings per packet. If it is 4 strings, then it requires 20 packets to read all 80. Once again in an ideal network, that would take about 100ms to complete.

I have a total of 8 Arrays in the processor. 4 STRING[20] and 4 DINT[20]

If the 80 DINTs are in an array, they can easily read in a single packet, therefore an additional 5ms.

They are in 4 arrays of 20 each

Total round trip should be 105ms based on a few assumptions about your setup.

What do you have PollRateOverride set to? What update rates are you seeing now? Is DisableMultiServiceRequest set to 0?
DisableMultiServiceRequest = False
PollRateOverride for EthernetIPforCLXCom1 = 100
PollRate for DataSubscriber21 = 0


The best tool for seeing where the bottleneck is WireShark. Simply start a packet capture, then start the HMI. You will fairly easily see the variable names in the packets to see how requests are handled.

I will look into this


I also see that you are using the DataChanged event, which will only fire when the first element of the array changes. To get a continuous update no matter what changes, you will need to use the DataReturned event.

Sorry, I had it that way initially but was playing with it to see if Changed would speed up anything

Just another question out of curiosity, but why are you using a DataSubscriber to push values into a Label, when a BasicLabel will do this without the need to write code?

I read in another post somewhere that this method was suggested. I initially used the BasicLabel but again experienced a slowing as I added more strings. I am trying to have one screen show data from different PLCs and Different Programs based on the button used to launch the form. For example:

On MainForm:
If Button1 is pressed: (PLC1 Program1)
- Set IPAddress to 192.168.3.10
- Set ProgramName to "Program:Kit_Data1." for prefixing to "Sheet1Bins[0]" for the PLCAddressValue

If Button2 is pressed: (PLC1 Program2)
- Set IPAddress to 192.168.3.10
- Set ProgramName to "Program:Kit_Data2." for prefixing to "Sheet1Bins[0]" for the PLCAddressValue

If Button3 is pressed: (PLC2 Program1)
- Set IPAddress to 192.168.3.11
- Set ProgramName to "Program:Kit_Data1." for prefixing to "Sheet1Bins[0]" for the PLCAddressValue

If Button4 is pressed: (PLC2 Program2)
- Set IPAddress to 192.168.3.11
- Set ProgramName to "Program:Kit_Data2." for prefixing to "Sheet1Bins[0]" for the PLCAddressValue


Is BasicLabel a better method?


Make any sense?

So do I need to break up the String reads to separate subscriptions?

I am considering making the String Reads event driven from the PLC. They do not need to update as often as the DINTs.

6
Tips & Tricks / Re: AdvancedHMI on a Tablet
« on: February 28, 2016, 10:51:16 AM »
I see this is an old thread but this is what introduced me to AdvancedHMI. I am currently tasked with developing a cost effective mobile HMI for an end user. I am using an HP Stream 8 ($85 on Amazon) that comes with Windows 8.1 but upgradable to Windows 10. I have got started the development and testing and am really pleased with the results so far.

7
Well, I am still at it trying to figure out how to get the Data I need from the PLC in a timely fashion. I need to get about 80 strings and 80 DINTs from a CLX Processor on about a 500ms update time at the most. I have tried a few methods I have read about here on the boards but can't seem to get it quit right. I upgraded to 399d to get the new DataSubscriber2 also.

DataSubscriber2
This seems to work ok, as long as I keep my NumberOfElements low. It does OK at 5, but not so much at 20:
 Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        Dim PlcAddressItem3 As MfgControl.AdvancedHMI.Drivers.PLCAddressItem = New MfgControl.AdvancedHMI.Drivers.PLCAddressItem()

        PlcAddressItem3.LastValue = Nothing
        PlcAddressItem3.NumberOfElements = 5
        PlcAddressItem3.PLCAddress = "Program:Kit_Data1.Sheet1Bins[0]"
        PlcAddressItem3.ScaleFactor = 1.0R
        PlcAddressItem3.ScaleOffset = 0.0R
        PlcAddressItem3.SubscriptionID = 0

        DataSubscriber21.PLCAddressValueItems.Add(PlcAddressItem3)


        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataReturned
        Label5.Text = e.Values(0)
        Label6.Text = e.Values(1)
        Label7.Text = e.Values(2)
        Label8.Text = e.Values(3)
        Label9.Text = e.Values(4)
    End Sub

EthernetIPforCLXCom1.Read:
Seems to be slower that DataSubscriber2. I realize my destinations are the same on the last 15, just testing speed

        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[0]")
        Label6.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[1]")
        Label7.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[2]")
        Label8.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[3]")
        Label9.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[4]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[5]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[6]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[7]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[8]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[9]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[10]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[11]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[12]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[13]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[14]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[15]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[16]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[17]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[18]")
        Label5.Text = EthernetIPforCLXCom1.Read("Program:Kit_Data1.Sheet1Bins[19]")


Any suggestions on a good way to do this? Any help is appreciated.

8
WOW! That did it. I just changed my button to point to PLCIPAddress and away it went. I did notice that there has to be some value in the IPAddress Property from the Property Viewer (even just a "1"), if not it bombs out. Thanks for all of your help. I've on been at VB for 3 days in my spare time now and this was killing me. I'm only about 3.5 hours into Bob Tabor's videos from YouTube for VB Beginners.

Now I'm off to the concatenating of a string to address a PLC Variable using the DataSubscriber2.

Thanks again,

Tim

9
Promise not to laugh. Like I said I am new to VB.


Public Class Form_Template

    Public _plcAddress As String

    Private Sub Template_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        CycleTimeACC.Text = "0"
        CycleTimePRE.Text = "0"
    End Sub


    'Sub setIP()

    '    EthernetIPforCLXCom1.IPAddress = _plcAddress
    'End Sub
    'Dim _current As String
    'Public Property EthernetIPforCLX(IPaddress)
    '    Get
    '        Return _current
    '    End Get
    '    Set(ByVal _plcAddress)
    '    End Set
    'End Property

    Public Sub CycleTimeACC_Click(sender As Object, e As EventArgs) Handles CycleTimeACC.TextChanged ', CycleTimeACC.Click

    End Sub

    Public Sub CycleTimePRE_Click(sender As Object, e As EventArgs) Handles CycleTimePRE.TextChanged ', CycleTimeACC.Click

    End Sub
    Private Sub CycleTimeACC_TextChanged(sender As Object, e As EventArgs) Handles CycleTimeACC.TextChanged ', CycleTimeACC.Click
        Dim pre As Double = CDbl(CycleTimePRE.Text)
        Dim acc As Double = CDbl(CycleTimeACC.Text)
        If acc > pre * 0.7 Then
            CycleTimeACC.ForeColor = Color.Yellow
            If acc >= pre Then
                CycleTimeACC.ForeColor = Color.Red
            End If
        Else
            CycleTimeACC.ForeColor = Color.White
        End If
        Label2.ForeColor = CycleTimeACC.ForeColor
        Label4.ForeColor = CycleTimeACC.ForeColor
    End Sub

    Private Sub StackLight_Click(sender As Object, e As EventArgs) Handles StackLight.Click

    End Sub


    Private Sub EthernetIPforCLXCom1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.DataReceived
    End Sub



    Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
        ReadPLC1.Text = CStr(e.Values(0)) & ": " & CStr(EthernetIPforCLXCom1.IPAddress)
    End Sub



End Class

10
Support Questions / Newbie Questions about DataSubscriber2 and IPAddress
« on: February 25, 2016, 05:24:52 PM »
Hello everyone,

Let me start off by saying that I am not trying to be a schmooze but I am extremely impressed by HMIAdvanced and the amount of support in the Forums as I have been developing my first distribution and reading through the topics. I am an experienced Controls Engineer but new to VB as when I went to school Quick Basic was all that was offered and I haven't had the time to get back into it since.

I have a scenario where there are 5 different CLX processors on 5 different machines, but all with modular programming and running the exact same portion of code that I wish to access. There is a base program called say 'Data_x' which uses only program level tags with some aliasing to a few controller level tags for I/O and 'Data_x' is called up to four times in the PLC with different instances (Data_1, Data_2...). I need one screen to display about 80 strings and 80 DINTs plus a few other objects. The screen should be identical between the machines. My goal is to develop one screen and set the IP Address for the CLX and the prefix (program name) of the tags with a button push. I could then have only one form but parameterized by 20 buttons. Is something like this possible?

I have tried to pass the IPAddress into the Sub but keep bombing out when m_IPAddress is for some reason blank. I sucessfully get it to the 2nd form but the EthernetIPforCLXCom stops and throws an error.

As I mentioned earlier I also would like to pass down the program name and then build a string to use for getting the PLC data. I have done some direct(literal) addressing with the BasicLabel and gotten a good looking screen but the update time seems a bit sluggish and I haven’t figured out how to build the sting to set the variable address. Is it possible? Would I be better served using the DataSubscriber2 I have read about? I have used it also a little bit with direct addressing but am having trouble getting the Form to update to show changes in the PLC unless I click on the label.

Pages: [1]