Levent1970

How can I Set or Reset Bit's in GX Works3 Structured Text?

6 posts in this topic

Hi,

I am searching for a  Possibility to Set bits in Set or Reset State. How can i do that?

in Example the Code in LD:

SetReset.png

and in ST

EQ_E( Merker79 AND Referenzfahrt_TP_Ein_Aus = TRUE , bDummy , P_Achse_Istpos_pulse , 0 );

PLS( bDummy , Drehrichtung_P_Achse AND M8140 AND Loeschen_Positionszaehler_Achsen AND Startpos_anfahren_nach_Referenzi AND P_Achse_Referenziert = TRUE );

Edited by Levent1970

Share this post


Link to post
Share on other sites

Dankeschön !!! But I didnt find anything about Set Bits to Set or Reset condition.

Share this post


Link to post
Share on other sites

Take a look at this manual

http://dl.mitsubishielectric.com/dl/fa/document/manual/plc/sh080366e/sh080366ej.pdf

[ST program example 1]
IF M0 THEN
Y0 := TRUE;
END_IF;
The above program is equivalent to the following.
LD M0;
SET Y0;


To avoid the bit device being always ON, change the program as shown below.
[ST program example 2]
IF M0 THEN
Y0 := TRUE;
ELSE
Y0 := FALSE;
END_IF;
The above program is equivalent to the following.
(a) LD M0;
OUT Y0;
(b) Y0 := M0;
(c) OUT_M (M0, Y0);

Share this post


Link to post
Share on other sites

OK Looks Good, I found out how it Works:

Like this:

SET(TRUE,Y0)

Or

RST(TRUE,Y0)

 

Share this post


Link to post
Share on other sites

Or

IF activation_tag THEN

Y0 := 1; // Set Y0

END_IF;

IF deactivation THEN

Y0 := 0; // Reset Y0

END_IF;

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