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

Pages: [1]
1
Open Discussion / Re: Siemens S7 driver
« on: January 31, 2023, 09:49:45 AM »
I use the attached driver with great success in my plant with over 50 S7-300 PLCs, So far only for machine interface and data acquisition but it seems very stable. I have not tested with a 1200 yet but I will be soon and post my findings.

(Not My Driver, I found it in the forums) If this is not allowed please feel free to delete.

2
Open Discussion / Re: Siemens driver development for AdvancedHMI
« on: January 31, 2023, 09:47:04 AM »
I see this is an old topic and I'm sure this has been resolved, but I use the attached driver with great success in my plant with over 50 S7-300 PLCs, So far only for machine interface and data acquisition but it seems very stable.

(Not My Driver, I found it in the forums) If this is not allowed please feel free to delete.

3
Support Questions / Re: Advanced HMI and Visual Studio
« on: September 20, 2022, 08:54:30 AM »
I know this topic is older but any reason whey we cant use VS 2022 now that its out and stable?

4
Support Questions / Data Logging in database
« on: August 31, 2022, 10:19:09 AM »
I am using a datasubscriber (or at least I think I am)lol to capture values in an array and display them. I am currently using the PLC as my data logger with the array being 1000 in depth. I would like to start using a DB now that we have a server we can run the software on 24-7

Without rewriting my entire code how can I get the data to the database?

Public Class MainForm
    Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        BasicLabel1.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,23]")
        BasicLabel2.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,22]")
        BasicLabel3.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,21]")
        BasicLabel4.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,20]")
        BasicLabel5.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,19]")
        BasicLabel6.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,18]")
        BasicLabel7.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,17]")
        BasicLabel8.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,16]")
        BasicLabel9.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,15]")
        BasicLabel10.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,14]")
        BasicLabel11.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,13]")
        BasicLabel12.Text = EthernetIPforCLXCom1.Read("BH_Level_Below_Ground_History[1,12]")

     Thanks for the help, i am open to any of the DB software but the easiest would be best.

5
Open Discussion / Re: Driver Siemens with Snap7
« on: June 14, 2022, 04:23:10 AM »
I know this thread is almost a year old but had there been any more development on this driver? Has it been tested with S7-300? As our company has been growing over the years all our new equipment has been coming in from Germany and its all Siemens..

Thanks

6
Support Questions / Re: DateTimePicker or MonthCalendar to PLC Tag
« on: March 24, 2022, 03:58:31 PM »
I Got it, Little digging and came up with this and it works perfect..
Label1 is just for a test to see the change..

 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Label1.Text = DateTimePicker1.Value.ToShortDateString()
        EthernetIPforCLXCom1.Write("DateStringHMI", DateTimePicker1.Value.Date)
    End Sub

Thanks

7
Support Questions / DateTimePicker or MonthCalendar to PLC Tag
« on: March 24, 2022, 02:26:10 PM »
Hey guys,

Wondering if anyone has implemented a MonthCalendar or a DateTimePicker in to a CLX project..

Want to figure out how I could get one of them to write to a tag in my PLC.

Thanks

8
Sorry to be a pest here, I have looked at all the links and read a lot of posts but I still cant make heads or tails of the datasubscriber2 code for MS SQL. I was wondering if someone could help me out and convert the below code to a datasubscriber2, My trigger bit will be BH_Mon_Bit[20] and will fire all 3 at the same time if possible..
Thanks for looking,

Private t As New TestDBDataSet.ShepleyDataTable
    Private Sub DataSubscriber1_DataReturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataReturned
        If t.Count = 0 Then
            t.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                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.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                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.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                ta.Update(t)
                t.Clear()
            End Using
        End If

    End Sub


9
Thanks so much for all the help.. Loving the software so far..

10
Ok so I was able to make it work by creating the system time in to a string then writing it to the DB.

How would I be able to make all this trigger off an input instead of datasubscriber and driver timer? I have a 30 minute timer in the PLC with a tag just need help getting the 4 items to log off of the 1 timer.

Thanks in advance.

11
ok so I have some data recording in to MS SQL but my issue is now that my database datetime column stopped populating in the server. I have an auto index and a datetime field that was populating for the first 147 entries Index still works fine.

 Is there a way I can force a datetime from the code?

    Private t As New TestDBDataSet.ShepleyDataTable
    Private Sub DataSubscriber1_DataReturned(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataReturned
        If t.Count = 0 Then
            t.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                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.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                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.AddShepleyRow(t.NewRow)
        End If

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

        If Not t(0).IsBH1Null And Not t(0).IsBH2Null And Not t(0).IsBH3Null Then
            Using ta As New TestDBDataSetTableAdapters.ShepleyTableAdapter
                ta.Update(t)
                t.Clear()
            End Using
        End If

    End Sub



I created my DB with this code and as i said it was populating then stopped..

CREATE TABLE Shepley (
    ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
    DataDateTime DATETIME DEFAULT CURRENT_TIMESTAMP,
    BH1 nchar(10),
    BH2 Nchar(10),
    BH3 nchar(10),
    BH4 Nchar(10),
    BH5 nchar(10),
    BH6 Nchar(10),
    BH7 nchar(10),
    BH8 Nchar(10),
    BH9 nchar(10),
    BH10 Nchar(10),
    BH11 nchar(10),
    BH12 Nchar(10),
    BH13 nchar(10),
    BH14 Nchar(10),
    BH15 nchar(10),
    BH16 Nchar(10),
);



147   2022-03-16 13:10:22.813   29.445       27.86        21.962        NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL

148   NULL   26.445       27.8         22.125        NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL   NULL


12
Thanks so much for the reply, Ill try installing Mysql instead of MS SQL as most the sample code I find does not use MS SQL.
But I may just need to have my customer purchase something like Ignition as they need a reliable tool for keeping water table records..

13
Hello team,    8)
Love the project and am having a blast with it..

I have created a display with some live data in fields and a couple trending tables, all live..

I am wanting to get 4 bits logged in to a MS SQL server every hour. I have followed a video I found on YouTube and am able to log 1 tag from the PLC every 5 seconds no problem but I need every hour witch I think can do with a GSV and trigger bit from my CLX plc, I have now added more columns to my DB and need to get data to them. Would I need to do multiple datasubscribers or can it all be completed in 1?
Can someone please help with the code?

Pages: [1]