iX Talk
http://beijerinc.com/support/ix/forum/

Jump between screens depending on a variable.
http://beijerinc.com/support/ix/forum/viewtopic.php?f=14&t=1927
Page 1 of 1

Author:  MAlvarez [ Thu Jun 25, 2015 1:24 pm ]
Post subject:  Jump between screens depending on a variable.

Hi!

When users press the Button1 of Screen2, depending on the value of the variable (Giro1, Bit, D200.0), need the code jumps to the Screen5 (popup) if Giro1 = 0 and jump to the screen4 if Giro1 = 1, but always jumps to the Screen5 regardless of the value of the variable.

What am I doing wrong ?.

PLC = Omron CP1E.
HMI = iXPanel T4A. Windows Embedded CE 6.0.

namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using Neo.ApplicationFramework.Controls.Script;


public partial class Screen2
{
void Button1_Click(System.Object sender, System.EventArgs e)
{
if (Globals.Tags.Giro1.Value == 0){
Globals.Screen5.Show();
}else {
Globals.Screen4.Show();
}
}

}
}


Thank you very much.

Author:  Claus Nielsen [ Tue Jan 26, 2016 8:53 am ]
Post subject:  Re: Jump between screens depending on a variable.

Try

Code:
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using Neo.ApplicationFramework.Controls.Script;


public partial class Screen2
{   
void Button1_Click(System.Object sender, System.EventArgs e)
{
if (!(bool)Globals.Tags.Giro1.Value){
Globals.Screen5.Show();
}else {
Globals.Screen4.Show();
}
}   

}
}


Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/