How do you start a sound file via a script in the WinCC flexible PC Runtime?
With sound files the operating staff can be made acoustically aware of errors which occur and acknowledge them accordingly.
In WinCC flexible to play a sound file you need an external Media Player which is started from WinCC flexible RT. For the operating systems Windows 2000 and Windows XP this is "mplay32.exe", in Windows Vista and higher the player is called "wmplayer.exe". (Use the Search function of the Windows Explorer to determine the storage location of the application.)
There are two ways of triggering playing of the sound file with the WinCC flexible Runtime:
- Call the player in a script that is connected to a system function (an incoming error message, for example) or
- Link the player to the system event of an operator control like clicking a button, for example.
We show both methods in the following.
Create new project
|2||Create script |
|4||Configure bit alarms |
|5||Add objects |
|6||Start Runtime |
When you use "wmplayer.exe" the options "/play" and "/close" are no longer available. The player does not close automatically after playing the sound. (For information about the command line options available with "wmplayer.exe" refer also to the relevant entry in the MSDN Dev Center)
The download contains the sample project described above without the executable files "mplay32.exe" and "wmplayer.exe".
WinCC_flexible_Sound_via_Script.zip (1661 KB)
WAVE file, WAV, MIDI file, MID, MP3, Signal, Acoustic, Sound