Author Topic: Add to column the value inBasicDataLogger2  (Read 648 times)

paaaaal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Add to column the value inBasicDataLogger2
« on: January 19, 2022, 07:45:00 AM »
Hello,

I want to seperate my datas in the excel file what the BasicDataLogger made. How can I add every data to different column?

Private Sub StoreValue()
        Try
            If Not m_PauseLogging Then
                Dim StringToWrite As String = m_Prefix
                If m_TimeStampFormat IsNot Nothing AndAlso (String.Compare(m_TimeStampFormat, "") <> 0) Then StringToWrite &= Date.Now.ToString(m_TimeStampFormat)
                For Each item In PLCAddressValueItems
                    If item.ScaleFactor = 1 Then
                        StringToWrite &= "  " & item.LastValue
                    Else
                        Try
                            StringToWrite &= "  " & item.LastValue * item.ScaleFactor
                        Catch ex As Exception
                            StringToWrite &= "," & "INVALID-Check scale factor-" & item.LastValue
                        End Try
                    End If
I think, I need here to write to add the value the new colum.
                Next
                sw.WriteLine(StringToWrite)
                sw.Flush()
            End If
        Catch ex As Exception
        End Try
    End Sub

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: Add to column the value inBasicDataLogger2
« Reply #1 on: January 19, 2022, 07:57:13 AM »
Wouldn't this be done when you open in Excel by specifying the file is a CSV (comma separated)?

paaaaal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Add to column the value inBasicDataLogger2
« Reply #2 on: January 19, 2022, 08:48:05 AM »
yes it is CSV