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 - kf4ozb

Pages: [1] 2
1
Support Questions / Re: Parameter files
« on: December 15, 2016, 02:34:09 PM »
Just realized I'm a few revisions behind... You may have already taken care of what I had to copy in the new release.

2
Support Questions / Re: Parameter files
« on: December 15, 2016, 02:32:00 PM »
You can copy it with some caveats...

The SetPropertiesByIniFile subroutine the Utilities.vb in the drivers module had to be copied to the Utilities.vb in the Controls Module and the IniParser.vb had to be copied into the AdvancedHMIControls\Common folder.  There may be a more elegant way to accomplish this, but this works for now.

Also the Implements System.ComponentModel.IComponent, Implements System.ComponentModel.ISupportInitialize lines in the class definition were inserted in the component class.


3
Support Questions / Parameter files
« on: December 15, 2016, 08:35:47 AM »
I've searched the boards, and if the solution to this is here I over looked it. 

What I'm wanting to do is create a single form that gets a parameter file passed to it. The parameter file would contain indexed tags that would be distributed to controls upon loading the form.

 I can create a form for each "station" but this is really inefficient. The ability to have one form whose tag references change based on an INI file would be very beneficial.  Is this something AdvancedHMI can do currently?  If not, I'll try to develop a solution and submit it for inclusion in to the next release for AdvancedHMI. Do you have any recommendations on how to go about implementation?

I'm currently leaning toward adding a property to the FormChangeButton Control that specifies the INI file.  Then maybe a subroutine in a module file that can be called on form load that will iterate over a collection of objects in the target form that does a search and replace for the index with tag.


4
Open Discussion / Re: Version 3.5 Coming Soon
« on: August 09, 2013, 02:51:26 PM »
Thanks for all the hard work Archie!

5
Support Questions / Re: Alarms Logging?
« on: August 06, 2013, 01:10:01 PM »
I'm sure there is a much better way to do this, but it served my purpose.   I have a form that displays a textbox for the user to provide information about why it was neccessary for the schedule to be overridden.  When the send button is press this routine runs which logs the information to a text file on a server. tb_SystemSnapshot is a textbox that is loaded with information about the current system state upon Form load.



Private Sub OverrideReason_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SystemSnapshotTextBox.Text += "System Override: " & User & " " & Date.Now & vbCrLf
        SystemSnapshotTextBox.Text += "Mixer Formula: " & MainForm.MixerFormula.Text & vbCrLf
        SystemSnapshotTextBox.Text += "Filling: " & MainForm.Batch_Filling.Text & vbCrLf
        SystemSnapshotTextBox.Text += "Formula list:" & vbCrLf
        SystemSnapshotTextBox.Text += "[1] " & MainForm.Formula_List_0.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[2] " & MainForm.Formula_List_1.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[3] " & MainForm.Formula_List_2.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[4] " & MainForm.Formula_List_3.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[5] " & MainForm.Formula_List_4.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[6] " & MainForm.Formula_List_5.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[7] " & MainForm.Formula_List_6.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[8] " & MainForm.Formula_List_7.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[9] " & MainForm.Formula_List_8.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[10] " & MainForm.Formula_List_9.Text & vbCrLf
        SystemSnapshotTextBox.Text += "[11] " & MainForm.Formula_List_10.Text & vbCrLf
        SystemSnapshotTextBox.Text += "================================================================================================" & vbCrLf


 Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send.Click
        If UsrReason.Text.Length < 5 Then
            MessageBox.Show("Please enter a description and resend")
            UsrReason.Text = ""
            Exit Sub
        End If
        Dim Datehash As String = Date.Now.ToString.Replace("/", "-")
        Datehash = Datehash.Replace(" ", "")
        Datehash = Datehash.Replace(":", "")

        Dim LogFile As String = "S:\Compound Scheduling\Logs\" + Datehash + ".txt"
        Try
            My.Computer.FileSystem.WriteAllText(System.IO.Path.GetFullPath(LogFile), SystemSnapshotTextBox.Text & UsrReason.Text, True)
        Catch ex As Exception
            MsgBox("An Error occured Saving message")
        End Try




        Me.Close()
    End Sub

I hope this helps.

6
Support Questions / Re: Alarms Logging?
« on: August 06, 2013, 09:38:48 AM »
I've got a sample of where I log every time a machine is put into a certain state.  I'll post it later when I have a chance to open the project up.  It's not really Alarm Logging per say, but it does what I needed it to.

7
Support Questions / Re: Read failed status code -20
« on: July 25, 2013, 11:11:00 AM »
That's what I'm doing.  I only have the one driver. I just change it's IP to read from different PLC's.

8
Support Questions / Re: Read failed status code -20
« on: July 25, 2013, 08:50:43 AM »
It's happening with 3.41. I have not seen this error using basic labels or any other components.  It only occurs when I'm using a ReadSyncrhonous, and previous to the update a ReadAny call.  I have seen these components display "Error getting Tag" and then eventually populate data though.

The frequency varies. I've had instances where I get the error multiple times back to back, and other instances where only one error occurs.  As stated previously I stumbled accross a way to cause the error every single time the read is called, simply try to read a tag that does not exist.  (i.e. Me.EthernetIPforCLXComm1.ReadSynchronous("aHMI_ROCKS", 1)(0) cause the -20 error if "aHMI_ROCKS" is not defined in the PLC)  I don't think this is the cause of the intermittent -20 error I'm experiencing, because the error is intermittent and if you try to read a non-existent tag it fails continuously.

I believe the components are designed with some error decoding and handling that you don't get when you just use a read command.  Which is fine, if I know how to decode these errors and subsequently handle them.

9
Support Questions / Re: Read failed status code -20
« on: July 24, 2013, 12:03:44 PM »
Ok.. I understand now why I'm getting -20 instead of the error the tag is invalid.  I went through the EthernetIPforCLXComm source and found that in the Subroutine 'DataLinkLayer_DataReceived'  a comparison is made to see if the data received was an internal request.  A ReadSynchronus call is sent with the InternalRequest property set to false.

The code that is being run when this occurs is below:

            '*****************************
            '* Failed Status was returned
            '*****************************
            Dim d() As String = {DecodeMessage(StatusByte) & " CIP Status " & StatusByte}
            If Not PLCAddressByTNS(e.TransactionNumber And 255).InternalRequest Then
                If Not DisableEvent Then
                    Dim x As New MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs(d, PLCAddressByTNS(e.TransactionNumber And 255).TagName, e.TransactionNumber And 255)
                    If m_SynchronizingObject IsNot Nothing Then
                        Dim Parameters() As Object = {Me, x}
                        m_SynchronizingObject.BeginInvoke(drsd, Parameters) 

                    Else
                        'TODO : This should raise the Com Error event
                        RaiseEvent DataReceived(Me, x)
                    End If
                End If
            Else
                For i As Integer = 0 To SubscriptionList.Count - 1
                    If SubscriptionList(i).PLCAddress.TagName = PLCAddressByTNS(e.TransactionNumber And 255).TagName Then
                        m_SynchronizingObject.BeginInvoke(SubscriptionList(i).dlgCallBack, New Object() {d})
                    End If
                Next
            End If

The lines in Green are the code that is being evaluated when I receive the -20 error. Ultimately, it seems to me different information is returned when the request is external vs an internal request.   The question is then, how do I get a more detailed reason of why the read failed?  Can this be done just by making the Internal Request Property True?


10
Support Questions / Re: Read failed status code -20
« on: July 24, 2013, 10:14:03 AM »
Archie,

I was setting up a spare PLC to test this program on and I accidentally stumbled across a condition that causes this read failed status code -20 EVERY time.  Apparently, if you try to read an address with ReadSynchronous that does not exist this error is thrown.  I'm looking through your components now to see how you handle tags that do not exist. 

I don't know if this is the root cause of the -20 error that I've been experiencing.  I don't really think that it is, because if it were I would receive this error every time I clicked the schedule button, which runs my code. 

I'll let you know what else I find.

11
Support Questions / Re: Read failed status code -20
« on: July 18, 2013, 04:29:10 PM »
That's what I was thinking.  I'll try that and report back.

12
Support Questions / Re: Read failed status code -20
« on: July 18, 2013, 03:57:04 PM »
Hmm.  Well now that you mention it. My main form stays visible and it has about 14 indicators on it, that would continue to poll the system.  If I disable the subscriptions to the communications driver, it should stop the advancedHMI components from polling the plc. Correct?  Can you still make ReadSynchronous calls 'manually' with the subscriptions disabled, or do I need to use another driver on my sub form?

Thanks for the input!

13
Support Questions / Re: Read failed status code -20
« on: July 18, 2013, 03:13:07 PM »
I'm not using a control to read the information. I'm using the ReadSynchronus function.  However; I do have it in a for loop with no delay,( other than the processing time it takes to iterate through the loop).  I will try adding a sleep at the end of the for loop to give the PLC some breathing room and report back the results.

Do you have any recommendations for the time spacing between requests?

Thanks,

Mickey

Here is the code:

 Dim t As String
        Dim Read As Boolean

        For i = 0 To 23
            Read = False
            While Not Read
                Try
                    't = frm_csMain.EthernetIPforCLXComm1.ReadAny(Formula_List(i))

                    t = frm_csMain.EthernetIPforCLXComm1.ReadSynchronous(Formula_List(i), 1)(0) ' Updated to ReadSynchronus as bug fix from Advanced HMI 3.4
                    If t = "$00$00$00$00$00$00$00$00$00$00" Then t = ""
                    If isFormulaValid(t, CompoundNumber) Then   'Check to see if formula read is a vaild formula
                        Read = True
                        If t <> "" Then                         'If Valid and set disable control
                            With ControlArray(i)
                                .Enabled = False
                                .SelectedText = t
                            End With

                        Else
                            ControlArray(i).Enabled = True
                        End If
                    End If

                Catch ex As Exception
                    MsgBox(ex.ToString)
                    Exit For
                End Try

''''''ADDING THIS TO SEE IF IT FIXES THE ISSUE'''''''
               Sleep (100)
''''''END ADDITION'''''''

            End While


        Next

14
Support Questions / Read failed status code -20
« on: July 17, 2013, 11:16:12 AM »
Hiya Archie,

I have a form that has approximately 24 Comboboxes on it that I am populating using the new ReadSynchronous function (Which to this point seems to have fixed the previous sequence numbers being returned, Great job to those who contributed to the fix! ).  That being said I do seem to be getting a lot of read failures that return a value of -20.  I doubt this has anything to do with the new function.  More likely it's due to my network.

I traced this back to the WaitForResponse function.  Basically, if I understand the function, you are waiting for 1 second for a response.  If no response is received you return the error value of -20.

My questions are. What network topology was the current MaxTicks value optimized for?  Do you have an algorithm for determining a value based on different topologies?

Thanks again!

15
Support Questions / Upgrading from 3.26 to 3.40
« on: June 29, 2013, 08:50:24 AM »
Archie,

  Thanks for the update. I look forward to testing it.  I'm curious though what the standard method of upgrading the core advancedHMI is.  Do you copy the contents of the zip file into your project folder and rebuild, or setup a new project using the new core files then import all of your custom code into the new project.

  I haven't seen anything on the forum regarding this. If I've overlooked it I apologize.

Thanks,

Mickey

Pages: [1] 2