Skip to main content

Data Logging Script

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 As Double, YB_L As Double, BR_L As Double
    Dim L_Pass As Boolean, L_Fail As Boolean, L_Enable As Boolean
    Dim L_Result As String
    Dim NL_RY_R As Double, NL_YB_R As Double, NL_BR_R As Double, NLCOLDRTEMP As Double
    Dim NL_R_Pass As Boolean, NL_R_Fail As Boolean, NL_R_Enable As Boolean
    Dim NL_R_Result As String
    Dim NL_L_EQCKT As Double, NL_R_EQCKT As Double
    Dim NL_EQCKT_Pass As Boolean, NL_EQCKT_Fail As Boolean, NL_EQCKT_Enable As Boolean
    Dim NL_EQCKT_Result As String
    Dim NL_Spd As Double, NL_Cur As Double, NL_Vol As Double, NL_PF As Double, NL_IP As Double, NL_Fv As Double, NL_Fi As Double
    Dim NL_Run_Pass As Boolean, NL_Run_Fail As Boolean, NL_Run_Enable As Boolean
    Dim NL_Run_Result As String
    'Back Emf Test variable declarations
    Dim BEMF_CH1_Avg As Double, BEMF_CH2_Avg As Double, BEMF_CH3_Avg As Double
    Dim BEMF_RPM As Double
    Dim BEMF_Pass As Boolean, BEMF_Fail As Boolean, BEMF_Enable As Boolean
    Dim BEMF_Result As String
    'Load Test variable declarations
    Dim LDT_1_Tset As Double, LDT_1_Tact As Double, LDT_1_I As Double, LDT_1_V As Double, LDT_1_PF As Double, LDT_1_IP As Double
    Dim LDT_1_OP As Double, LDT_1_EFF As Double, LDT_1_FI As Double, LDT_1_FV As Double, LDT_1_SPD As Double
    Dim LDT_2_Tset As Double, LDT_2_Tact As Double, LDT_2_I As Double, LDT_2_V As Double, LDT_2_PF As Double, LDT_2_IP As Double
    Dim LDT_2_OP As Double, LDT_2_EFF As Double, LDT_2_FI As Double, LDT_2_FV As Double, LDT_2_SPD As Double
    Dim LDT_3_Tset As Double, LDT_3_Tact As Double, LDT_3_I As Double, LDT_3_V As Double, LDT_3_PF As Double, LDT_3_IP As Double
    Dim LDT_3_OP As Double, LDT_3_EFF As Double, LDT_3_FI As Double, LDT_3_FV As Double, LDT_3_SPD As Double
    Dim LDT_4_Tset As Double, LDT_4_Tact As Double, LDT_4_I As Double, LDT_4_V As Double, LDT_4_PF As Double, LDT_4_IP As Double
    Dim LDT_4_OP As Double, LDT_4_EFF As Double, LDT_4_FI As Double, LDT_4_FV As Double, LDT_4_SPD As Double
    Dim LDT_5_Tset As Double, LDT_5_Tact As Double, LDT_5_I As Double, LDT_5_V As Double, LDT_5_PF As Double, LDT_5_IP As Double
    Dim LDT_5_OP As Double, LDT_5_EFF As Double, LDT_5_FI As Double, LDT_5_FV As Double, LDT_5_SPD As Double
    Dim LDT_6_Tset As Double, LDT_6_Tact As Double, LDT_6_I As Double, LDT_6_V As Double, LDT_6_PF As Double, LDT_6_IP As Double
    Dim LDT_6_OP As Double, LDT_6_EFF As Double, LDT_6_FI As Double, LDT_6_FV As Double, LDT_6_SPD As Double
    Dim LDT_7_Tset As Double, LDT_7_Tact As Double, LDT_7_I As Double, LDT_7_V As Double, LDT_7_PF As Double, LDT_7_IP As Double
    Dim LDT_7_OP As Double, LDT_7_EFF As Double, LDT_7_FI As Double, LDT_7_FV As Double, LDT_7_SPD As Double
    Dim LDT_8_Tset As Double, LDT_8_Tact As Double, LDT_8_I As Double, LDT_8_V As Double, LDT_8_PF As Double, LDT_8_IP As Double
    Dim LDT_8_OP As Double, LDT_8_EFF As Double, LDT_8_FI As Double, LDT_8_FV As Double, LDT_8_SPD As Double

   
    Dim LDT_1_RESULT As Integer, LDT_2_RESULT As Integer, LDT_3_RESULT As Integer, LDT_4_RESULT As Integer, LDT_5_RESULT As Integer
    Dim LDT_6_RESULT As Integer, LDT_7_RESULT As Integer, LDT_8_RESULT As Integer
    Dim LDT_1_RESTXT As String, LDT_2_RESTXT As String, LDT_3_RESTXT As String, LDT_4_RESTXT As String, LDT_5_RESTXT As String
    Dim LDT_6_RESTXT As String, LDT_7_RESTXT As String, LDT_8_RESTXT As String
    Dim LDT_1_ENABLE As String, LDT_2_ENABLE As String, LDT_3_ENABLE As String, LDT_4_ENABLE As String, LDT_5_ENABLE As String
    Dim LDT_6_ENABLE As String, LDT_7_ENABLE As String, LDT_8_ENABLE As String
   
    Dim HR_1_Tact As Double, HR_1_I As Double, HR_1_V As Double, HR_1_PF As Double, HR_1_IP As Double, HR_1_MTEMP As Double
    Dim HR_1_ATEMP As Double, HR_1_TEMPR As Double
    Dim HR_2_Tact As Double, HR_2_I As Double, HR_2_V As Double, HR_2_PF As Double, HR_2_IP As Double, HR_2_MTEMP As Double
    Dim HR_2_ATEMP As Double, HR_2_TEMPR As Double
    Dim HR_3_Tact As Double, HR_3_I As Double, HR_3_V As Double, HR_3_PF As Double, HR_3_IP As Double, HR_3_MTEMP As Double
    Dim HR_3_ATEMP As Double, HR_3_TEMPR As Double
    Dim HR_4_Tact As Double, HR_4_I As Double, HR_4_V As Double, HR_4_PF As Double, HR_4_IP As Double, HR_4_MTEMP As Double
    Dim HR_4_ATEMP As Double, HR_4_TEMPR As Double
    Dim HR_5_Tact As Double, HR_5_I As Double, HR_5_V As Double, HR_5_PF As Double, HR_5_IP As Double, HR_5_MTEMP As Double
    Dim HR_5_ATEMP As Double, HR_5_TEMPR As Double
    Dim HR_6_Tact As Double, HR_6_I As Double, HR_6_V As Double, HR_6_PF As Double, HR_6_IP As Double, HR_6_MTEMP As Double
    Dim HR_6_ATEMP As Double, HR_6_TEMPR As Double
    Dim HR_7_Tact As Double, HR_7_I As Double, HR_7_V As Double, HR_7_PF As Double, HR_7_IP As Double, HR_7_MTEMP As Double
    Dim HR_7_ATEMP As Double, HR_7_TEMPR As Double
    Dim HR_8_Tact As Double, HR_8_I As Double, HR_8_V As Double, HR_8_PF As Double, HR_8_IP As Double, HR_8_MTEMP As Double
    Dim HR_8_ATEMP As Double, HR_8_TEMPR As Double
    Dim HR_9_Tact As Double, HR_9_I As Double, HR_9_V As Double, HR_9_PF As Double, HR_9_IP As Double, HR_9_MTEMP As Double
    Dim HR_9_ATEMP As Double, HR_9_TEMPR As Double
    Dim HR_10_Tact As Double, HR_10_I As Double, HR_10_V As Double, HR_10_PF As Double, HR_10_IP As Double, HR_10_MTEMP As Double
    Dim HR_10_ATEMP As Double, HR_10_TEMPR As Double
    Dim HR_11_Tact As Double, HR_11_I As Double, HR_11_V As Double, HR_11_PF As Double, HR_11_IP As Double, HR_11_MTEMP As Double
    Dim HR_11_ATEMP As Double, HR_11_TEMPR As Double
    Dim HR_12_Tact As Double, HR_12_I As Double, HR_12_V As Double, HR_12_PF As Double, HR_12_IP As Double, HR_12_MTEMP As Double
    Dim HR_12_ATEMP As Double, HR_12_TEMPR As Double
    Dim HR_13_Tact As Double, HR_13_I As Double, HR_13_V As Double, HR_13_PF As Double, HR_13_IP As Double, HR_13_MTEMP As Double
    Dim HR_13_ATEMP As Double, HR_13_TEMPR As Double
    Dim HR_14_Tact As Double, HR_14_I As Double, HR_14_V As Double, HR_14_PF As Double, HR_14_IP As Double, HR_14_MTEMP As Double
    Dim HR_14_ATEMP As Double, HR_14_TEMPR As Double
    Dim HR_15_Tact As Double, HR_15_I As Double, HR_15_V As Double, HR_15_PF As Double, HR_15_IP As Double, HR_15_MTEMP As Double
    Dim HR_15_ATEMP As Double, HR_15_TEMPR As Double
    Dim HR_16_Tact As Double, HR_16_I As Double, HR_16_V As Double, HR_16_PF As Double, HR_16_IP As Double, HR_16_MTEMP As Double
    Dim HR_16_ATEMP As Double, HR_16_TEMPR As Double
    Dim HR_17_Tact As Double, HR_17_I As Double, HR_17_V As Double, HR_17_PF As Double, HR_17_IP As Double, HR_17_MTEMP As Double
    Dim HR_17_ATEMP As Double, HR_17_TEMPR As Double
   
    'Heat Run Test Variable declerations
    Dim HR_RESULT As Integer
    Dim HR_1_RESULT As Integer, HR_2_RESULT As Integer, HR_3_RESULT As Integer, HR_4_RESULT As Integer, HR_5_RESULT As Integer
    Dim HR_6_RESULT As Integer, HR_7_RESULT As Integer, HR_8_RESULT As Integer, HR_9_RESULT As Integer, HR_10_RESULT As Integer
    Dim HR_11_RESULT As Integer, HR_12_RESULT As Integer, HR_13_RESULT As Integer, HR_14_RESULT As Integer, HR_15_RESULT As Integer
    Dim HR_16_RESULT As Integer, HR_17_RESULT As Integer
    Dim HR_ENABLE As Boolean
    Dim HR_1_ENABLE As Boolean, HR_2_ENABLE As Boolean, HR_3_ENABLE As Boolean, HR_4_ENABLE As Boolean, HR_5_ENABLE As Boolean
    Dim HR_6_ENABLE As Boolean, HR_7_ENABLE As Boolean, HR_8_ENABLE As Boolean, HR_9_ENABLE As Boolean, HR_10_ENABLE As Boolean
    Dim HR_11_ENABLE As Boolean, HR_12_ENABLE As Boolean, HR_13_ENABLE As Boolean, HR_14_ENABLE As Boolean, HR_15_ENABLE As Boolean
    Dim HR_16_ENABLE As Boolean
    Dim HR_RESTXT As String
    Dim HR_1_RESTXT As String, HR_2_RESTXT As String, HR_3_RESTXT As String, HR_4_RESTXT As String, HR_5_RESTXT As String
    Dim HR_6_RESTXT As String, HR_7_RESTXT As String, HR_8_RESTXT As String, HR_9_RESTXT As String, HR_10_RESTXT As String
    Dim HR_11_RESTXT As String, HR_12_RESTXT As String, HR_13_RESTXT As String, HR_14_RESTXT As String, HR_15_RESTXT As String
    Dim HR_16_RESTXT As String, HR_17_RESTXT As String
   
    Dim HR_RY_R As Double, HR_YB_R As Double, HR_BR_R As Double, HRHOTRTEMP As Double
    Dim HR_R_Pass As Boolean, HR_R_Fail As Boolean, HR_R_Enable As Boolean
    Dim HR_R_Result As String
   
    Dim HR_RY_HTEMP As Double, HR_YB_HTEMP As Double, HR_BR_HTEMP As Double, HR_R_AMBTEMP As Double
    Dim HR_RY_HTEMPRISE As Double, HR_YB_HTEMPRISE  As Double, HR_BR_HTEMPRISE  As Double
    Dim HR_HTEMP_Pass As Boolean, HR_HTEMP_Fail As Boolean
    Dim HR_HTEMP_Result As String
   
    ' 1st Read
'Motor Data Settings Read item values
    WindingNo = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D4502")
    WindingNoTrim = Trim(WindingNo)
    ModelNo = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2000")
    FGCode = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2016")
    OperatorName = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D4538")
    RatedSpd = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2028")
    EncoderPPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2056")
    InvSwFreq = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2058")
    RatedI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2040")
    RatedT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2036")
    RatedF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2046")
    StallI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.MotSet.D2060")
   
   
'NL Test Items Read item values
    RY_L = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3300") '1
    YB_L = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3302") '2
    BR_L = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3304") '3
    L_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3361_A") '4
    L_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3361_B") '5
    L_Enable = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D2062_0") '6
    NL_RY_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3306") '7
    NL_YB_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3308") '8
    NL_BR_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3310") '9
    NLCOLDRTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3312") '10
    NL_R_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3298_E") '11
    NL_R_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3298_F") '12
    NL_R_Enable = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D2062_1") '13
    NL_L_EQCKT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3314") '14
    NL_R_EQCKT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3316") '15
    NL_EQCKT_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3363_C") '16
    NL_EQCKT_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3363_D") '17
    NL_EQCKT_Enable = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D2062_3") '18
    NL_Spd = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3318") '19
    NL_Cur = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3320") '20
    NL_Vol = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3322") '21
    NL_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3326") '22
    NL_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3324") '23
    NL_Fv = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3330") '24
    NL_Fi = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3328") '25
    ' Script fails on attempting to read more items !!!!!!!!!!!!!! <------
    NL_Run_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3357_5") '26
    NL_Run_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D3357_6") '27
    NL_Run_Enable = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.NL.D2062_4") '28
'BEMF Test Items Read item values
    'BEMF_CH1_1 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3030")  '29
    'BEMF_CH2_1 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3032")  '30
    'BEMF_CH3_1 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3034")  '31
    'BEMF_1_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3248_A") '50
    'BEMF_1_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3248_B") '51
    'BEMF_CH1_2 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3068")  '32
    'BEMF_CH2_2 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3070")  '33
    'BEMF_CH3_2 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3072")  '34
    'BEMF_2_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3249_A") '50
    'BEMF_2_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3249_B") '51
    'BEMF_CH1_3 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3106")  '35
    'BEMF_CH2_3 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3108")  '36
    'BEMF_CH3_3 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3110")  '37
    'BEMF_3_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3250_A") '50
    'BEMF_3_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3250_B") '51
    'BEMF_CH1_4 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3144")  '38
    'BEMF_CH2_4 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3146")  '39
    'BEMF_CH3_4 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3148")  '40
    'BEMF_4_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3251_A") '50
    'BEMF_4_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3251_B") '51
    'BEMF_CH1_5 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3182")  '41
    'BEMF_CH2_5 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3184")  '42
    'BEMF_CH3_5 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3186")  '43
    'BEMF_5_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3252_A") '50
    'BEMF_5_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3252_B") '51
    'BEMF_CH1_6 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3220")  '44
    'BEMF_CH2_6 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3222")  '45
    'BEMF_CH3_6 = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3224")  '46
    'BEMF_6_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3253_A") '50
    'BEMF_6_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3253_B") '51
    BEMF_CH1_Avg = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3228")  '47
    BEMF_CH2_Avg = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3230")  '48
    BEMF_CH3_Avg = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3232")  '49
    'BEMF_Avg_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3254_A") '50
    'BEMF_Avg_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3254_B") '51
    BEMF_RPM = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3234") '50
    BEMF_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3243_4") '50
    BEMF_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D3243_3") '51
    BEMF_Enable = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.BEMF.D4500_2") '52
'Load Test Items Read item values
    LDT_1_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_0")
    LDT_1_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3400")
    LDT_1_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3402")
    LDT_1_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3404")
    LDT_1_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2148")
    LDT_1_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3406")
    LDT_1_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3408")
    LDT_1_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3410")
    LDT_1_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3412")
    LDT_1_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3414")
    LDT_1_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3416")
    LDT_1_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3418")
    LDT_1_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3600")
    LDT_2_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_1")
    LDT_2_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2162")
    LDT_2_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3420")
    LDT_2_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3422")
    LDT_2_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3424")
    LDT_2_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3426")
    LDT_2_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3428")
    LDT_2_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3430")
    LDT_2_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3432")
    LDT_2_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3434")
    LDT_2_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3436")
    LDT_2_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3438")
    LDT_2_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3601")
    LDT_3_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_2")
    LDT_3_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2176")
    LDT_3_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3440")
    LDT_3_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3442")
    LDT_3_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3444")
    LDT_3_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3446")
    LDT_3_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3448")
    LDT_3_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3450")
    LDT_3_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3452")
    LDT_3_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3454")
    LDT_3_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3456")
    LDT_3_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3458")
    LDT_3_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3602")
    LDT_4_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_3")
    LDT_4_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2190")
    LDT_4_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3460")
    LDT_4_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3462")
    LDT_4_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3464")
    LDT_4_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3466")
    LDT_4_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3468")
    LDT_4_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3470")
    LDT_4_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3472")
    LDT_4_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3474")
    LDT_4_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3476")
    LDT_4_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3478")
    LDT_4_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3603")
    LDT_5_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_4")
    LDT_5_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2204")
    LDT_5_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3480")
    LDT_5_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3482")
    LDT_5_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3484")
    LDT_5_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3486")
    LDT_5_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3488")
    LDT_5_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3490")
    LDT_5_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3492")
    LDT_5_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3494")
    LDT_5_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3496")
    LDT_5_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3498")
    LDT_5_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3604")
    LDT_6_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_5")
    LDT_6_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2218")
    LDT_6_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3500")
    LDT_6_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3502")
    LDT_6_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3504")
    LDT_6_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3506")
    LDT_6_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3508")
    LDT_6_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3510")
    LDT_6_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3512")
    LDT_6_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3514")
    LDT_6_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3516")
    LDT_6_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3518")
    LDT_6_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3605")
    LDT_7_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_6")
    LDT_7_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2232")
    LDT_7_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3520")
    LDT_7_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3522")
    LDT_7_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3524")
    LDT_7_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3526")
    LDT_7_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3528")
    LDT_7_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3530")
    LDT_7_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3532")
    LDT_7_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3534")
    LDT_7_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3536")
    LDT_7_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3538")
    LDT_7_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3606")
    LDT_8_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2288_7")
    LDT_8_Tset = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D2246")
    LDT_8_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3540")
    LDT_8_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3542")
    LDT_8_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3544")
    LDT_8_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3546")
    LDT_8_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3548")
    LDT_8_OP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3550")
    LDT_8_EFF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3552")
    LDT_8_FI = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3554")
    LDT_8_FV = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3556")
    LDT_8_SPD = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3558")
    LDT_8_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.LDT.D3607")
'HR Test Read item values
    HR_1_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3700")
    HR_1_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3702")
    HR_1_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3704")
    HR_1_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3706")
    HR_1_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3708")
    HR_1_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3710")
    HR_1_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3712")
    HR_1_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3714")
    HR_2_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3716")
    HR_2_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3718")
    HR_2_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3720")
    HR_2_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3722")
    HR_2_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3724")
    HR_2_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3726")
    HR_2_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3728")
    HR_2_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3730")
    HR_3_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3732")
    HR_3_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3734")
    HR_3_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3736")
    HR_3_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3738")
    HR_3_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3740")
    HR_3_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3742")
    HR_3_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3744")
    HR_3_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3746")
    HR_4_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3748")
    HR_4_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3750")
    HR_4_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3752")
    HR_4_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3754")
    HR_4_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3756")
    HR_4_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3758")
    HR_4_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3760")
    HR_4_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3762")
    HR_5_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3764")
    HR_5_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3766")
    HR_5_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3768")
    HR_5_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3770")
    HR_5_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3772")
    HR_5_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3774")
    HR_5_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3776")
    HR_5_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3778")
    HR_6_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3780")
    HR_6_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3782")
    HR_6_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3784")
    HR_6_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3786")
    HR_6_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3788")
    HR_6_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3790")
    HR_6_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3792")
    HR_6_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3794")
    HR_7_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3796")
    HR_7_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3798")
    HR_7_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3800")
    HR_7_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3802")
    HR_7_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3804")
    HR_7_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3806")
    HR_7_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3808")
    HR_7_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3810")
    HR_8_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3812")
    HR_8_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3814")
    HR_8_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3816")
    HR_8_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3818")
    HR_8_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3820")
    HR_8_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3822")
    HR_8_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3824")
    HR_8_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3826")
    HR_9_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3828")
    HR_9_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3830")
    HR_9_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3832")
    HR_9_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3834")
    HR_9_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3836")
    HR_9_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3838")
    HR_9_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3840")
    HR_9_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3842")
    HR_10_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3844")
    HR_10_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3846")
    HR_10_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3848")
    HR_10_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3850")
    HR_10_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3852")
    HR_10_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3854")
    HR_10_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3856")
    HR_10_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3858")
    HR_11_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3860")
    HR_11_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3862")
    HR_11_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3864")
    HR_11_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3866")
    HR_11_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3868")
    HR_11_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3870")
    HR_11_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3872")
    HR_11_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3874")
    HR_12_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3876")
    HR_12_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3878")
    HR_12_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3880")
    HR_12_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3882")
    HR_12_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3884")
    HR_12_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3886")
    HR_12_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3888")
    HR_12_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3890")
    HR_13_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3892")
    HR_13_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3894")
    HR_13_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3896")
    HR_13_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3898")
    HR_13_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3900")
    HR_13_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3902")
    HR_13_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3904")
    HR_13_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3906")
    HR_14_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3908")
    HR_14_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3910")
    HR_14_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3912")
    HR_14_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3914")
    HR_14_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3916")
    HR_14_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3918")
    HR_14_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3920")
    HR_14_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3922")
    HR_15_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3924")
    HR_15_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3926")
    HR_15_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3928")
    HR_15_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3930")
    HR_15_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3932")
    HR_15_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3934")
    HR_15_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3936")
    HR_15_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3938")
    HR_16_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3940")
    HR_16_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3942")
    HR_16_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3944")
    HR_16_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3946")
    HR_16_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3948")
    HR_16_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3950")
    HR_16_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3952")
    HR_16_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3954")
    HR_17_Tact = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3956")
    HR_17_I = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3958")
    HR_17_V = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3960")
    HR_17_PF = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3962")
    HR_17_IP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3964")
    HR_17_MTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3966")
    HR_17_ATEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3968")
    HR_17_TEMPR = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D3970")
    HR_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4410")
    HR_1_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4411")
    HR_2_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4412")
    HR_3_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4413")
    HR_4_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4414")
    HR_5_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4415")
    HR_6_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4416")
    HR_7_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4417")
    HR_8_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4418")
    HR_9_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4419")
    HR_10_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4420")
    HR_11_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4421")
    HR_12_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4422")
    HR_13_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4423")
    HR_14_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4424")
    HR_15_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4425")
    HR_16_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4426")
    HR_17_RESULT = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4427")
    HR_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4500_4")
    HR_1_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_1")
    HR_2_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_2")
    HR_3_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_3")
    HR_4_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_4")
    HR_5_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_5")
    HR_6_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_6")
    HR_7_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_7")
    HR_8_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_8")
    HR_9_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_9")
    HR_10_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_A")
    HR_11_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_B")
    HR_12_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_C")
    HR_13_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_D")
    HR_14_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_E")
    HR_15_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4400_F")
    HR_16_ENABLE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4401_0")
    HR_RY_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4390")
    HR_YB_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4392")
    HR_BR_R = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4394")
    HRHOTRTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4396")
    HR_R_AMBTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4388")
    HR_R_Pass = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4405_F")
    HR_R_Fail = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4405_9")
    HR_RY_HTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4382")
    HR_YB_HTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4384")
    HR_BR_HTEMP = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4386")
    HR_RY_HTEMPRISE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4450")
    HR_YB_HTEMPRISE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4452")
    HR_BR_HTEMPRISE = g.OPC.Read("Mitsubishi.MXOPC.6\fx5u.HR.D4454")



    Dim dbcon As New ADODB.Connection
    'Dim dbrst As New ADODB.Recordset
   
    dbcon.ConnectionString = "Provider=SQLOLEDB;Data Source=DESKTOP-3FLGL07\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=MotorTest;"
    dbcon.Open
   
    'LogFile.Write "enter delay"
    Dim Tick As Long
    Tick = 0
    Do
        Tick = Tick + 1
    Loop Until Tick = 100000
    'LogFile.Write "exit delay"
   
   
    If L_Pass Then
        L_Result = "Pass"
    ElseIf L_Fail Then
        L_Result = "Fail"
    Else
        L_Result = "Not Executed"
    End If
   
    If NL_R_Pass Then
        NL_R_Result = "Pass"
    ElseIf NL_R_Fail Then
        NL_R_Result = "Fail"
    Else
        NL_R_Result = "Not Executed"
    End If
   
    If NL_Run_Pass Then
        NL_Run_Result = "Pass"
    ElseIf NL_Run_Fail Then
        NL_Run_Result = "Fail"
    Else
        NL_Run_Result = "Not Executed"
    End If
   
    If BEMF_Pass Then
        BEMF_Result = "Pass"
    ElseIf BEMF_Fail Then
        BEMF_Result = "Fail"
    Else
        BEMF_Result = "Not Executed"
    End If
   
    If LDT_1_RESULT = 0 Then
        LDT_1_RESTXT = "Not Executed"
    ElseIf LDT_1_RESULT = 2 Then
        LDT_1_RESTXT = "Fail"
    ElseIf LDT_1_RESULT = 3 Then
        LDT_1_RESTXT = "Pass"
    ElseIf LDT_1_RESULT = 4 Then
        LDT_1_RESTXT = "Stopped"
    ElseIf LDT_1_RESULT = 5 Then
        LDT_1_RESTXT = "Completed"
    End If
   
    If LDT_2_RESULT = 0 Then
        LDT_2_RESTXT = "Not Executed"
    ElseIf LDT_2_RESULT = 2 Then
        LDT_2_RESTXT = "Fail"
    ElseIf LDT_2_RESULT = 3 Then
        LDT_2_RESTXT = "Pass"
    ElseIf LDT_2_RESULT = 4 Then
        LDT_2_RESTXT = "Stopped"
    ElseIf LDT_2_RESULT = 5 Then
        LDT_2_RESTXT = "Completed"
    End If
   
    If LDT_3_RESULT = 0 Then
        LDT_3_RESTXT = "Not Executed"
    ElseIf LDT_3_RESULT = 2 Then
        LDT_3_RESTXT = "Fail"
    ElseIf LDT_3_RESULT = 3 Then
        LDT_3_RESTXT = "Pass"
    ElseIf LDT_3_RESULT = 4 Then
        LDT_3_RESTXT = "Stopped"
    ElseIf LDT_3_RESULT = 5 Then
        LDT_3_RESTXT = "Completed"
    End If
   
    If LDT_4_RESULT = 0 Then
        LDT_4_RESTXT = "Not Executed"
    ElseIf LDT_4_RESULT = 2 Then
        LDT_4_RESTXT = "Fail"
    ElseIf LDT_4_RESULT = 3 Then
        LDT_4_RESTXT = "Pass"
    ElseIf LDT_4_RESULT = 4 Then
        LDT_4_RESTXT = "Stopped"
    ElseIf LDT_4_RESULT = 5 Then
        LDT_4_RESTXT = "Completed"
    End If
   
    If LDT_5_RESULT = 0 Then
        LDT_5_RESTXT = "Not Executed"
    ElseIf LDT_5_RESULT = 2 Then
        LDT_5_RESTXT = "Fail"
    ElseIf LDT_5_RESULT = 3 Then
        LDT_5_RESTXT = "Pass"
    ElseIf LDT_5_RESULT = 4 Then
        LDT_5_RESTXT = "Stopped"
    ElseIf LDT_5_RESULT = 5 Then
        LDT_5_RESTXT = "Completed"
    End If
   
    If LDT_6_RESULT = 0 Then
        LDT_6_RESTXT = "Not Executed"
    ElseIf LDT_6_RESULT = 2 Then
        LDT_6_RESTXT = "Fail"
    ElseIf LDT_6_RESULT = 3 Then
        LDT_6_RESTXT = "Pass"
    ElseIf LDT_6_RESULT = 4 Then
        LDT_6_RESTXT = "Stopped"
    ElseIf LDT_6_RESULT = 5 Then
        LDT_6_RESTXT = "Completed"
    End If
   
    If LDT_7_RESULT = 0 Then
        LDT_7_RESTXT = "Not Executed"
    ElseIf LDT_7_RESULT = 2 Then
        LDT_7_RESTXT = "Fail"
    ElseIf LDT_7_RESULT = 3 Then
        LDT_7_RESTXT = "Pass"
    ElseIf LDT_7_RESULT = 4 Then
        LDT_7_RESTXT = "Stopped"
    ElseIf LDT_7_RESULT = 5 Then
        LDT_7_RESTXT = "Completed"
    End If
   
    If LDT_8_RESULT = 0 Then
        LDT_8_RESTXT = "Not Executed"
    ElseIf LDT_8_RESULT = 2 Then
        LDT_8_RESTXT = "Fail"
    ElseIf LDT_8_RESULT = 3 Then
        LDT_8_RESTXT = "Pass"
    ElseIf LDT_8_RESULT = 4 Then
        LDT_8_RESTXT = "Stopped"
    ElseIf LDT_8_RESULT = 5 Then
        LDT_8_RESTXT = "Completed"
    End If
       
    If HR_R_Pass Then
        HR_R_Result = "Pass"
    ElseIf HR_R_Fail Then
        HR_R_Result = "Fail"
    Else
        HR_R_Result = "Not Executed"
    End If
   
    Dim TempSQLQueryString As String
    TempSQLQueryString = "INSERT INTO dbo.MotorData(WindingNo,ModelNo,FGCode,RatedSpd,EncoderPPR,InvSwFreq,RatedI,RatedT,RatedF,StallI,"
    TempSQLQueryString = TempSQLQueryString & "L_Enable, RY_L,YB_L,BR_L,L_Pass,L_Fail,NL_R_Enable, NL_RY_R,NL_YB_R,NL_BR_R,NLCOLDRTEMP,NL_R_Pass,NL_R_Fail,NL_EQCKT_Enable, NL_L_EQCKT,NL_R_EQCKT,NL_EQCKT_Pass,NL_EQCKT_Fail,"
    TempSQLQueryString = TempSQLQueryString & "NL_Run_Enable, NL_Spd,NL_Cur,NL_Vol,NL_PF,NL_IP,NL_Fv,NL_Fi,NL_Run_Pass,NL_Run_Fail,"
    TempSQLQueryString = TempSQLQueryString & "BEMF_Enable,BEMF_CH1_Avg,BEMF_CH2_Avg,BEMF_CH3_Avg,BEMF_RPM,BEMF_Pass,BEMF_Fail,"
    TempSQLQueryString = TempSQLQueryString & "LDT_1_ENABLE,LDT_1_Tact,LDT_1_I,LDT_1_V,LDT_1_Tset,LDT_1_PF,LDT_1_IP,LDT_1_OP,LDT_1_EFF,LDT_1_FI,LDT_1_FV,LDT_1_SPD,LDT_1_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_2_ENABLE,LDT_2_Tset,LDT_2_Tact,LDT_2_I,LDT_2_V,LDT_2_PF,LDT_2_IP,LDT_2_OP,LDT_2_EFF,LDT_2_FI,LDT_2_FV,LDT_2_SPD,LDT_2_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_3_ENABLE,LDT_3_Tset,LDT_3_Tact,LDT_3_I,LDT_3_V,LDT_3_PF,LDT_3_IP,LDT_3_OP,LDT_3_EFF,LDT_3_FI,LDT_3_FV,LDT_3_SPD,LDT_3_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_4_ENABLE,LDT_4_Tset,LDT_4_Tact,LDT_4_I,LDT_4_V,LDT_4_PF,LDT_4_IP,LDT_4_OP,LDT_4_EFF,LDT_4_FI,LDT_4_FV,LDT_4_SPD,LDT_4_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_5_ENABLE,LDT_5_Tset,LDT_5_Tact,LDT_5_I,LDT_5_V,LDT_5_PF,LDT_5_IP,LDT_5_OP,LDT_5_EFF,LDT_5_FI,LDT_5_FV,LDT_5_SPD,LDT_5_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_6_ENABLE,LDT_6_Tset,LDT_6_Tact,LDT_6_I,LDT_6_V,LDT_6_PF,LDT_6_IP,LDT_6_OP,LDT_6_EFF,LDT_6_FI,LDT_6_FV,LDT_6_SPD,LDT_6_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_7_ENABLE,LDT_7_Tset,LDT_7_Tact,LDT_7_I,LDT_7_V,LDT_7_PF,LDT_7_IP,LDT_7_OP,LDT_7_EFF,LDT_7_FI,LDT_7_FV,LDT_7_SPD,LDT_7_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "LDT_8_ENABLE,LDT_8_Tset,LDT_8_Tact,LDT_8_I,LDT_8_V,LDT_8_PF,LDT_8_IP,LDT_8_OP,LDT_8_EFF,LDT_8_FI,LDT_8_FV,LDT_8_SPD,LDT_8_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_ENABLE,"
    TempSQLQueryString = TempSQLQueryString & "HR_1_Tact,HR_1_I,HR_1_V,HR_1_PF,HR_1_IP,HR_1_MTEMP,HR_1_ATEMP,HR_1_TEMPR,HR_1_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_2_Tact,HR_2_I,HR_2_V,HR_2_PF,HR_2_IP,HR_2_MTEMP,HR_2_ATEMP,HR_2_TEMPR,HR_2_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_3_Tact,HR_3_I,HR_3_V,HR_3_PF,HR_3_IP,HR_3_MTEMP,HR_3_ATEMP,HR_3_TEMPR,HR_3_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_4_Tact,HR_4_I,HR_4_V,HR_4_PF,HR_4_IP,HR_4_MTEMP,HR_4_ATEMP,HR_4_TEMPR,HR_4_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_5_Tact,HR_5_I,HR_5_V,HR_5_PF,HR_5_IP,HR_5_MTEMP,HR_5_ATEMP,HR_5_TEMPR,HR_5_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_6_Tact,HR_6_I,HR_6_V,HR_6_PF,HR_6_IP,HR_6_MTEMP,HR_6_ATEMP,HR_6_TEMPR,HR_6_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_7_Tact,HR_7_I,HR_7_V,HR_7_PF,HR_7_IP,HR_7_MTEMP,HR_7_ATEMP,HR_7_TEMPR,HR_7_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_8_Tact,HR_8_I,HR_8_V,HR_8_PF,HR_8_IP,HR_8_MTEMP,HR_8_ATEMP,HR_8_TEMPR,HR_8_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_9_Tact,HR_9_I,HR_9_V,HR_9_PF,HR_9_IP,HR_9_MTEMP,HR_9_ATEMP,HR_9_TEMPR,HR_9_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_10_Tact,HR_10_I,HR_10_V,HR_10_PF,HR_10_IP,HR_10_MTEMP,HR_10_ATEMP,HR_10_TEMPR,HR_10_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_11_Tact,HR_11_I,HR_11_V,HR_11_PF,HR_11_IP,HR_11_MTEMP,HR_11_ATEMP,HR_11_TEMPR,HR_11_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_12_Tact,HR_12_I,HR_12_V,HR_12_PF,HR_12_IP,HR_12_MTEMP,HR_12_ATEMP,HR_12_TEMPR,HR_12_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_13_Tact,HR_13_I,HR_13_V,HR_13_PF,HR_13_IP,HR_13_MTEMP,HR_13_ATEMP,HR_13_TEMPR,HR_13_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_14_Tact,HR_14_I,HR_14_V,HR_14_PF,HR_14_IP,HR_14_MTEMP,HR_14_ATEMP,HR_14_TEMPR,HR_14_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_15_Tact,HR_15_I,HR_15_V,HR_15_PF,HR_15_IP,HR_15_MTEMP,HR_15_ATEMP,HR_15_TEMPR,HR_15_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_16_Tact,HR_16_I,HR_16_V,HR_16_PF,HR_16_IP,HR_16_MTEMP,HR_16_ATEMP,HR_16_TEMPR,HR_16_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_17_Tact,HR_17_I,HR_17_V,HR_17_PF,HR_17_IP,HR_17_MTEMP,HR_17_ATEMP,HR_17_TEMPR,HR_17_RESULT,"
    TempSQLQueryString = TempSQLQueryString & "HR_RY_R,HR_YB_R,HR_BR_R,HR_R_AMBTEMP,HR_RY_HTEMP,HR_YB_HTEMP,HR_BR_HTEMP,HR_RY_HTEMPRISE,HR_YB_HTEMPRISE,HR_BR_HTEMPRISE,"
    TempSQLQueryString = TempSQLQueryString & "HR_R_Pass,HR_R_Fail,HR_RESULT"
    TempSQLQueryString = TempSQLQueryString & "OperatorName,TimeStamp1"
    TempSQLQueryString = TempSQLQueryString & ")VALUES("
    TempSQLQueryString = TempSQLQueryString & WindingNoTrim & "," & ModelNo & "," & FGCode & "," & RatedSpd & "," & EncoderPPR & "," & InvSwFreq & "," & RatedI & "," & RatedT & "," & RatedF & "," & StallI & ","
    TempSQLQueryString = TempSQLQueryString & L_Enable & "," & RY_L & "," & YB_L & "," & BR_L & "," & L_Pass & "," & L_Fail & "," & NL_R_Enable & "," & NL_RY_R & "," & NL_YB_R & "," & NL_BR_R & "," & NLCOLDRTEMP & "," & NL_R_Pass & "," & NL_R_Fail & "," & NL_EQCKT_Enable & "," & NL_L_EQCKT & "," & NL_R_EQCKT & "," & NL_EQCKT_Pass & "," & NL_EQCKT_Fail & ","
    TempSQLQueryString = TempSQLQueryString & NL_Run_Enable & "," & NL_Spd & "," & NL_Cur & "," & NL_Vol & "," & NL_PF & "," & NL_IP & "," & NL_Fv & "," & NL_Fi & "," & NL_Run_Pass & "," & NL_Run_Fail & ","
    TempSQLQueryString = TempSQLQueryString & BEMF_Enable & "," & BEMF_CH1_Avg & "," & BEMF_CH2_Avg & "," & BEMF_CH3_Avg & "," & BEMF_RPM & "," & BEMF_Pass & "," & BEMF_Fail & ","
    TempSQLQueryString = TempSQLQueryString & LDT_1_ENABLE & "," & LDT_1_Tact & "," & LDT_1_I & "," & LDT_1_V & "," & LDT_1_Tset & "," & LDT_1_PF & "," & LDT_1_IP & "," & LDT_1_OP & "," & LDT_1_EFF & "," & LDT_1_FI & "," & LDT_1_FV & "," & LDT_1_SPD & "," & LDT_1_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_2_ENABLE & "," & LDT_2_Tset & "," & LDT_2_Tact & "," & LDT_2_I & "," & LDT_2_V & "," & LDT_2_PF & "," & LDT_2_IP & "," & LDT_2_OP & "," & LDT_2_EFF & "," & LDT_2_FI & "," & LDT_2_FV & "," & LDT_2_SPD & "," & LDT_2_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_3_ENABLE & "," & LDT_3_Tset & "," & LDT_3_Tact & "," & LDT_3_I & "," & LDT_3_V & "," & LDT_3_PF & "," & LDT_3_IP & "," & LDT_3_OP & "," & LDT_3_EFF & "," & LDT_3_FI & "," & LDT_3_FV & "," & LDT_3_SPD & "," & LDT_3_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_4_ENABLE & "," & LDT_4_Tset & "," & LDT_4_Tact & "," & LDT_4_I & "," & LDT_4_V & "," & LDT_4_PF & "," & LDT_4_IP & "," & LDT_4_OP & "," & LDT_4_EFF & "," & LDT_4_FI & "," & LDT_4_FV & "," & LDT_4_SPD & "," & LDT_4_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_5_ENABLE & "," & LDT_5_Tset & "," & LDT_5_Tact & "," & LDT_5_I & "," & LDT_5_V & "," & LDT_5_PF & "," & LDT_5_IP & "," & LDT_5_OP & "," & LDT_5_EFF & "," & LDT_5_FI & "," & LDT_5_FV & "," & LDT_5_SPD & "," & LDT_5_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_6_ENABLE & "," & LDT_6_Tset & "," & LDT_6_Tact & "," & LDT_6_I & "," & LDT_6_V & "," & LDT_6_PF & "," & LDT_6_IP & "," & LDT_6_OP & "," & LDT_6_EFF & "," & LDT_6_FI & "," & LDT_6_FV & "," & LDT_6_SPD & "," & LDT_6_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_7_ENABLE & "," & LDT_7_Tset & "," & LDT_7_Tact & "," & LDT_7_I & "," & LDT_7_V & "," & LDT_7_PF & "," & LDT_7_IP & "," & LDT_7_OP & "," & LDT_7_EFF & "," & LDT_7_FI & "," & LDT_7_FV & "," & LDT_7_SPD & "," & LDT_7_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & LDT_8_ENABLE & "," & LDT_8_Tset & "," & LDT_8_Tact & "," & LDT_8_I & "," & LDT_8_V & "," & LDT_8_PF & "," & LDT_8_IP & "," & LDT_8_OP & "," & LDT_8_EFF & "," & LDT_8_FI & "," & LDT_8_FV & "," & LDT_8_SPD & "," & LDT_8_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_ENABLE & ","
    TempSQLQueryString = TempSQLQueryString & HR_1_Tact & "," & HR_1_I & "," & HR_1_V & "," & HR_1_PF & "," & HR_1_IP & "," & HR_1_MTEMP & "," & HR_1_ATEMP & "," & HR_1_TEMPR & "," & HR_1_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_2_Tact & "," & HR_2_I & "," & HR_2_V & "," & HR_2_PF & "," & HR_2_IP & "," & HR_2_MTEMP & "," & HR_2_ATEMP & "," & HR_2_TEMPR & "," & HR_2_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_3_Tact & "," & HR_3_I & "," & HR_3_V & "," & HR_3_PF & "," & HR_3_IP & "," & HR_3_MTEMP & "," & HR_3_ATEMP & "," & HR_3_TEMPR & "," & HR_3_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_4_Tact & "," & HR_4_I & "," & HR_4_V & "," & HR_4_PF & "," & HR_4_IP & "," & HR_4_MTEMP & "," & HR_4_ATEMP & "," & HR_4_TEMPR & "," & HR_4_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_5_Tact & "," & HR_5_I & "," & HR_5_V & "," & HR_5_PF & "," & HR_5_IP & "," & HR_5_MTEMP & "," & HR_5_ATEMP & "," & HR_5_TEMPR & "," & HR_5_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_6_Tact & "," & HR_6_I & "," & HR_6_V & "," & HR_6_PF & "," & HR_6_IP & "," & HR_6_MTEMP & "," & HR_6_ATEMP & "," & HR_6_TEMPR & "," & HR_6_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_7_Tact & "," & HR_7_I & "," & HR_7_V & "," & HR_7_PF & "," & HR_7_IP & "," & HR_7_MTEMP & "," & HR_7_ATEMP & "," & HR_7_TEMPR & "," & HR_7_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_8_Tact & "," & HR_8_I & "," & HR_8_V & "," & HR_8_PF & "," & HR_8_IP & "," & HR_8_MTEMP & "," & HR_8_ATEMP & "," & HR_8_TEMPR & "," & HR_8_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_9_Tact & "," & HR_9_I & "," & HR_9_V & "," & HR_9_PF & "," & HR_9_IP & "," & HR_9_MTEMP & "," & HR_9_ATEMP & "," & HR_9_TEMPR & "," & HR_9_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_10_Tact & "," & HR_10_I & "," & HR_10_V & "," & HR_10_PF & "," & HR_10_IP & "," & HR_10_MTEMP & "," & HR_10_ATEMP & "," & HR_10_TEMPR & "," & HR_10_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_11_Tact & "," & HR_11_I & "," & HR_11_V & "," & HR_11_PF & "," & HR_11_IP & "," & HR_11_MTEMP & "," & HR_11_ATEMP & "," & HR_11_TEMPR & "," & HR_11_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_12_Tact & "," & HR_12_I & "," & HR_12_V & "," & HR_12_PF & "," & HR_12_IP & "," & HR_12_MTEMP & "," & HR_12_ATEMP & "," & HR_12_TEMPR & "," & HR_12_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_13_Tact & "," & HR_13_I & "," & HR_13_V & "," & HR_13_PF & "," & HR_13_IP & "," & HR_13_MTEMP & "," & HR_13_ATEMP & "," & HR_13_TEMPR & "," & HR_13_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_14_Tact & "," & HR_14_I & "," & HR_14_V & "," & HR_14_PF & "," & HR_14_IP & "," & HR_14_MTEMP & "," & HR_14_ATEMP & "," & HR_14_TEMPR & "," & HR_14_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_15_Tact & "," & HR_15_I & "," & HR_15_V & "," & HR_15_PF & "," & HR_15_IP & "," & HR_15_MTEMP & "," & HR_15_ATEMP & "," & HR_15_TEMPR & "," & HR_15_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_16_Tact & "," & HR_16_I & "," & HR_16_V & "," & HR_16_PF & "," & HR_16_IP & "," & HR_16_MTEMP & "," & HR_16_ATEMP & "," & HR_16_TEMPR & "," & HR_16_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_17_Tact & "," & HR_17_I & "," & HR_17_V & "," & HR_17_PF & "," & HR_17_IP & "," & HR_17_MTEMP & "," & HR_17_ATEMP & "," & HR_17_TEMPR & "," & HR_17_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & HR_RY_R & "," & HR_YB_R & "," & HR_BR_R & "," & HR_R_AMBTEMP & "," & HR_RY_HTEMP & "," & HR_YB_HTEMP & "," & HR_BR_HTEMP & "," & HR_RY_HTEMPRISE & "," & HR_YB_HTEMPRISE & "," & HR_BR_HTEMPRISE & ","
    TempSQLQueryString = TempSQLQueryString & HR_R_Pass & "," & HR_R_Fail & "," & HR_RESULT & ","
    TempSQLQueryString = TempSQLQueryString & OperatorName & "," & TimeStamp1
    TempSQLQueryString = TempSQLQueryString & ")"
   
    dbcon.Execute (TempSQLQueryString)
    dbcon.Close
    Set dbcon = Nothing

    Exit Sub
ErrHandler:
    g.ConsoleMsg MSG_SEVERE_ERROR, "Script", "'NewScript' failed"
End Sub


Comments

Popular posts from this blog

GXWorks3 GXDeveloper3 Notes

Set Device comment using Navigation Tree View -> Device-> Common Device Comment Q1. Blinking erratic display of values when choosing Controller Type : FX A1. Communication issue between the GS2110 HMI and the FX5U PLC over ethernet was resolved by the following settings : System Tree View -> Controller Setting ->CH1-> Controller Type : Melsec iQ-F , I/F : Ethernet Multi Unit type : FX5CPU, IP Address : 192.168.1.17, Port : 5562, Communication TCP Q2. When communication between the FX5U PLC and the GS2110 HMI was established the GXWorks3 Programming software was unable to go online with the PLC - gives communication error A2. The PLC connection set to "Direct" and not "Via Hub" Q3  Unable to establish simultaneous communication to FX5U PLC with SCADA (MX OPC Server ) and HMI ( GS2110 ) Need to add Melsoft  device to correspond to the HMI as shown below Q4. Functions and Function Blocks Functions :  1. Do not get i...

FX5U PLC Module Settings

FX5U-4AD-PT-ADP FX5U-8AD

Scada Notes

Q1. How do we have local variables on the PC ( not PLC ) that are accessible by all the different Iconics Applications ? A1. Configure Items in Unified Data Manager so that the item is accessible by the GraphWorX  as well as ScriptWorX Example : UDMConfig --> Registers (New Bool1, Writeable) ____________________________________________________________________________ Q2. How do we log PLC Item data to a .csv file Trigger Tag is created  in UDMConfig --> Registers (New Bool1, Writeable) Configure Tag as reg:Bool1 Trigger is configured in the UDMConfig --> Event trigger --> Data Trigger (New) -> Data Trigger Options Name : Bool1ChgTrig ( Trigger Name ) Condition : Execute when Tag changes to TRUE Data Tag : reg:Bool1 In ScriptWorX2010 create a Thread, then create a script below it Ensure that the script is stopped -  "RED TRAFFIC LIGHT" must be ON in ScriptWorX Script : NewScript Trigger Name : trg_data: Bool1ChgTrig Click the "App...