Sign in to follow this  
Followers 0
Logan1101

Gx Works 2 Structured Text

4 posts in this topic

I am trying to learn to write structured text using GX Works 1.597x in my spare time . I can't find much information on how to write timers in the logic using structured text. Can anyone point me in the direction of some good descriptive manuals, or some sample code using timers. I have looked through numerous manuals and haven't found any good information on timers.

I work maintenace and none of my equipment uses structured text, so I currently have no reason to learn it other than just for fun, so constantly reading manuals and learning the same information from every manual and yet not finding a single piece of information containing to timers in ST is getting really annoying and discouraging to learning the new language.

Thanks in advance

Share this post


Link to post
Share on other sites

The easiest way to find an ST instruction is to use the F1 help on FBD/LAD functions. In the help you'll find program examples in multiple languages, include ST.
Example in attached pic.

InkedST_TON.jpg

Share this post


Link to post
Share on other sites

You don't need to use the whole instruction. It'll work if you use it like this: TON_Inst(IN:= g_bool1 ,PT:= T#10s);

And you can use multiple condition in the "IN:=" section, for example: TON_Inst(IN:= (g_bool1 AND g_bool2 AND ect...), PT:= T#10s);

If you use it like this, you can refer to the operation condition of the timer in the further program lines like this: TON_Inst.Q

Share this post


Link to post
Share on other sites
On 5/25/2022 at 2:25 AM, tosza93 said:

You don't need to use the whole instruction. It'll work if you use it like this: TON_Inst(IN:= g_bool1 ,PT:= T#10s);

And you can use multiple condition in the "IN:=" section, for example: TON_Inst(IN:= (g_bool1 AND g_bool2 AND ect...), PT:= T#10s);

If you use it like this, you can refer to the operation condition of the timer in the further program lines like this: TON_Inst.Q

Using a timer in GX works 3 Structured text makes perfect sense now, but using it in GX Works 2 is different. 

How does it work in GX Works 2

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
Sign in to follow this  
Followers 0