Skip to main content

Posts

Showing posts from April, 2018

ReadScopeCsv

Option Explicit Dim g As SWXRuntimeLib.Global Dim objFSO As Scripting.FileSystemObject Dim objLogFile As Scripting.TextStream Dim client As GENCLIENTWRAPPERLib.client Public Sub ReadScopeCsv(td As TriggerData)     On Error GoTo ErrHandler     ' TODO: Add your code here     ' final code          'create the logging file     Dim TimeStamp1 As String     TimeStamp1 = Format(Now(), "_ddmmyyyyhhnnss")          Dim outputString As String     Dim outputFile As Scripting.TextStream     Dim inputFile As Scripting.TextStream     Const ForWriting = 2     Const ForReading = 1     Set objFSO = CreateObject("Scripting.FileSystemObject")     Set outputFile = objFSO.CreateTextFile("E:\csv\LogBEMF" + TimeStamp1 + ".csv", ForWriting, True)          ' PLC Register to stor...

LogScript19April2018

Option Explicit Dim g As SWXRuntimeLib.Global Dim objFSO As Scripting.FileSystemObject Dim objLogFile As Scripting.TextStream Dim client As GENCLIENTWRAPPERLib.client Public Sub LogResultsScript(td As TriggerData)     On Error GoTo ErrHandler     ' TODO: Add your code here     'update log status     Dim LogCompleteTag As String     Dim dp1 As GENCLIENTWRAPPERLib.datapoint     Set client = CreateObject("GenClientWrapper.Client")     LogCompleteTag = "Mitsubishi.MXOPC.6\fx5u.Log.LOGRESSTAT"     Set dp1 = client.RequestDataPoint(LogCompleteTag, 1000, 0)     dp1.SyncWrite 1                 Dim TimeStamp1 As String, TimeStamp2 As String     TimeStamp1 = Format(Now(), "dd/mm/yyyy hh:nn:ss AM/PM")     TimeStamp2 = Format(Now(), "_ddmmyyyyhhnnss")         Const ForWriting = 2     Set objFS...