7/20/2017 2:14 PM | |
Posts: 1 Rating:
|
Hello All, I wrote a script for writing the data/process parameters in a csv file,I am using TP 700 Comfort HMI. I am trying to simulate the function on my PC ,I am facing this Error #429 ActiveX Component can’t create object”error ,So can you please guide me to run this script. The code is as follows: Dim PV Dim StartBit PV = SmartTags ("PV_A1") StartBit =SmartTags("Start Bit") On Error Resume Next Dim Folder_Path, Storage_Path,File_Name ,File_Search_Object, File_Object, objFile, WriteStream, AlarmText Folder_Path = "\Storage Card SD\" File_Name = "Triplog" & ".csv" Storage_Path = Folder_Path & File_Name Set File_Search_Object = CreateObject("FileSystemObject") If Err.Number<> 0 Then ShowSystemAlarm "Unable to create File System Object. Please Restart HMI. Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If Set File_Object = CreateObject("FileSystemObject.file") If Err.Number<> 0 Then ShowSystemAlarm "Unable to create File Object. Please Restart HMI. Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If If File_Search_Object.dir(Storage_Path) = "" Then File_Object.Open Storage_Path , 8 File_Object.LinePrint "PV" Else File_Object.Open Storage_Path , 8 End If If Err.Number<> 0 Then ShowSystemAlarm "Unable to create/open File.Make Sure that SD Card is inserted Properly and not Full/Faulty. Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If If StartBit = True Then 'Write into file only if Machine Bit is HIGH/True File_Object.LinePrint WriteStream If Err.Number<> 0 Then ShowSystemAlarm "Unable to Write into file. Make Sure that SD Card is inserted Properly/Full/Faulty. Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If End If File_Object.Close If Err.Number<> 0 Then ShowSystemAlarm "Unable To Close File. Make Sure that SD Card is inserted Properly/Full/Faulty. Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If Set File_Object = Nothing Set File_Search_Object = Nothing |
Follow us on