Option Explicit Dim g As SWXRuntimeLib.Global ------------------------------------------------------------- Public Sub NewScript(td As TriggerData) On Error GoTo ErrHandler ' TODO: Add your code here g.ConsoleMsg MSG_INFO_VERBOSE, "Script", "Script Triggered" Dim TimeStamp1 As Date TimeStamp1 = Now() 'use raw date-time format for inserting into SQL Table DateTime column ' Motor Data variable declarations Dim WindingNo As String, WindingNoTrim As String, MachineSrNo As String, MachineSrNoTrim As String Dim ModelNo As String, FGCode As String, OperatorName As String, DateTimeInfo As String Dim RatedSpd As Integer, EncoderPPR As Integer, InvSwFreq As Integer Dim RatedI As Double, RatedT As Double, RatedF As Double, StallI As Double ' No Load Test variable declarations Dim RY_L...
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...