show the entry list
WinCC flexible ES -- Creating HMI configurations -- Creating scripts
How do you make printouts on different printers in WinCC flexible PC Runtime?
How are tags archived in WinCC flexible STRING?
How do you access an SQL database in WinCC flexible via a script?
Tips and tricks for creating scripts
How can you implement a wait function (delay) in a script?
How on a PC with WinCC flexible can you use a script to save and read out information in a text file?
How on a Windows-based panel can you use a script to save and read out information in a text file?
How do you start a sound file via a script in the WinCC flexible PC Runtime?
How do you dynamize objects in WinCC flexible via scripts?
Which VBS information and programming aids are there in WinCC flexible?
WinCC flexible ES -- Creating HMI configurations -- Configuring alarms and messages
How do you insert error messages of a frequency converter (SINAMICS and MICROMASTER) in a WinCC flexible or WinCC (TIA Portal) project?
How can you visualize the current status of the CPU on a WinCC flexible operator panel?
Message indicator continues to be displayed despite counter at zero
How do you start a sound file via a script in the WinCC flexible PC Runtime?
How do you establish a direct connection between HMI Panels and frequency converters (SINAMICS and Micromaster)?
How can you determine the bit number in WinCC for the "Trigger address", the "Acknowledgement PLC" bit and the "Acknowledgement HMI" bit for creating bit messages?
Which configuration steps have to be taken in SIMOTION SCOUT and WinCC flexible to enable Alarm_S messages and technological alarms to be displayed in WinCC flexible Runtime?
How do you display ALARM_S or ALARM_D messages with process values (so-called associated values) on a WinCC flexible operator panel?
How do you display messages in WinCC flexible?
How can you evaluate the ACK button on a touch operator panel in WinCC flexible?
How can you have system error messages from a SIMATIC S7-300 / 400 displayed in WinCC flexible?
How do you change and display SIMATIC WinCC flexible system events during configuration?
How can you change the ProTool default alarm window setting in WinCC flexible?
How can I acknowledge alarms in WinCC flexible via the PLC?
Why aren't messages output on the event recorder?
Why isn't the "Message display" shown in the foreground, but is covered by picture objects?
Why are no messages from the S7 diagnostics buffer display in WinCC flexible?
How can you get the diagnostics buffer to be displayed in WinCC flexible?
Which settings need to be made in order to display alarm events after a specified point in time?
How can you create messages with externally preset texts as mass data and process them with Excel in WinCC flexible?
How do you start a sound file via a script in the WinCC flexible PC Runtime?
Part number:

Instructions:
To play a sound file in WinCC flexible you need an external program that is started from WinCC flexible.

Often an acoustic signal is to be sounded in addition to a visual display on the operator panel when certain error messages are triggered. This permits operators who are otherwise occupied to clear the fault or faults so that the automatic process can continue.

Requirements:

  • WinCC flexible PC Runtime
  • Windows 2000 or Windows XP
  • Microsoft Media Player (mplay32.exe)

The "mplay32.exe" program is already included in both operating systems Windows 2000 and Windows XP. This program is located in the Window installation path in the folder "System32". Use the Search function of the operating system to find the program.
 
No. Procedure
1

Create a new project

  • Create a new project and select the WinCC flexible PC Runtime.


Fig. 01

2 Create a script
  • Create a new script.
  • Use the source code that is in Fig. 02 and add it to the script.
  • If necessary, change the path of the sound file and the executable file "mplay32.exe" on your system.


Fig. 02

3

Create a variable

  • Insert the tag "Tag_1" of the "INT" type as the internal tag.
  • Link the script created to the "Change value" event of the "Tag_1" tag.

    Note:
    If you want to have an acoustic signal sounded only for specific alarms, then you can also link the script to the "Activate" event of each of the messages.


Fig. 03

4 Configure bit messages
  • Create at least one discrete alarm.
  • Link the bit message or bit messages to the "Tag_1" tag.


Fig. 04

5 Add objects
  • Add a text field, an IO field and an Alarm View.
  • Change the name of the text field to "malfunction message 1-8", for example.
  • Link the IO field to the "Tag_1" tag and set the format type to "Binary".
  • If necessary, extend the format pattern to "11111111".
  • In the settings of the message class you mark the "Alarm events" selection field.
  • In addition you also activate the two message classes "Error" and "System".

Note:
It is recommended to add a button with which you can test the sound file. You can also call the external program without script, because all you need is the system function "Start Program".


Fig. 05

6 Start runtime
  • Start the WinCC flexible Runtime.
     
  • In order to simulate the error message you enter the number "00000001", for example, in the IO field and press the Enter button.

    Note:
    If no sound is emitted, check the volume and if necessary check the sound card settings. Also check the path and file names in the script.
     
  • Terminate the WinCC flexible Runtime.


Fig. 06

Download:
The download Attachment 1 contains the sample project described above without the executable file "mplay32.exe".

Attachment 1: WinCC_flexible_Sound_via_Script.zip ( 1661 KB )

Runnability and test environment:
The following table lists the components that have been used to create this entry and verify the functions described.
 
Components Product and version designation
PC operating system Microsoft Windows XP SP2 Microsoft Windows XP SP2 Microsoft Windows XP SP3
Standard tools -    
Engineering tool -    
HMI software WinCC flexible 2005 SP1 HF7 WinCC flexible 2007 HF4 WinCC flexible 2008 SP1
HMI system WinCC flexible PC Runtime WinCC flexible PC Runtime WinCC flexible PC Runtime

Keywords:
WAVE file, WAV, MIDI file, MID, Signal, Acoustic, Sound

 Entry ID:26106312   Date:2007-07-26 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour