Playing and Stopping a video by a tag status

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
berkengin
Posts: 1
Joined: Sun Apr 12, 2015 4:10 pm

Playing and Stopping a video by a tag status

Post by berkengin »

Hello,

I am able to play a video in DEMO Mode which I will upload to a pc as a runtime ultimately. I need to start a video according to a tag status. Is it possible in iX developer?

Thank you very much for your time...

User avatar
Kyle W.
Posts: 36
Joined: Wed Apr 09, 2014 3:16 pm

Re: Playing and Stopping a video by a tag status

Post by Kyle W. »

There are a couple of ways I would go about this. Please remember that iX Developer is event driven. So we need something to trigger the video (like a tag change you mentioned above).

The first way I would go about it is to go to the screen with the media player on it and have some kind of a trigger (like an analog numeric input value change) and use this code:

if(Globals.Tags.Tag1.Value == 20)
MediaPlayer.Play();
else
MediaPlayer.Stop();

That would play the video on the screen. If you wanted to do it from a script module, or from the tags scripting area, the best way would be to have a popup window that is the same size as the video player you want, and then when the tag gets to whatever value you want to trigger the video with, you would open the popup like this:
if (Globals.Tags.Tag1.Value == 20)
PopupScreen.Show();
else
PopupScreen.Close();

In the popup screen scripting area, you would put under the "Opened" action:
MediaPlayer.Play();

If you need additional help, I can upload a sample program that does this.
Best Regards,

Kyle W. | Applications Engineer
Beijer Electronics, Inc.

Post Reply