×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 22583019, Entry date: 02/13/2006
(0)
Rate

How can you read texts from and write texts to a CF card with a Windows CE Panel?

  • Entry
  • Associated product(s)

Instructions:
You need a script in order to be able to store texts (string variables) on a Windows CE Panel configured with ProTool or save them on another PC by Ethernet.

Below are two example of how to implement this.
 

No. Example 1
1 The attached sample project creates a file called "Test.dat" on a CF card.
If the data is to be stored on a PC from a multipanel, you must change the path specification
"\STORAGE CARD\Test.dat", for example, to "\\SimaticPC\Data\Test.dat".

Note:

  • The name "SimaticPC" is the name of the computer.
  • The name "Data" is the release name of a path on the hard disk released for reading and writing.
  • The name "Test.dat" is the name of the file.

Detailed information on the topic of "Setting up an Ethernet connection between a WinCE Panel (except the 170 series) and PC" is available in Entry ID: 13336639 

Note:

  • The scripts used only run on a Windows CE Panel and not in the PC simulation.
    More information on VB scripts on a Windows CE device is available in Entry ID: 13408815
  • Note the path specification when using a CF card.
    => Storage Card or Storage Card2
  • The name of the file is predefined in this example. You can change this name and the file ending (e.g. *.doc; *.csv) accordingly.
2 Function description

In the "Write data" field you enter the text that you wish to save and accept the entry with the "Enter" key.
The entry is saved via the "write" button. You can then enter other texts and save them accordingly.
You delete the file created via the "delete" button.
You can have the first entry of the file displayed via the "read" button.
The current status is displayed under "Feedback".


Fig. 01

Project_1.zip ( 12 KB )

Copy the file into a separate directory and unpack in the Windows Explorer; use ProTool or ProTool/Pro to open the project.

Runnability and test environment:
The example can be used on operator panels that support script functions.

The following table lists the components that have been used to create this entry and verify the functions described.
 

Component Product and version
PC operating system Microsoft Windows XP Professional SP1
Standard Tools -
Engineering Tools -
HMI Software ProTool/Pro CS V6.0 + SP3
HMI devices Multipanel MP370 Touch
Controllers -

 

No. Example 2
1 The attached example contains a project each for a multipanel (Project_1_MP) and a project for a PC Runtime (Project_1_PC). The function of both sample programs is identical, but the scripts are different because of the different versions of Windows.

The sample program creates a file under a path and name you predefine on a CF card or on the PC's hard disk. The file can be written line by line and the content of the file can then be read out line by line. If the data is to be stored on a PC from a multipanel, you must change the path specification
"\STORAGE CARD\Test.dat", for example, to "\\SimaticPC\Data\Test.dat".

Note:

  • The name "SimaticPC" is the name of the computer.
  • The name "Data" is the release name of a path on the hard disk released for reading and writing.
  • The name "Test.dat" is the name of the file.

Detailed information on the topic of "Setting up an Ethernet connection between a WinCE Panel (except the 170 series) and PC" is available in Entry ID: 13336639 

Note:

  • The scripts of the MP project only run on a Windows CE Panel and not in the PC simulation.
    More information on VB scripts on a Windows CE device is available in Entry ID: 13408815
  • The scripts of the PC project only run on a PC and not on a Windows CE Panel.
  • Note the path specification when using a CF card.
    => Storage Card or Storage Card2
2 Function description

In the "path:" field you enter the drive and folder name and accept the entry with the "Enter" key; the folder specified must already exist. In the "filename:" field you enter the name of the file and accept the entry with the "Enter" key; if the file does not yet exist, it will be created accordingly.
In the "append new text to the text file" field you enter the text that you wish to save and accept the entry with the "Enter" key.
The entry is saved via the "write to file" button. You can then enter other texts and save them accordingly.
You delete the file created via the "delete file" button.
Via the "read from file" button you can read out the first lines of the file and have them displayed in the read area together with the line numbers. You can scroll through the file using the "Arrow down / Arrow up" buttons. In this way you can create a text list online and have the contents displayed.
Via the "delete read area" button you delete the 6-line read area; the file remains unchanged.


Fig. 02

Project_2.zip ( 31 KB )  

Runnability and test environment:
The sample program can be used on

  • Operator panels that support script functions.
  • PCs with ProTool/Pro Runtime V6.0 + SP3

The following table lists the components that have been used to create this entry and verify the functions described.
 

Component Product and version
PC operating system Microsoft Windows XP Professional SP1
Standard Tools -
Engineering Tools -
HMI Software ProTool/Pro CS V6.0 + SP3
HMI devices 1. Multipanel MP370 Touch
2. ProTool/Pro RT V6.0 + SP3
Controllers -