SIEMENS MP370 script failure


Thread Starter

Krunoslav Tusak

<P>Why the following script does not working on the MP370, in ProTool CS6.0 there are no errors or warnings, but system generates following error: 20010 ActiveX - can't create object!

<P>here is the VB script:
Dim fs, f ,s, fld, ss
Set fs = CreateObject("Scripting.FileSystemObject")

On Error Resume Next
Set fld = fs.GetFolder("\\Pap\Zoran-d\kruno")
ss =
If Not IsEmpty(ss) Then
Set f = fs.GetFile("c:\FLASH\PROIZVODNJA0.csv")
s =
file_size = f.size
If Not IsEmpty(s) Then
If (f.size > 1024) Then
datum = FormatDateTime(f.DateLastModified,vbShortDate)
SAT =CStr(Hour(Time))
MIN = CStr(Minute(Time))
f.copy "\\Pap\Zoran-d\kruno\" & datum & " - vrijeme(h-min) " & SAT & "-" & MIN & " - PROIZVODNJA0.csv"
f.delete true
End If
End If
End If
Two possible problems. The line Set f = fs.GetFile("c:\FLASH\PROIZVODNJA0.csv"). Why are you trying to get a file from a C drive. There is no C drive on the MP370. Is this a networked shared folder on some PC somewhere? Also if you did not mean to get the file from a C drive one of the other problems is that .csv files should never be stored on the internal flash of the MP. You should store the .csv on an external flash memory card. The line would then read Set f = fs.GetFile("\Storage Card\PROIZVODNJA0.csv")or Set f = fs.GetFile("c:\Storage Card2\PROIZVODNJA0.csv")if you are using a compact flash.

Ron Powers
Consulting Technical Support Engineer-HMI/IPC Siemens Energy & Automation-Solutions Business Unit Validation Center 5300 Triangle Pkwy Norcross, GA. 30092

Krunoslav Tusak

Sorry, this script was running on my PC during simulation that's why the line is:
Set f = fs.GetFile("c:\FLASH\PROIZVODNJA0.csv")
but on the MP the line is
Set f = fs.GetFile("\Storage Card2\PROIZVODNJA0.csv"), I am using CF card.

But my question is why the system report the following error:20010 ActiveX - can't create object! on the line:
Set fs = CreateObject("Scripting.FileSystemObject")

Basically I want to do this:
I want to archive data on the CF card, and when the archiving is done, then I must copy the archive on the LAN but archive name must be set according to date. After coping is done without errors I must delete archive on the CF card.
Since the list will not allow me to post actual application notes here is my email address. You can contact me directly and I will send you the
application note that I did that will do close to what you want to do.

[email protected]