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

Pages: [1]
1
Support Questions / Re: BasicDataLogger2 sql database
« on: August 23, 2017, 06:26:50 AM »
Quote
Private Value1, Value2 as string
 Private Sub BasicDataLogger21_DataReturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles BasicDataLogger21.DataReturned
        if e.PLCAddress=BasicDataLogger21.PLCAddressValueItems(0).PLCAddress Then
                 Value1=e.Values(0)
        ElseIf e.PLCAddress=BasicDataLogger21.PLCAddressValueItems(1).PLCAddress Then
                  Value2=e.Values(0)
        Else
           Using t As New DataSet.logDataTable, ta As New DataSetTableAdapters.logTableAdapter
               t.AddlogRow(t.NewRow)
               t(0).c1 = Value1
               t(0).c2 = Value2
               t(0).c3 = e.Values(0)
               ta.Update(t)
           End Using
       End If
 End Sub

Thanks Archie!

This worked great.

2
Support Questions / BasicDataLogger2 sql database
« on: August 22, 2017, 07:10:39 PM »
Using BasicDataLogger2 I'm inserting a row in MySql. I wish each PLC value that's in the PLCAddressValueItems would be inserted into one row. The issue is that each row contains one PLC value that alternates between the three values.

Can I make BasicDataLogger2 insert multiple columns into sql?

The three PLC value's are (Value1, Value2, and Value3) and the three MySql columns are (c1, c2, and c3).

Here is the code I'm using:

    Private Sub BasicDataLogger21_DataReturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles BasicDataLogger21.DataReturned
        Using t As New DataSet.logDataTable
            t.AddlogRow(t.NewRow)
            t(0).c1 = e.Values(0)
            Using ta As New DataSetTableAdapters.logTableAdapter
                ta.Update(t)
            End Using
        End Using
    End Sub

I'm using Windows 10 Pro, Visual Studio 15.3.2, and AdvancedHMI v399x.

Thanks!

Pages: [1]