wincc mp277 file write path??

mr_sleepy

Member
Join Date
Nov 2010
Location
Carnoustie
Posts
36
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.
 
Because the panel is CE the fso you are using will not work. It is for pc runtime. Do a search for panel scripts and I think you will find what you need
 
Thanks for that, I found a couple of help topics describing the sort of information i am looking for. Ill give it a try on monday when i go back to work and see how it goes o_O
 
Hi. Just wanted to mark this post as resolved now. Incase anyone else happens upon this post the code i ended up using was

Dim f
Set f = CreateObject("FileCtl.File")
f.Open "\Storage Card USB\Test.csv",8
f.LinePrint "Hello World,Hello Again"
f.LinePrint ";"
f.Close
Set f = Nothing

Makes a csv file on the usb stick called, u guessed it, test and it looks like this

Hello World | Hello Again
-----------|------------
;

If that makes any sense

Thanks for pointing me in the right direction 🍻
 

Similar Topics

I need some clarification about uploading the HMI file from a Siemens MP277 to edit it in WinCC. Although the machine manufacturer is no longer in...
Replies
1
Views
1,353
Hello everyone, I've a MP277 Key (8 inches), and I want to backtransfer the program that is running on it to my PC using WinCC Flex 2008, for...
Replies
4
Views
3,813
Hi I have a requirment to track barcodes and date stamps of said barcodes. It is unclear how many need to be logged but I would say 2000 rows...
Replies
14
Views
3,649
Hi everybody I want the PLC know the current page of the HMI (Siemens MP277, programmed with winCCflexible 2008). I set, in coordination -> page...
Replies
0
Views
2,729
Hello everyone. I'm working on STEP7 +Wincc Flexible 2008 with S7300 PLC and MP277 HMI. I need to put out on the HMI some tags that are in IEC...
Replies
7
Views
5,985
Back
Top Bottom