Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to change screen with script
PostPosted: Thu Jul 05, 2012 4:43 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Hi..

In my project to open the Alarms page I want to use script. Because first I control the alarm bit then if the alarm bit set I wll show the Alarms page.. How can I show screen in the script.

The code is below:

Code:
if ( Globals.Tags.Alarm_Bit.Value == 0)
{
MessageBox.Show("No Active Alarms !", "No Alarm",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
---- The code to show Alarms screen  -----

}






 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Thu Jul 05, 2012 8:33 am 
User avatar

Joined: Fri Jul 15, 2011 3:21 pm
Posts: 215

Offline
The code to show a screen looks like this.
Code:
Globals.Screen1.Show();

Substitute the name of the screen you want to show for "Screen1".

_________________
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Fri Jul 06, 2012 5:01 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Thanks for your reply mr Ron..

But I have a question again about scripting..

For example we have many of recipes and want to load a default recipe each system is powered on. So I have to write script for this but I didn't find what code to write into script. Please help..

Thanks already..

Mehmet.

Edit: I Found the code

Code:
Globals.Recipe.LoadRecipe(@"Recipe name");


Will be helpful..

Thanks


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Fri Jul 06, 2012 8:12 am 
User avatar

Joined: Fri Jul 15, 2011 3:21 pm
Posts: 215

Offline
Use the screen opened action of your startup screen.
Attachment:
Snap 2012-07-06 at 09.11.47.jpg
Snap 2012-07-06 at 09.11.47.jpg [ 67.84 KiB | Viewed 895 times ]

_________________
Best Regards,

Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Mon Jul 09, 2012 4:34 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Hi Mr. Ron..

I need a script again to log database once at the test start :(

Thanks already..


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Mon Jul 09, 2012 7:49 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
You could create a timer and turn the timer on and off via a button. That timer could increment a tag which is used to tell the datalogger to log data.

If you set the timer for 1 minute, when the timer is enabled, then every minute the timer will change the value of the event tag, and the datalogger will log some data. You just need to set the "Log on Tag event" of your datalogger to the tag that is being incremented via a timer.

Attachment:
Snap 2012-07-09 at 08.41.45.jpg
Snap 2012-07-09 at 08.41.45.jpg [ 45.91 KiB | Viewed 882 times ]

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Thu Jul 12, 2012 2:21 am 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Hi...

I don't want to open a new topic for my problem.. Anybody help me about changing font color of a button via script?

I tried to use Button1.Fontcolor but I didn't find what I must write after this code..

Thanks Already..


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Thu Jul 12, 2012 6:36 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
Try This:


Code:
this.Button1.FontColor = new BrushCF(Color.Aqua);

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Thu Jul 12, 2012 11:25 pm 

Joined: Fri Apr 27, 2012 12:33 pm
Posts: 44

Offline
Dear Mark..

Thanks for you for replies I know that I ask many question but I near to finish my project in 2 weeks. So; here is a problem that waiting me as creating test reference number.. For example; I want to give a reference number to my test as date.

Eg. Today is 13/07/2012 Time is 09:30 in this situation I want to create a reference number as 130712-0930..

I hope to help me about this problem..

Thanks..


 Profile  
 
 Post subject: Re: How to change screen with script
PostPosted: Fri Jul 13, 2012 7:15 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 644

Offline
The below code will convert the SystemTagDateTime, which is a tag that reports the current time on the HMI, to the format that you want.

To log this value into the datalogger, you will need to add the tag, RefID, to your test. Then it will show up as a column in the datalogger output.

You will need to decide on how you want to trigger the code. You could do it as part of a button that starts your test for example. Or you could put it in the value change event of the SystemTagDateTime tag.

Click for more info on DateTime formating

Code:
Globals.Tags.RefID.Value = ((DateTime) Globals.Tags.SystemTagDateTime.Value).ToString("ddMMyy-hhmm");



Attachment:
Snap 2012-07-13 at 08.07.31.png
Snap 2012-07-13 at 08.07.31.png [ 108.49 KiB | Viewed 854 times ]

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron