WAGO CodeDeSys

In TwinCAT which is based on the CoDeSys IDE, I use the R_Trig or F_Trig function block. R_Trig is rising edge and F_Trig obviously falling edge.

Declare a variable as either R_Trig or F_Trig in your variables, you also need to declare another variable as the input for you function block:

VAR
fbVariable : R_Trig;
bAnotherVariable : BOOL;
END_VAR

then in your ST code:

fbVariable(CLK:=bAnotherVariable)

You will then be able to use fbVariable.q within your ST code.

Jon.
 
I have not used the 833, but here is a sample program illustrating the use of the R_Trig instruction. Basically,
the program uses a Timer to increment a variable as long as the .Q bit is energized and it uses the .Q to trigger the R_Trig instruction, so the variable Count_2 only increments one time. Notice that the instance of the R_Trig must be declared in the varaiables declaration for the code to work.

You should be able to open this with CoDeSys and run the program in simulation mode.

Regards
 
Before there was F_TRIG and R_TRIG

There was good old fashioned programming.
bool bNew = false;
bool bOld = false;

if ( bNew & !Old )
{

}
Old = bNew;

This seems obvious and the method is universal. Also, the compiler will probably make a function call to do the R_TRIG or F_TRIG whereas no function call is required the old fashioned and universal way.
 
You guys are much faster than I am. Thanks! I only get to program part of the time but thoroughly enjoy it.

Thanks I'll run the file too.

I'm using the one shot to trigger/enable a MOV. The MOV has two inputs and one out to destination. Why two inputs, I thought a move was from one destination to another.
 
If you are using ST then you don't have to use the MOVE function. You can do the same thing by the statement Var1 := Var2; see CoDeSys MOVE Statement help file.

Regards
 
Slight modification of Peters code:

This i have used sometimes..:

IF BLAHA AND NOT EDGE THEN
BLAHAHAHAHA (This code only executes once)
EDGE:=1

ELSE IF NOT BLAHA THEN
EDGE:=0

END_IF

as a good reference of how one could use ST you can look into the oscat.de library the sources for the function blocks is availible in txt format with comments and such in english..

EDIT: NOTE oscat.de is a website
 
ST and MOVE work good. When people are just starting it seems that you go from one problem to the next until you get it down or have an example. I am now dabbling in the FbControl_PID_adv and set up one for what I plan on using for control. Ran into where that I need the integration to reset when I switch from auto to manual (xAutomatic mode)which works fine but I am having a problem where the output resets to zero when switching to auto even though the reference is zero and the rActual value has a value lets say 5. At a gain of 1 I would expect the output to read 5. While in auto I can change the rActual to 6 then the output goes to 1. I would expect it to go to 6. Because it changed I know the PID is running.
 
The last project that I did with the Wago 850-741 used three PID loops and although it was pretty straight forward to setup, the PID instruction did not function as I thought that it should. I got it working, but it took a while to tune it properly and I never was really happy with the performance. I would recommend that you call Wago tech support for the PID issue at (800) 346-7245. Their tech support department is really helpful and experienced.

Regards
 

Similar Topics

Hello, I am in possession of a WAGO PFC 200 750-8216 which I was successfully able to set up as a Modbus RTU Master to a slave device using...
Replies
0
Views
76
I have a project to setup base programs across multiple PLC platforms that can be used for Modbus communications to various sensors that have...
Replies
0
Views
118
Hello, I m having a problem with wago 750-862 plc. The plc won't start automatically in run mode after a power reboot. I've also tried the...
Replies
4
Views
345
Hello everyone, I am trying to setup a Wago 750-8100 PLC to send a text message out via ethernet port, if I get a Digital input that is true. I...
Replies
0
Views
342
How do you set up a message block for a REMOTE IO unit? (using ethernet IP)?
Replies
1
Views
594
Back
Top Bottom