WinCC 2008 - script for import/export recipes in CSV

italo2008

Member
Join Date
Feb 2009
Location
Padova
Posts
95
Hi

I'm trying to import and export datasets of a project in CSV files, using a USB key. The OP is Siemens MP277. The user must be able to export a dataset to a CSV file in the USB key, and import the dataset from the usb key. I've written a script for export and another script for import datasets, this is the code

EXPORT (I have 3 recipes, and SmartTags("Recipe data.Recipe_Number") is the number of dataset I want to export/import


Code:
ExportDataRecords "Filling Gains",SmartTags("Recipe data.Recipe_Number"),"\Storage Card USB\ExportedRecipe\FillingGains.CSV",hmiOverwriteAlways,hmiOff,StateExportFillingGains
Do    
Loop While (StateExportFillingGains <>4 And StateExportFillingGains <> 12)
 
ExportDataRecords "In_Flight",SmartTags("Recipe data.Recipe_Number"),"\Storage Card USB\ExportedRecipe\In_Flight.CSV",hmiOverwriteAlways,hmiOff,StateExportInFlights
Do    
Loop While (StateExportInFlights <>4 And StateExportInFlights <> 12)
 
ExportDataRecords "Production recipe",SmartTags("Recipe data.Recipe_Number"),"\Storage Card USB\ExportedRecipe\Production recipe.CSV",hmiOverwriteAlways,hmiOff,StateExportProductionRecipe
Do    
Loop While (StateExportProductionRecipe <>4 And StateExportProductionRecipe <> 12)


IMPORT

Code:
ImportDataRecords  "\Storage Card USB\ExportedRecipe\FillingGains.CSV",SmartTags("Recipe data.Recipe_Number"),hmiOverwriteAlways,hmiOff,StateImportFillingGains
Do    
Loop While (StateImportFillingGains <>4 And StateImportFillingGains <> 12)
 
ImportDataRecords  "\Storage Card USB\ExportedRecipe\In_Flight.CSV",SmartTags("Recipe data.Recipe_Number"),hmiOverwriteAlways,hmiOff,StateImportInFlights
Do    
Loop While (StateImportInFlights <>4 And StateImportInFlights <> 12)
 
ImportDataRecords  "\Storage Card USB\ExportedRecipe\Production recipe.CSV",SmartTags("Recipe data.Recipe_Number"),hmiOverwriteAlways,hmiOff,StateImportInFlights
Do    
Loop While (StateImportProductionRecipe <>4 And StateImportProductionRecipe <> 12)


my problem is that the first script works (I find the 3 files in the usb key, with the correct values), but the second doesn't, and the value of variables Stateimport.... is 12 (error). could someone explain me where is the mistake?
 

Similar Topics

Hi! I'm a little lost here. I have made a script in VB that run perfect when I simulate it on my programming machine (Windows 8.1) But when I...
Replies
9
Views
2,747
hello all i would like to know is possiable to use script in manner to trigger bit something myself not so fimiliar on esp using script...
Replies
10
Views
2,552
I have 4 arrays. 1. -> arrdb1 (array of 52 bytes) 2. -> arrdb2 (array of 20 bytes) 3. -> arr1db300 (array of 20 bytes) 4. -> arr2db300 (array of...
Replies
3
Views
3,504
Hello, I am currently in the middle of a project and looking to read data from a .csv file on a server. I need to read this data and get it...
Replies
5
Views
6,923
Hi all, I am trying to change the property of an object in the current screen. Changing the color of the object works fine but BLINKING property...
Replies
2
Views
5,689
Back
Top Bottom