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

Pages: 1 ... 3 4 [5] 6 7 ... 95
61
If your computer doesn't have a DB9 port then you might need to get a USB-to-Serial adapter.

AdvancedHMI doesn't have a generic serial driver for communication so you would have to do all the programming yourself and possibly use AdvancedHMI controls and set their values manually.

Other than this, Google is your best friend.

62
Support Questions / Re: Link to Documents pdf
« on: June 29, 2021, 03:22:24 PM »
You need to make sure to set that pdf file to copy to output directory then add a button to the form and use its Click event:


Code: [Select]
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process.Start("QuickStart.pdf")
    End Sub


63
Support Questions / Re: ModRSsim2 and AdvancedHMI
« on: June 29, 2021, 02:55:34 PM »
Since you are experimenting, the first link only suggests that you should always have a BasicLabel control on the form.

That way you can see any errors related to communication with simulator.

64
Support Questions / Re: ModRSsim2 and AdvancedHMI
« on: June 28, 2021, 10:48:27 PM »
In AHMI, you should try setting the IP to "127.0.0.1" and also read this topic:

   https://www.advancedhmi.com/forum/index.php?topic=2479.0

The other topic for you which has another simulator:

   https://www.advancedhmi.com/forum/index.php?topic=2567.0

The last post in it also has a picture of ModRSSim2.
 

65
Open Discussion / Re: tool to convert data types
« on: June 27, 2021, 02:18:25 AM »
There is an updated description in that repository, about dealing with floating-point numbers and using byte logic instead.

67
Additional Components / Re: BasicButton - Multi Address/Value Write
« on: June 16, 2021, 07:30:38 AM »
Your code looks like a mess to me.

The first thing you need to correct is Dim arrData(3) As String, then you have all factors and offsets values reversed and your volume flow address is 40131 but you are assigning a float value of 43.8 to it.

69
Support Questions / Re: keypad min max values
« on: June 12, 2021, 06:19:55 PM »
Just remember that, in general, once you modify the code of any control then all controls of that kind, which you might have on your forms, will adopt that modification.

You can try the modifications as below:

Code: [Select]
    Private Sub KeypadPopUp_ButtonClick(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Controls.KeypadEventArgs)
        If e.Key = "Quit" Then
            KeypadPopUp.Visible = False
        ElseIf e.Key = "Enter" Then
            If String.IsNullOrEmpty(m_KeypadPasscode) Or PasscodeValidated Then
                If m_ComComponent Is Nothing Then
                    DisplayError("ComComponent Property not set")
                Else
                    If Not String.IsNullOrEmpty(KeypadPopUp.Value) Then
                        Try
                            If m_KeypadMaxValue <> m_KeypadMinValue Then
                                If KeypadPopUp.Value < m_KeypadMinValue Or KeypadPopUp.Value > m_KeypadMaxValue Then
                                    System.Windows.Forms.MessageBox.Show("Value must be >" & m_KeypadMinValue & " and <" & m_KeypadMaxValue)
                                    Exit Sub
                                End If
                            End If
                        Catch ex As Exception
                            System.Windows.Forms.MessageBox.Show("Failed to validate value. " & ex.Message)
                            Exit Sub
                        End Try

                        Try
                            If KeypadScaleFactor = 1 Or KeypadScaleFactor = 0 Then
                                m_ComComponent.Write(m_PLCAddressKeypad, KeypadPopUp.Value)
                            Else
                                m_ComComponent.Write(m_PLCAddressKeypad, CDbl(KeypadPopUp.Value) / m_KeypadScaleFactor)
                            End If
                        Catch ex As Exception
                            System.Windows.Forms.MessageBox.Show("Failed to write value. " & ex.Message)
                        End Try
                    End If

                    KeypadPopUp.Close()
                    KeypadPopUp = Nothing
                End If
            Else
                '* A passcode was entered, so validate
                If Not String.IsNullOrEmpty(KeypadPopUp.Value) AndAlso KeypadPopUp.Value = m_KeypadPasscode Then
                    PasscodeValidated = True
                    PromptNewValue()
                Else
                    System.Windows.Forms.MessageBox.Show("Invalid Passcode!")
                    KeypadPopUp.Close()
                    KeypadPopUp = Nothing
                End If
            End If
        End If
    End Sub

    '***********************************************************
    '* If label is clicked, pop up a keypad for data entry
    '***********************************************************
    Protected Overrides Sub OnClick(e As System.EventArgs)
        MyBase.OnClick(e)

        If m_PLCAddressKeypad IsNot Nothing AndAlso (String.Compare(m_PLCAddressKeypad, "") <> 0) And Enabled Then
            If KeypadPopUp Is Nothing Then
                KeypadPopUp = New MfgControl.AdvancedHMI.Controls.KeypadV2(m_KeypadWidth)
                AddHandler KeypadPopUp.ButtonClick, AddressOf KeypadPopUp_ButtonClick
            End If

            If String.IsNullOrEmpty(m_KeypadPasscode) Then
                PromptNewValue()
            Else
                PromptPasscode()
            End If
        End If
    End Sub

    Private Sub PromptNewValue()
        KeypadPopUp.Text = m_KeypadText
        KeypadPopUp.ForeColor = m_KeypadFontColor
        KeypadPopUp.MinValue = m_KeypadMinValue
        KeypadPopUp.MaxValue = m_KeypadMaxValue
        KeypadPopUp.Value = ""
        KeypadPopUp.StartPosition = Windows.Forms.FormStartPosition.CenterScreen
        KeypadPopUp.TopMost = True
        KeypadPopUp.Show()
    End Sub

    Private PasscodeValidated As Boolean
    Private Sub PromptPasscode()
        PasscodeValidated = False
        KeypadPopUp.Text = "Enter Passcode"
        KeypadPopUp.ForeColor = m_KeypadFontColor
        KeypadPopUp.Value = ""
        KeypadPopUp.StartPosition = Windows.Forms.FormStartPosition.CenterScreen
        KeypadPopUp.TopMost = True
        KeypadPopUp.Show()
    End Sub


70
Tips & Tricks / Re: ControlLogix ReadUDT and WriteUDT
« on: June 11, 2021, 11:45:28 PM »
Your code should probably be more similar to this:

Code: [Select]
        public struct TimeUDT
        {
            public int Yr;
            public int Mo;
            public int Da;
            public int Hr;
            public int Min;
            public int Sec;
            public int uSec;
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            var Dates = CLXCom.ReadUDT<TimeUDT>("Dates[0]", 10);
        }


71
Support Questions / Re: ReadUDT with array
« on: June 11, 2021, 11:20:08 PM »
There is some C# here: https://www.advancedhmi.com/forum/index.php?topic=2545.0

You can also try using online converters to convert from VB to C#.

73
Support Questions / Re: Old expansion paks?
« on: May 13, 2021, 10:46:27 PM »
I would suggest you start with a fresh solution in a different folder and then try adding the expansion packs you have.

74
Open Discussion / Re: Driver Siemens with Snap7
« on: May 11, 2021, 04:56:03 PM »
See the attached picture.

75
Open Discussion / Re: Driver Siemens with Snap7
« on: May 10, 2021, 10:46:52 PM »
Instead of adding snap7.dll file to Support/Siemens folder, remove it and then add it directly to the project where your SiemensCom.vb driver is and set it to Copy Always.

Pages: 1 ... 3 4 [5] 6 7 ... 95