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

Pages: 1 2 [3] 4
31
Support Questions / Re: Handle onChange of button state
« on: June 30, 2017, 12:05:22 AM »
I'll take a stab at this....

You want to "click" the button from the plc?
Or just do some event when the plc address' click value changes?

It sounds like you are setting a value with the button and another value is changing the highlight color.

Still, the datasubscriber onchange event should do what you want.
You will need an acknowledgement bit in the plc to set when your click tag is set. The acknowledgement bit should set if the plc received the button click or if the plc requests to change the highlighted color. Use the DataSubscribe to monitor the acknowledgement bit.

And don't be afraid of timers  :)

32
Open Discussion / Re: Custom Component Debugging
« on: June 27, 2017, 09:20:34 PM »
I have it working now. Thank you Archie for the link.

33
Open Discussion / Re: Custom Component Debugging
« on: June 27, 2017, 04:32:38 PM »
Thank you Archie, I will give that read.

I am connected to both scanners and I am receiving the strings from both and they are making it to my MainForm.

Although I am sure they are not gracefully being planted there. lol

I do at times get exceptions that I would like to see where they are goofing up at, hence why I asked.


One other thing while I have your attention Archie, this Cognex Dataman SDK includes events for various different actions. The SDK is wrote in C# and I have not been able to "subscribe" to events like they do.

How would I "subscribe" to a built-in event in an SDK?

I.E.,
Code: [Select]
Cognex.Dataman.SDK.ReadStringArrivedEventArgs
Cognex.Dataman.SDK.ReadStringArrivedHandler

*Edit*

Just had a quick read on Inherited controls and the way you must access the base class.

Code: [Select]

Public Shared Event SystemConnected As Cognex.Dataman.SDK.SystemConnectedHandler 'SystemConnected is an event from the SDK
Private Shared Sub OnSystemConnected(sender As Object, args As EventArgs) Handles cgnxSystem.SystemConnected
**code**
End Sub

34
Open Discussion / Custom Component Debugging
« on: June 27, 2017, 03:11:32 PM »
I have been working on creating a component for a Cognex Dataman BCR using the Dataman SDK.
Initial tests proved that I could add the component, set the IP address in the properties and once the application was started I could start receiving the scanned bar codes in AdvancedHMI.

My question is, I need to add another scanner component to the application. How would I go about debugging the two components separately? I am able to debug the component code during runtime, but it seems it is only showing me the running code for the last declared component. If that makes sense?

*Edit*
Or should the component (in my case), add a .vb file to the Solution Explorer for Scanner1 and Scanner2, respectively?
Since each scanner is it's own entity, it can't necessarily be running from one .vb file? Or can it?

I.E.,
In MainForm.Designer.vb
Code: [Select]
Friend WithEvents Scanner1 As CognexDatamanControl.CognexDataman
Friend WithEvents Scanner2 As CognexDatamanControl.CognexDataman ' Last declared component

Also, shouldn't these be initialized as:
Code: [Select]
Friend WithEvents Scanner1 As New CognexDatamanControl.CognexDataman
Friend WithEvents Scanner2 As New CognexDatamanControl.CognexDataman

Perhaps I do not fully understand how the component is built behind the scenes?

35
Open Discussion / Re: Barcoded Assembly Verification
« on: May 18, 2017, 08:09:57 PM »
I see. Thank you both for sharing.
I found that I have been bouncing control back and forth from the plc to the server and to the .net app.

Centrally controlling the entire thing should be my main goal and going off what you shared, it seems the ideal place is the .net app.

I have the system working and the .net is doing some minor leg work. Mainly just indications.
The PLC along with FTTM are doing the brunt of the work.

36
Open Discussion / Re: Barcoded Assembly Verification
« on: May 17, 2017, 10:33:50 PM »
Thank you gentlemen.

I have been tasked with implementing a low level verification system. I already have the ms-sql server setup on an industrial pc with data I exported from SAP. I am using Factorytalk Transaction Manager to get data from the sql server to the plc. I will be using Advanced HMI to show what is going on.
I am at a roadblock as to how to compare what is scanned to what it should be. Should that be handled in the PLC or should the server be doing that?

As of now, I wait for a new scan to come into the plc. I then decide if it is a package code or a component code. If it's a package, I then copy the result to Factorytalk Transaction Manager and then trigger a transaction from the plc. This trigger sends the package code as a parameter to a stored procedure that will find all component codes that belong to the package code. The component codes are then sent to the plc.

The component codes are what operators will be scanning as they place them into a package. Should they scan a component that does not match the components from the server, the system should fault. Like wise if the same component is scanned twice then also fault. 

If you don't mind sharing, how did you guys manage comparing multiple codes to a database and also keep up with duplicate scans and mismatch scans? It makes me wonder where the line is drawn, as if it should be handled in the plc, the database, or in advancedhmi using vb .net script and linq.

37
Open Discussion / Barcoded Assembly Verification
« on: May 17, 2017, 10:02:51 AM »
Morning folks,

We are getting into tracability of parts and such at our facility and was wondering if anyone else has the same or has implemented a system for that?

What database did you use for part lookup? Any PC software involved? Interfaces to database?

38
Support Questions / Re: CLX EIP Driver No Response From PLC
« on: May 10, 2017, 03:15:22 PM »
I ran the app at 4000ms pollrateoveride and did not get an exception and the data came through as it should have.
Ran it at 2000ms and same result.
Ran it once more at my original 1000ms and same result.

It is working now, but what gives?

I am including two dumps for the 2000ms attempt and the 4000ms attempt. I forgot to save the 1000ms capture.  :-[
 

39
Support Questions / Re: CLX EIP Driver No Response From PLC
« on: May 10, 2017, 09:44:45 AM »
Are you running RSLogix on the same PC? I'm wondering if there are too many requests going to the PLC and it ignores some. A definite way to figure out the problem is to run a Wireshark capture and post it. From that I would be able tell if the request went out and if the PLC responded.

I am on my development pc, but I also transferred the application to the runtime pc (which is too running RsLinx and Factorytalk Transaction Manager) and it did not work. It gave the same exception.

Looking at wireshark, there is a constant polling between my development pc and the plc when the application is running.
The wireshark log that I am attaching starts out without the application running. I then start the application, and then click my Button to read the array. It then throws the No Response From PLC Exception.

UDT image is also included.

40
Support Questions / Re: CLX EIP Driver No Response From PLC
« on: May 09, 2017, 06:29:49 PM »
Yes, latest version.



I did have a datasubscriber assigned to a boolean tag in the plc that would trigger the code you see. I added the button recently just for testing.

The prior method using the DS would throw an exception "No Response From PLC" on this line:
Code: [Select]
stuff = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[0]", 13)
This would occur about four seconds after the application started.

But, you may be suggesting to use the Datasubscriber to physically read the array. I suppose the datasubscriber has a class object that would then hold that array to allow me to do something with it?

41
Support Questions / CLX EIP Driver No Response From PLC
« on: May 09, 2017, 09:55:12 AM »
Trying to read an array of 27 strings that are all standard length. It seems the driver gets hung up on reading anything over 20, so I divided the reads. Sometimes this works and sometimes it doesn't.

I also tried creating another driver to handle one half, and that gave the same results.

Driver is set to 1000 poll rate with 8000 timeout.

Any ideas?

Code: [Select]
Public Class MainForm
    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************
    Private NotFirstShow As Boolean

    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        '* Do not start comms on first show in case it was set to disable in design mode
        If NotFirstShow Then
            AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
        Else
            NotFirstShow = True
        End If
    End Sub

    '***************************************************************
    '* .NET does not close hidden forms, so do it here
    '* to make sure forms are disposed and drivers close
    '***************************************************************
    Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        Dim index As Integer
        While index < My.Application.OpenForms.Count
            If My.Application.OpenForms(index) IsNot Me Then
                My.Application.OpenForms(index).Close()
            End If
            index += 1
        End While
    End Sub

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

        Dim stuff() As String
        Dim junk() As String
        Dim ack As Boolean
        Dim upc As String


        stuff = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[0]", 13)
        junk = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[13]", 14)

        complist.Items.Clear()
        complist.Items.AddRange(stuff)
        complist.Items.AddRange(junk)


        conPLC1.Write("PROGRAM:MainProgram.Station1.resultNewArrivalACK", 1)
        ack = conPLC1.Read("PROGRAM:MainProgram.Station1.resultNewArrivalACK")

        If ack = True Then

            conPLC1.Write("PROGRAM:MainProgram.Station1.resultNewArrivalACK", 0)

        End If



        upc = upclabel.Text.ToString

        If upc.Contains("08856") Then

            If upc.Length = 13 Then

                checklabel.Text = "Scanned Code Is A UPC Number. Transferred To FTTM."

            Else

                checklabel.Text = "Scanned Code Is Not A UPC Number. Copied To Compare Array In PLC."

            End If

        End If
    End Sub
End Class

42
Support Questions / Re: Logging to database VB Question
« on: March 27, 2017, 12:10:22 PM »
In your Data Sources Windows, right click the data source and select Open in Design View

In the table with the problem. click on the particular field, the check the Properties Window to see what the data type is.

Excuse me, I was wrong. The Dataset was set as decimal but the TableAdapter was set to Int32. Issue is fixed now.
Sorry for my ignorance.

43
Support Questions / Re: Logging to database VB Question
« on: March 27, 2017, 09:06:13 AM »
It is decimal.

44
Support Questions / Re: Logging to database VB Question
« on: March 25, 2017, 11:19:06 AM »
Archie's method works as well, but the decimal is still not being transfered to the db. I can manually enter a decimal number in the table and it displays it correctly.

The value displays as a decimal in the application. Not sure what is going on. Anyways, thank you Archie for the tip I appreciate it!

45
Support Questions / Re: Logging to database VB Question
« on: March 25, 2017, 09:51:03 AM »
Im going to try Archie's method here in a bit this morning.
The field in the db is set as data type "Number", Field size "Double", Format "Fixed", Two Decimal Places.

Pages: 1 2 [3] 4