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

Pages: [1]
1
Support Questions / Re: Simple BasicDataLogger2 Question
« on: March 04, 2018, 12:46:03 PM »
What does the code look like for when you "do the action". I understand making the conditional statement for the action, but i dont know how to define the action.

2
Support Questions / Re: Basic Data Logger 2
« on: March 02, 2018, 09:39:38 AM »
This is the way i have done that before, just take the "HH-mm" out of the code to make it store to a new file everyday.

Note that this time is coming from the PC this program is running on.

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

        Dim logstamp As String = ".log"
        Dim timeStamp As String = DateTime.Now.ToString("yy-MM-dd-hh-mm")
        Dim Stamp As String

        Stamp = timeStamp & logstamp

        BasicDataLogger2.FileName = Stamp

    End Sub

3
Support Questions / Simple BasicDataLogger2 Question
« on: March 02, 2018, 09:32:14 AM »
I am trying to use the BasicDataLogger2 and the only issue i'm having is that i would like to log the data when "WriteOnBitTrue", but where do i define that bit?

Is it in the properties of the BasicDataLogger2 or do i define it somewhere in the form coding?

Thanks!

4
Support Questions / Re: Heartbeat Signal
« on: February 09, 2018, 11:58:45 AM »
What would i use in AdvancedHMI to constantly write the the ACC though?

I'm unfamiliar with how you would write the code for that.

5
Support Questions / Heartbeat Signal
« on: February 09, 2018, 11:11:08 AM »
I was hoping for some direction on how to make a heartbeat signal between the AdvancedHMI program i have running and a compact logix L18ER processor over ethernet.

I do not want the PLC to be able to run the equipment without communication established.

Thanks!


6
Open Discussion / Re: Reading Data from SQL
« on: November 21, 2017, 08:53:22 AM »
Yes i'm using the tableAdapter, here is a sample of what i'm doing

Code: [Select]
Private Sub DataSubscriber9_Datareturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber9.DataReturned
        If t.Count = 0 Then
            t.AddGE_Test_DataRow(t.NewRow)
        End If

        t(0).LeakDecayData = e.Values(0)

        If Not t(0).Is_DateNull And Not t(0).IsTimeNull And Not t(0).IsBarcodeNull And Not t(0).Is_Cavity_Null And Not t(0).Is_TestCell_Null And Not t(0).IsTestHeadNull And Not t(0).IsTestResultNull And Not t(0).IsPressurePortDataNull And Not t(0).IsLeakDecayDataNull And Not t(0).Barcode = "999" Then
            Using ta As New ControlsDBGETubTableAdapters.GE_Test_DataTableAdapter
                ta.Update(t)
                t.Clear()

            End Using
        End If
    End Sub

Thanks

7
Open Discussion / Reading Data from SQL
« on: November 20, 2017, 10:43:33 AM »
Guys,

Now that I have been having great success using DataSubscribers, i would like to see if there is an easy way to check what info is in the latest row of the database. Or what is the best way for me to make sure that the data i sent to the Database did indeed make it there.

Thanks!

8
Support Questions / Re: Using multiple DataSubscribers
« on: November 10, 2017, 03:38:52 PM »
Now i need to throw a wrench into the DataSubscribers mix, i need to also store a picture in the last column of the DB table. The pictures are being populated by a IP camera that is writing them to a shared folder of the PC that will be running the AdvancedHMI instance. The file location will be something like "C:\Users\Controls\Desktop\Pictures" and the files will be named something like "image-YY-MM-DD-hh-mm-ss.jpg". I just named the column of the table Pic and the data type is set to image.

If anyone could at least have some direction on this topic it would be greatly appreciated, i have seen examples of people writing a picture to a DB  column but i was not sure of what kind of implications there would be while using AdvancedHMI.

Thanks again...

(Also the current code i'm using is posted above)

9
Support Questions / Re: Using multiple DataSubscribers
« on: November 10, 2017, 03:22:43 PM »
If anyone was wondering this was the final code i used to write to a SQL database.

Code: [Select]
    Private t As New ControlsDBDataSet1.StoreData2DataTable

    Private Sub DataSubscriber1_Datareturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataReturned
        If t.Count = 0 Then
            t.AddStoreData2Row(t.NewRow)
        End If

        t(0).Green = e.Values(0)

        If Not t(0).IsDataNull And Not t(0).IsStateNull And Not t(0).IsGreenNull Then
            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)
                t.Clear()

            End Using
        End If
    End Sub


    Private Sub DataSubscriber2_Datareturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber2.DataReturned
        If t.Count = 0 Then
            t.AddStoreData2Row(t.NewRow)
        End If

        t(0).State = e.Values(0)

        If Not t(0).IsDataNull And Not t(0).IsStateNull And Not t(0).IsGreenNull Then
            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)
                t.Clear()

            End Using
        End If
    End Sub

    Private Sub DataSubscriber3_Datareturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber3.DataReturned
        If t.Count = 0 Then
            t.AddStoreData2Row(t.NewRow)
        End If

        t(0).Data = e.Values(0)

        If Not t(0).IsDataNull And Not t(0).IsStateNull And Not t(0).IsGreenNull Then
            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)
                t.Clear()

            End Using
        End If
    End Sub

10
Support Questions / Re: Using multiple DataSubscribers
« on: November 09, 2017, 09:25:31 AM »
Awesome, thanks for the help.

Could you suggest any resources for learning basic .vb coding? or is there already a forum for that...

11
Support Questions / Using multiple DataSubscribers
« on: November 09, 2017, 09:07:30 AM »
I am trying to use multiple DataSubscribers to write to an SQL database. The issue i am having is each one of my DataSubscribers are making a new row instead of writing data to the same row after the first one makes a new row. I'm not sure how to program this logic in .vb.

Here is the code i have:

Code: [Select]
    Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        Using t As New ControlsDBDataSet1.StoreData2DataTable
            t.AddStoreData2Row(t.NewRow)
            t(0).Data = e.Values(0)

            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)

            End Using
        End Using
    End Sub

    Private Sub DataSubscriber2_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber2.DataChanged
        Using t As New ControlsDBDataSet1.StoreData2DataTable
            t.AddStoreData2Row(t.NewRow)
            t(0).State = e.Values(0)

            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)

            End Using
        End Using
    End Sub

    Private Sub DataSubscriber3_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber3.DataChanged
        Using t As New ControlsDBDataSet1.StoreData2DataTable
            t.AddStoreData2Row(t.NewRow)
            t(0).Green = e.Values(0)

            Using ta As New ControlsDBDataSet1TableAdapters.StoreData2TableAdapter
                ta.Update(t)
            End Using
        End Using
    End Sub

I'm sure this is a simple fix.

Thanks

Pages: [1]