1/27/2015 6:56 AM | |
Posts: 22 Rating:
|
Hi , I am facing thisError #429 ActiveX Component can’t create object”error , while using Panel Base VB Script in ES project , I have checked this script . it was fine in Winflex but when i am using in TIA portal it gives me Error #429 ActiveX Component can’t create object” So can you please guide me to run this script on ES. Read_Data :- 'Tip: ' 1. Use the <CTRL+SPACE> or <CTRL+I> keystroke to open a list of all objects and functions ' 2. Write the code using the HMIRuntime object. ' Example: HmiRuntime.Screens("Screen_1"). ' 3. Use the <CTRL+J> keystroke to create an object reference. 'Write the code as of this position: 'Declaration of local tags - Deklaration der lokalen Variablen Dim fo Dim path Dim mode Dim delimiter Dim data Dim splitdata 'Initialization of Tags - Initialisierung von Variablen mode=1 '1 = Input 'Selection of the storage path - Auswahl des Speicherpfads If SmartTags("bExtension") =0 Then path ="\Storage Card SD\datafile.txt" delimiter=vbTab Else path ="\Storage Card SD\datafile.csv" delimiter=";" End If 'Starting error routine - Starten der Fehlerroutine On Error Resume Next 'Create a file object - Datei Objekt erstellen Set fo= CreateObject("FileCtl.File") 'Check if any errors happend - Auf Fehler prüfen If Err.Number<> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If 'Open or creat a file - Öffnen bzw. Erstellen einer Datei fo.open path,mode 'Check if any errors happend - Auf Fehler prüfen If Err.Number<> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If 'Read data from file - Daten werden aus Datein gelesen While fo.EOF = False data=fo.LineInputString Wend 'Write data to HMI-Tags - Daten werden auf die HMI-Variablen geschrieben data=Replace(data,vbTab & vbTab,delimiter) splitdata=Split(data,delimiter) SmartTags("szDate")=splitdata(0) SmartTags("szString_1")= splitdata(1) SmartTags("iValue_1")=splitdata(2) SmartTags("iValue_2")=splitdata(3) 'Close the file - Datei wird geschlossen fo.Close 'Release the Object - Objekt wird freigegeben Set fo = Nothing ShowSystemAlarm "Reading of data was successful!" End Sub ------------------------------------------------------------------------------------------------------ Write_Data :- Sub Write_data() 'Tip: ' 1. Use the <CTRL+SPACE> or <CTRL+I> keystroke to open a list of all objects and functions ' 2. Write the code using the HMIRuntime object. ' Example: HmiRuntime.Screens("Screen_1"). ' 3. Use the <CTRL+J> keystroke to create an object reference. 'Write the code as of this position: 'Declaration of local tags - Deklaration der lokalen Variablen Dim fo Dim path Dim mode Dim delimiter Dim gap Const NEU=0 'Initialization of Tags - Initialisierung von Variablen mode=8 '8 = Append 'Selection of the storage path - Auswahl des Speicherpfads If SmartTags("bExtension") =0 Then path ="\Storage Card SD\datafile.txt" delimiter=vbTab gap=vbTab Else path ="\Storage Card SD\datafile.csv" delimiter=";" gap="" End If 'Starting error routine - Starten der Fehlerroutine On Error Resume Next 'Create a file object - Datei Objekt erstellen Set fo= CreateObject("FileCtl.File") 'Check if any errors happend - Auf Fehler prüfen If Err.Number<> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If 'Open or create a file - Öffnen bzw. Erstellen einer Datei fo.open path,mode 'Check if any errors happend - Auf Fehler prüfen If Err.Number<> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " "& Err.Description Err.Clear Exit Sub End If 'Write Headline if File is new - Erstellen einer Kopfzeile bei neuen Dateien If fo.LOF = NEU Then fo.LinePrint("Date" & gap & gap & delimiter & "Material" & delimiter & "Presure" & delimiter & "Temperature" & delimiter) End If 'Write data into file - Daten werden in die Datein geschrieben fo.LinePrint(Now & delimiter & SmartTags("szMaterial") & gap & delimiter & SmartTags("iPressure") & delimiter & SmartTags("iTemperature") & delimiter) 'Close the file - Datei wird geschlossen fo.Close 'Release the Object - Objekt wird freigegeben Set fo = Nothing ShowSystemAlarm "Storage of data was successful!" End Sub
|
10/27/2015 4:08 PM | |
Joined: 9/3/2015 Last visit: 10/18/2023 Posts: 1 Rating:
|
I am facing the same error. How do you came out of this situation? |
6/29/2016 2:50 PM | |
Posts: 57 Rating:
|
I'm facing the same Error #429 ActiveX Component can’t create object” My code is just the one I copied from other users, just added some error display I'm running TIA-portal 13SP1 UPD7 with WinCC advanced 13-SP1-UPD-7 The HMI panel is KTP400 comfort The error happens just after the Set fo= CreateObject("FileCtl.File") instruction
BTW, how is it possibile to find help about vbscript functions, methods and objects on the help system? |
Last edited by: salrandazzo at: 6/29/2016 2:51:24 PM |
|
7/2/2016 8:24 PM | |
Joined: 9/19/2009 Last visit: 2/4/2025 Posts: 459 Rating:
|
Hi Here there are some information very usefull about Script WinCE |
Last edited by: Min_Moderator at: 7/4/2016 11:41:54 AMEdit link If my answer help you, use the Thanks or Rate Button, It is free of charge :-) |
|
2/22/2018 2:00 PM | |
Joined: 2/5/2013 Last visit: 10/14/2024 Posts: 288 Rating:
|
Dear Sirs, I've just downloaded the sample for Tia 14, made by Siemens available at: https://support.industry.siemens.com/cs/ww/en/view/59604194 An it return the #429 error. Why a working sample provided from Siemens should return an error? I've disarchived the project, added an alarm view, started simulation and pushed Datei speichern. The data folder exist on the PC, if I add an historical log with the same path it work. Am I doing something wrong? Please let us kwnow, thanks, BR |
Last edited by: Jen_Moderator at: 2/22/2018 2:38:06 PMOptimized Link. |
|
Follow us on