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

Pages: [1]
1
Support Questions / Re: How to add a serial port selection dropdown or menu
« on: November 02, 2022, 09:06:37 AM »
You could try this.

 Private Sub SerialPort1_ErrorReceived(sender As Object, e As SerialErrorReceivedEventArgs) Handles SerialPort1.ErrorReceived
        Try
            SerialPort1.Close()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles BtnConnect.Click
        Try
            'Remove all the Items in the ComboBox
            For i As Integer = 0 To ComboBox1.Items.Count - 1
                ComboBox1.Items.RemoveAt(i)
            Next
            'Add all the live comports back to the comboBox
            For Each sp As String In My.Computer.Ports.SerialPortNames
                ComboBox1.Items.Add(sp)
            Next

            Try
                'Re Open the com port
                SerialPort1.Open()
            Catch ex As Exception

            End Try
        Catch ex As Exception

        End Try


    End Sub

2
Support Questions / Re: How to add a serial port selection dropdown or menu
« on: September 28, 2022, 06:42:29 PM »
Any Luck?

3
Support Questions / Re: How to add a serial port selection dropdown or menu
« on: September 28, 2022, 09:58:30 AM »
I could show you real quick if you have teamviewer installed. 8435321633.

I drag a button to the form, then a combobox, right click on the form & select view code, then from the drop down list up top select the component (Combox1) then on top right select the event(Combobox1_selectedvaluechanged).  this will put in create the code for you.

Alan

4
Support Questions / Re: How to add a serial port selection dropdown or menu
« on: September 28, 2022, 09:05:52 AM »
Here is some sample code, let me know if you need more.

I created a basic button on the form to click on. (you can change it later)
Also put the "ComboBox1_SelectedValueChanged" event at the end when they select some port.
I always find it easier to select the component at the top,  then select the event, and let it create the event code for you.

Alan.


  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try

            GetSerialPortNames()
        Catch ex As Exception

        End Try
    End Sub

    Sub GetSerialPortNames()


        ' Show all available COM ports.
        For Each sp As String In My.Computer.Ports.SerialPortNames

            'Put them in a combo box
            ComboBox1.Items.Add(sp)
        Next

    End Sub

    Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged

        'When they make a selection code here.

    End Sub

5
Support Questions / Re: 3.58 - Comms are super unstable
« on: September 18, 2013, 06:14:24 PM »
Not to beat a dead horse....  But  I generally try to use the "Event" to evaluate something.

    For instance. if I put a "BasicLabel" on the form named BasicLabel1  (hidden on the form or not).

      I would use the following "Event" to evaluate or call another event etc.

EXAMPLE:
    Private Sub BasicLabel1_TextChanged(sender As Object, e As System.EventArgs) Handles_ BasicLabel1.TextChanged

          try
               if BasicLabel1.Value = 1 then

                  DoThisOtherStuff
                  end if

                Catch ex as Exception
           End try
       End Sub

I try to minimize Loops and sleeping threads..... 

Also I continuously referring back to MSDN for Good Coding Practices.. Using good naming conventions and practices is 1/2 the battle.

http://msdn.microsoft.com/en-us/library/vstudio/h63fsef3.aspx

Good luck....


6
Tips & Tricks / Nice Pass/Fail pilotlight
« on: June 09, 2013, 09:07:55 PM »
Drag a Pilot light onto your form.  Set the "LightColor" property to White.  Then Drag a basiclabel onto the form.   Remove the text in the "Text" property.  Set the "ForeColor" property to the color of your form.  Then in your textchanged event.

 Private Sub LblThrustCollarResults_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LblThrustCollarResults.TextChanged
        Select Case LblThrustCollarResults.Text
            Case 0
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.White
                PLThrustCollarResults.Value = False
            Case 1
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.Green
                PLThrustCollarResults.Value = True
            Case 2
                PLThrustCollarResults.LightColor = AdvancedHMI.Controls.PilotLight.LightColors.Red
                PLThrustCollarResults.Value = True
        End Select

    End Sub


Then move a value of 0,1 or 2 into the basiclabel tag in the plc.


This will give you a green or red Pilotlight for pass and fail.

7
One of the Hard Drives in these HMIs failed.  I am using Solid State Hard Drives from now on (like Archie does).  Just ordered one of these yesterday with SSHD. $1448 from Avalue Technologies.

8
Thanks... Getting ready to do some more for another company.

9
Avalue makes the PC's. I am running Windows 7.
Yes they are touch panels.

10
Application Showcase / 3 Pc's Running AdvancedHMI For Turbo Assembly
« on: March 08, 2013, 09:44:11 PM »
Thought I would share these pics from my last project for assembling turbos.  3 Avalue touch panel PC's running AdvancedHMI. Running flawlessly.

Pages: [1]