Play sounds in Twincat

jenako

Member
Join Date
May 2019
Location
Northampton
Posts
14
We need to integrate sounds in our projects (e.g. when a button is pressed a sound acknowledges the event). The idea is to integrate the above function in our Beckhoff IPC (windows 10) but I am struggling quite a lot to make this work. I am attaching a snapshot of the code I have developed in Twincat 3: although it does not come with an error it does not play the sound. Thank you in advance for your kind consideration.

Capture.PNG
 
I'm not familiar with the command you're using, but shouldn't you be pointing to the actual Media Player executable instead of a shortcut to it? On my Win 7 system it's located at:
C:\Program Files (x86)\Windows Media Player\wmplayer.exe
 
Yes you are right. I have it working now, if interested see the attachment. Thanks a lot for the responses!

NT_Sound(NETID:='',
PATHSTR:='C:\Program Files (x86)\Windows Media Player\wmplayer',
DIRNAME:='C:\Program Files (x86)\Windows Media Player',
COMNDLINE:='C:\Windows\media\chimes.wav',
START:=GVL.bSound,
TMOUT:= T#10S,
BUSY=> ,
ERR=> ,
ERRID=> );
 

Similar Topics

Hello, I'm using FactoryTalk View ME V10. I created a valve as a global object with multiple parameters and when the object is being used at the...
Replies
2
Views
130
Hello all, I was modifying an HMI in factory talk and went to change a go to display button using the ... to select from a list as I had done...
Replies
4
Views
176
Is there a way to add a local message display to Studio 5000 View Designer? If its there, I’m not finding it. I have used them in older versions...
Replies
11
Views
410
Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
148
Hello, I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I...
Replies
0
Views
109
Back
Top Bottom