Linear_Guy

GT_Designer3(GOT1000) and object script for GT14 'Handy GOT'

3 posts in this topic

I've been tasked with developing teach pendant screens/functionality on a GT14 "Handy GOT".  What I'm attempting to do is alter the object's appearance based on selecting it via script.  There are several "drawing" based commands available when using the script editing window, but I'm struggling with getting my object to resize.

Here's something I've tried: if ([b:X0A2] ==ON) {clear_object(); [w:GD200] = my.width; [w:GD200] = my.height; redraw_object();}

I have attempted to write a value of '100' into GD200 in both the object script window, and within the Project Script window.  My thought was the GD200 device was empty so the script wasn't functioning.

I've tried many variations of the above and wish I could write hard values into 'my.width' etc, so I know for a fact the new values are present for the script to resize the object.

Any help would be appreciated, as I've spent waaay to much time on this already...lol.  ...and if there's a manual resource that explains specifically how these my.width/my.height commands are meant to be used, I can find it.

Thanks in advance

Share this post


Link to post
Share on other sites

widthStatement example

[w:D100] = my.width
Function Obtains the width of the object frame.
The setting range is 1 to 32767.

heightStatement example

[w:D100] = my.height
Function Obtains the height of the object frame.
The setting range is 1 to 32767.

Here  is an example of a script for hiding or showing an object.
You should be able to combine.

if ([b:GB1000] == ON ) {
    my.active = 1;
    my.input_security = 0;
    redraw_object();
} else {
    my.active = 0;
    my.input_security = 15;
    clear_object();
}
 

 

 

Share this post


Link to post
Share on other sites

Dear all,

I want to change a position of a Word Lamp object on the screen. The panel is GT2712-STBA. Please find attached the video.

The position of an object (marked with red circle at the beginning of the video) is given with GD131.

The script is as follows (called 1 time per second):

my.x = [w:GD131];
redraw_object();  
[w:GD132] = my.x;

GD132 is to make sure that the script is running.

But as you can see from the video, the x-position of the object is not changed. But it does only when the screen is redrawn (switch the screen back and force).

So it looks like redraw_object() doesn't work. This happens both in simulator and in hardware HMI.

Please help to understand where I'm incorrect.

Thank you!

 

got2000 redraw object.mp4

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now