mr_sleepy
Member
Hi all. Just newly signed up for this forum but i have been here many times already when searching for answers, long may it continue . Hopefully in the future i can make a usefull contribution here as many of the other posters do, but first i need a favour.
Ive only been programming plcs for about 8 months now professionally and started off learning about omron before the powers that be decided to get me to learn siemens and then re-do everything that we currently make in omron as a siemens system to give customers more flexibility when choosing a system.
Anyway ive been working on the replica system for about 4 months now learning as i go and have come to the datalogging part of our machines which is quite important especially if the customers have been mistreating the machine so we can do some detective work :| The system we are using includes a cpu 3152dp and a mp277 10" touchscreen linked via profibus. I know the mp277 does datalogging as standard which can be stored on a stick etc but as usual with all the standard features it doesnt quite do what we want so i need to make my own script and write a csv file in the correct format that we require from the data. I looked up some vbscript commands and tried to write a basic text file to the usb stick (it is a siemens usb stick) but so far i have been unable to write to the correct path. I tried the code in simulation on wincc and it wrote the file to where i expected it to go but i cant replicate that on the actual hardware. The code i have been using is straight from the example which is
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("\Storage Card USB\testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
When i run this script i fire it from a button on the screen and then look for the generated file. I know it works in the simulation and if i run datalogging in the simulation it writes to the same loacation but on the actual screen the datalogging writes to the usb but the script does not. Its probably a long shot but does anyone have any idea why the script isnt working. I have looked around for a few answers already but none of them quite fit my circumstances.
Thanks in advance for your time.
Ive only been programming plcs for about 8 months now professionally and started off learning about omron before the powers that be decided to get me to learn siemens and then re-do everything that we currently make in omron as a siemens system to give customers more flexibility when choosing a system.
Anyway ive been working on the replica system for about 4 months now learning as i go and have come to the datalogging part of our machines which is quite important especially if the customers have been mistreating the machine so we can do some detective work :| The system we are using includes a cpu 3152dp and a mp277 10" touchscreen linked via profibus. I know the mp277 does datalogging as standard which can be stored on a stick etc but as usual with all the standard features it doesnt quite do what we want so i need to make my own script and write a csv file in the correct format that we require from the data. I looked up some vbscript commands and tried to write a basic text file to the usb stick (it is a siemens usb stick) but so far i have been unable to write to the correct path. I tried the code in simulation on wincc and it wrote the file to where i expected it to go but i cant replicate that on the actual hardware. The code i have been using is straight from the example which is
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile("\Storage Card USB\testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
When i run this script i fire it from a button on the screen and then look for the generated file. I know it works in the simulation and if i run datalogging in the simulation it writes to the same loacation but on the actual screen the datalogging writes to the usb but the script does not. Its probably a long shot but does anyone have any idea why the script isnt working. I have looked around for a few answers already but none of them quite fit my circumstances.
Thanks in advance for your time.