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
IMPORT
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?
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?