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

Pages: 1 ... 40 41 [42] 43
616
It works with TimeInterval. But when I change to DataChange type and change the value of my PLC tag, I dont see it record any value. TIA.


617
Application Showcase / Re: Concrete Line #2
« on: September 14, 2015, 03:26:07 PM »
Yes, Dataman 200 series or newer one 300 series are ethernet capable.

618
Application Showcase / Re: Concrete Line #2
« on: September 12, 2015, 01:31:30 PM »
Looks great! Thank You.

btw, What version is  .acd file?  I have up to V20. What kind of barcode reader , I dont see it listed in the BOM.

619
Open Discussion / Re: Ethernet CLX not working on multi-form applications.
« on: September 11, 2015, 11:47:13 PM »
Good news! they ( and others) also have a property IsConnected to check for PLC connected before writing tag.  You have  ConnectionEstablished event. Right now I used that and set boolean PLCIsConnected to true.

620
Open Discussion / Re: How Fast is AdvancedHMI?
« on: September 10, 2015, 12:10:58 PM »
Very cool! Super!! Let's call it AAHMI from now on.

621
I see, I was using the the default Alarm.txt, it did not have that color feature. thanks

622
To change the background color per message basis:
Code: [Select]
Private Sub MessageDisplayByValue1_ValueChanged(sender As Object, e As AdvancedHMI.Controls.ValueChangedEventArgs) Handles MessageDisplayByValue1.ValueChanged
        If MessageDisplayByValue1.Value = 1 Then
            MessageDisplayByValue1.BackColor = Color.Blue
        End If
        If MessageDisplayByValue1.Value = 2 Then
            MessageDisplayByValue1.BackColor = Color.Yellow
        End If
    End Sub

623
I tried the following without success:

Code: [Select]
Private Sub MessageDisplayByValue1_TextChanged(sender As Object, e As EventArgs) Handles MessageDisplayByValue1.TextChanged
        MessageDisplayByValue1.HighlightColor = Color.Yellow
    End Sub

624
Open Discussion / Re: How Fast is AdvancedHMI?
« on: September 10, 2015, 09:17:58 AM »
I wish I could test this for you. I have an L24ER and I7-2760QM, but my Ingear license just expired!

625
Open Discussion / Re: Ethernet CLX not working on multi-form applications.
« on: September 10, 2015, 08:54:45 AM »
I take it the Taglist is still not working. the latest version 3.99 now gives me an error "Object reference not set to an instance of an object".
Does the Taglist only get Controller tags supposedly?  Ingear has a similar UploadTags , but it also get ProgramList first.
Code: [Select]
Try
Dim MyPLC As New Controller()
Dim MyTag As Tag
MyPLC.IPAddress = "192.168.1.40"
' connect to plc
If MyPLC.Connect()<> ResultCode.E_SUCCESS Then
MessageBox.Show(MyPLC.ErrorString)
Return
End If
' upload tags
If MyPLC.UploadTags()<> ResultCode.E_SUCCESS
MessageBox.Show(MyPLC.ErrorString)
Return
End If
' get program list
Dim programList As ReadOnlyCollection(Of Logix.Program) = MyPLC.ProgramList
' iterate through program
For Each program As Logix.Program in programList
' get list of TagTemplates
Dim templateList As ReadOnlyCollection(Of TagTemplate) = program.TagsItems()
' iterate through all templates in program
For Each item As TagTemplate In templateList
If item.Name = "SomeTag" Then
MyTag = item.ToTag()
End If
Next
Next
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try

626
Support Questions / Re: DataSubscriber1 and BeginRead DINTArray
« on: September 10, 2015, 07:44:13 AM »
Make logical sense. Thank You again!

627
Support Questions / DataSubscriber1 and BeginRead DINTArray
« on: September 09, 2015, 05:32:14 PM »
I have a DataSubscriber1 and I set a boolean triggerbit in its PLCAddressvalue. Then in DataChanged i set BeginRead of a DINTArray[10], but it only show the first value is being read. Nothing show up on label4 and 5. TIA.


Code: [Select]
    Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged       

        EthernetIPforCLXCom1.BeginRead("TempDINTArray[0]", 3)

    End Sub

    Private MyValue As String
    Private Sub EthernetIPforCLXCom1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.DataReceived
       
        If e.PlcAddress = "TempDINTArray[0]" Then
            MyValue = e.Values(0)
            Label3.Text = e.Values(0)
        End If
        If e.PlcAddress = "TempDINTArray[1]" Then
            Label4.Text = e.Values(0)
        End If
        If e.PlcAddress = "TempDINTArray[2]" Then
            Label5.Text = e.Values(0)
        End If
    End Sub

628
Support Questions / Re: Barcode Scanner and FormChange button
« on: September 08, 2015, 08:25:51 PM »
Thank You Archie.  From what I read, KeyPress event is old school, ProcessCmdKey is better, I found this code , it works for me as well , but I do not understand the (6) and (1) purpose in the code below:
Code: [Select]
    Private scannedBarcode As String = String.Empty
    Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Select Case keyData
            Case Keys.A To Keys.Z
                Me.scannedBarcode &= keyData.ToString()
            Case Keys.NumPad0 To Keys.NumPad9
                Me.scannedBarcode &= keyData.ToString()(6)
            Case Keys.D0 To Keys.D9
                Me.scannedBarcode &= keyData.ToString()(1)
            Case Keys.Return, Keys.Enter
                Me.ValidateScannedBarcode()
                Me.scannedBarcode = String.Empty
                Return True
            Case Keys.Back AndAlso scannedBarcode.Length > 0
                Me.scannedBarcode = Me.scannedBarcode.Substring(0, scannedBarcode.Length - 1)
            'Case Keys.Escape
             '   Me.Close()
            Case Else
                'do nothing?
                Return MyBase.ProcessCmdKey(msg, keyData)
        End Select

    End Function

    Sub ValidateScannedBarcode()
        Dim pattern As String = "[R]{1}[2]{1}[N]{1}[MPW]{1}[A-Z0-9]{4}"   '//R2NP1234

        Dim regex As Regex = New Regex(pattern)
        If (scannedBarcode.Length = 8) AndAlso (regex.IsMatch(scannedBarcode)) Then
            If PLCIsConnected Then
                EthernetIPforCLXCom1.Write("FromPC.Barcode", scannedBarcode)
            End If
            Label1.Text = scannedBarcode.ToString()
        End If

    End Sub

629
Support Questions / Barcode Scanner and FormChange button
« on: September 08, 2015, 05:27:31 PM »
In the past, I was using the RTA module from Real Time Automation to read barcode scanning directly into CompactLogix, but with ADHMI,  I can now read or type in the barcode from PC, then pass it on to PLC.
First, I set the KeyPreview in the MainForm_Load, then using KeyPress event to catch the content of barcode and check for valid expression using regular expression.
It works fine until I added a FormChange button to go Form2, since many scanners come with the default setting of sending CR key, now after scanning the barcode, it then open Form2. I like to avoid reprogramming the scanner not to send CR key since it is default setting.
Any ideas of avoiding this situation?  TIA.


Code: [Select]
Private Sub MainForm_KeyPress(sender As Object, e As KeyPressEventArgs)

        e.KeyChar = Convert.ToChar(e.KeyChar.ToString().ToUpper())
        Dim pattern As String = "[R]{1}[2]{1}[N]{1}[MPW]{1}[A-Z0-9]{4}"   '//R2NP1234

        Dim regex As Regex = New Regex(pattern)

        If ((e.KeyChar >= ChrW(48) And e.KeyChar <= ChrW(57)) Or (e.KeyChar >= ChrW(65) And e.KeyChar <= ChrW(90))) Then
            If ((barcodeSerial.Length = 0) And (e.KeyChar = "R")) Then
                barcodeSerial = barcodeSerial + e.KeyChar.ToString()
                Label2.Text = barcodeSerial.ToString()

            ElseIf ((barcodeSerial.Length > 0) And (barcodeSerial.Length < 8)) Then
                barcodeSerial = barcodeSerial + e.KeyChar.ToString()
                Label2.Text = barcodeSerial.ToString()
            End If
        End If
        If ((e.KeyChar = ChrW(8)) And (barcodeSerial.Length > 0)) Then           '//if mistake, use the backspace key
            barcodeSerial = barcodeSerial.Substring(0, barcodeSerial.Length - 1)
            Label2.Text = barcodeSerial.ToString()
        End If
        If (regex.IsMatch(barcodeSerial)) Then
            BasicLabel1.Text = barcodeSerial.ToString()
            EthernetIPforCLXCom1.Write("FromPC_Barcode", barcodeSerial)
        End If
       

    End Sub

630
Support Questions / Re: VS2015 and .NET framework 4.6
« on: September 08, 2015, 10:22:41 AM »
" ..XP that will not work beyond .NET 4.0" . I didn't know that. That's GotCha MS. >:(

Pages: 1 ... 40 41 [42] 43