Author Topic: datalogger2  (Read 1192 times)

Allan19111911

  • Newbie
  • *
  • Posts: 17
    • View Profile
datalogger2
« on: July 24, 2016, 06:48:31 PM »
Is there a way to get data logger2 to overwrite one group of cells instead of adding another row?    If i can get it to do that i can automate excel to send emails based on certain conditions.  i have that part mostly  figured out.

thanks
Allan

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: datalogger2
« Reply #1 on: July 24, 2016, 06:56:06 PM »
You can do it with a DataSubscriber and a little code:

- Add a DataSubscriber to the form
- Set PLCAddressValue to a address in the PLC
- Double click the DataSubscriber on the form design view. It will take you back to the code
- Enter code something like this:
Code: [Select]
        If e.ErrorId = 0 Then
            Using sw As New System.IO.StreamWriter(".\MyLogFile.txt", False)
                sw.WriteLine(e.Values(0))
            End Using
        End If