×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 22700159, Entry date: 03/07/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 save texts (string tags) on a CF card or to save them onto another PC by Ethernet.

Below are two examples 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 Windows CE 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 extension (e.g. *.doc; *.csv) accordingly.
2 Function description
  • In the "Write data" field enter the text that you wish to save and apply the entry with the "Enter" key.
  • The entry is saved via the "Write" button. You can then enter other texts and save them accordingly.
  • The file which is created is deleted by clicking the "Delete" button.
  • You can have the first entry of the file displayed via the "Read" button.
  • The current status is displayed under "Handshaking".


Fig. 01

Project_1.zip ( 2373 KB )

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 SP2
Standard Tools -
Engineering Tools -
HMI Software WinCC flexible 2005 Advanced HF4
HMI devices Multipanel MP370 Touch
Controllers -

 

No. Example 2
1 The attached example contains a project for a multipanel (MP_Project_1) and one for a PC Runtime (PC_Project_1). 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 Windows CE 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 enter the drive and folder name and apply the entry with the "Enter" key; the folder specified must already exist.
  • In the "Filename:" field enter the name of the file and apply 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 file" field enter the text that you wish to save and apply 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.
  • The file which is created is deleted by clicking the "Delete" button.
  • Click the "Read file" button to read out the first 6 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.
  • Click the "Delete read area" button to delete the 6-line read area; the file remains unchanged.


Fig. 02

Project_2.zip  ( 4068 KB )

Runnability and test environment:

  • Can be used on operator panels which support script functions.
  • PCs with WinCC flexible Runtime

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 SP2
Standard Tools -
Engineering Tools -
HMI Software WinCC flexible 2005 Advanced HF4
HMI devices 1. Multipanel MP370 Touch
2. WinCC flexible 2005 Runtime HF4
Controllers -

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit