Problem with Long-term archiving using "standard project" SIEMENS

VictorBit

Member
Join Date
Sep 2012
Location
Sweden
Posts
103
Hello!,

Im having some problems with the function, "How do you do long-term archiving with WinCC flexible?".

Im using Siemens standard project which can be found ;

https://support.automation.siemens....objaction=csview&extranet=standard&viewreg=WW

___________________________
My hardware and software ;
Siemens MP277 Touch 10".
WinCC flex sp3.
Windows XP sp3.
___________________________


Okey the problem I'm having with this project is that when the script which executes once an hour I get and error which says, ERROR the system cannot find the fiel specified in the script <Copy_Archive, line 41>

I got the PC connection correct setup to my panel, my pc name is "cad2" and in the scheduled script "storagePath" I got \\cad2\Storage_data\ which is correct I know this is correct beacuse if I choose to store my Data logs to this location (\\cad2\Storage_data) the CSV file popups in my shard folder and is updated once every X defined minute.

-If i look at the panel under, "my computer", I see there is a created folder that the script has done ( I did remove it and it pop up again after the script has been executed). The folders name is "Cad2 and in the folder I got the subfolders, Storage_data\Year_2013\month\7\day_8.

-I save my data logs to the usb on my panel , \Storage Card USB\.

-If I choose \Storage Card USB\ instead of \\cad2\storage_data\ on my scheduled script everything works fine..
But this is not what I want to achieve. I want to scheduled script to copy the data_log file into my shared folder using the "folder struct, year/month/day/hour.

#############################################################################
Im using the standard project which can be found on

https://support.automation.siemens....objaction=csview&extranet=standard&viewreg=WW

ALL that I have changed is on the "Scheduler, "Job_1" copy_archive storagePath to \\cad2\storage_data\ which is my shared folder on my PC.


#############################################################################


I'm sort of stuck here, I don't know what it is.. Maybe you can't achieve this function with this script?..

If you need more information or pictures,ask.
Any help is appreciated!

Best regards Victor
 
Sounds like a problem with your script at line 41.

If it works when you save it to another location then it must be the location that's giving the error.

Could it be that the path is causing the issue? I know in other scripting languages you use a \ to tell a compiler to not regard a " or a ' as literal etc...

I'm guessing there's something like this going on with your script. Could you post the script (Copy Archive) ?

;-)

PS. It could also be something silly like the path is too long perhaps??
 
Dim fs, FCopyName, NameArchiv, Name_StoragePath
Dim Variable_Day, Variable_Month, Variable_Year, Variable_Hour

'Name des Original Archivs
'Name of the original archive
NameArchiv = "Archive_01"


'Nach einem Stundenwechsel die vorherige Stunde berechnen zur dynamischen Namensvergabe des Archivnamens
'After hour change, calculate the hour before to set the Archive name with a "dynamic" name
SmartTags("Day_Old") = DateAdd("h", -1, Now)

Variable_Hour = Hour(SmartTags("Day_Old"))
Variable_Day = Day(SmartTags("Day_Old"))
Variable_Month = Month(SmartTags("Day_Old"))
Variable_Year = Year(SmartTags("Day_Old"))


'Name des Speicherorts
'Name of the storage path
Name_StoragePath = StoragePath & "Year_" & Variable_Year & "\" & "Month_" & Variable_Month & "\" & "Day_" & Variable_Day & "\"


'Aufruf des Skipts "Create_Storage_Path" => Erstellung der Ordnerstruktur
'Calling the script "Create_Storage_Path" => create the new folder
Create_Storage_Path Name_StoragePath


'Name der Datei, der kopiert werden soll => Der Name setzt sich aus der "letzten" Stunde zusammen.
'Name of the file which should be copied => The name are composed from the "last" hour
FCopyName = "Press_01_" & Variable_Hour & "0.csv"



'Dateizugriff
'File access
Set fs = CreateObject("FileCtl.FileSystem")

'Vorhandenes Archiv kopieren
'Copying an availanle archive
fs.fileCopy (StoragePath & "Archive_01" & "0.csv"), (Name_StoragePath & FCopyName)


'Verwendeten Speicher wieder freigeben
'Used storage will be freed
Set fs = Nothing
, The hole proejct can be found on the link I have posted.
 
Also looking at this part of the script:
Code:
fs.fileCopy (StoragePath & "Archive_01" & "0.csv"), (Name_StoragePath & FCopyName)

Have you looked in the 'help' to see what fileCopy is looking for?

That looks to me (just guessing here) like it's trying to copy the file to your StoragePath\Archive_010.csv ??

Have you tried just having:
Code:
fs.fileCopy (StoragePath), (Name_StoragePath & FCopyName)
 
Have done that, it complains that It cannot find the "archive file".

I wonder, can I run a WinCCflexible PC_runetime application on the PC where I want the data is to be stored and only use the PC_Runetime for showing trends and keep my main HMI, which is a mp277 panel?
 
Also looking at this part of the script:
Code:
fs.fileCopy (StoragePath & "Archive_01" & "0.csv"), (Name_StoragePath & FCopyName)
Have you looked in the 'help' to see what fileCopy is looking for?

That looks to me (just guessing here) like it's trying to copy the file to your StoragePath\Archive_010.csv ??

Have you tried just having:
Code:
fs.fileCopy (StoragePath), (Name_StoragePath & FCopyName)

Ill test
 
That fileCopy command is passed two arguments Source and Destination I think.

So you are saying that your Source is \\cad2\Storage_data\Archive_010.csv as far as I can make out... and then you are copying that file to the destination which is \\cad2\Storage_data\Year\Month etc... etc...

You need to change your Source to be the correct file I think.

Try that. ;-)
 

Similar Topics

Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
1
Views
17
Hi, I am having a challenge installing a new drive ACS355-03E-44A0-4 as it keeps on displaying Fault code F00018 even when the load is not...
Replies
3
Views
114
I have an issue on my vessel, we have water tight door system created in China, company is no longer operating. We have 7 doors each with their...
Replies
3
Views
111
Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
639
Hi; In a cabinet of a machine, a Fatek PLC with an Ethernet communication card is working. In the same cabinet, there is a 1 kW inverter. When...
Replies
16
Views
487
Back
Top Bottom