Trying to run a gateway tag change script to play a sound on the gateway only (no client running) at the push of a button on a PLC. The script runs, but the sound doesn’t play, possibly because its running in the background…?
Hopefully this is an easy one.
I’m sure I’ve done something like this before I just can’t find it!
It’s some seriously simple stuff… pretty sure its something to do with windows services not being able to play sounds.
if not initialChange:
if newValue:
soundFile = "sound.wav"
soundPath = "C:\\"
system.util.playSoundClip("%s%s" % (soundPath, soundFile), 1.0, 1)
print "i played a sound"
else:
print "i didnt play a sound"
Just a thought if you aren’t able to get it to play from the gateway context - you could have a client running on the gateway with some specific username/role, then you can send a message from the gateway to that client to play the sound.
Might want to post this question in the beta forums, then - that, or test your current solution on a 7.x server installed to confirm if its a beta problem or not.