PC Worx Express - While/Repeat Loops

Hi, I am currently programming a Phoenix Contact PLC using PC Worx Express. The software and PLC programming in general are still fairly new to me.

I have got the PLC doing what I want it to do by using mainly IF statements but I am having some trouble with loops. I keep getting watchdog errors even when running simple loops, for example I am trying to run the following;

WHILE Global_Reset = FALSE DO
Red_Lamp :=TRUE;
END_WHILE;

I have a number of outputs and counters I want to reset using the global reset input but even with the simple function above I am having no luck.
Thanks for any help
 
Hi,

The code should be
IF Global_Reset = FALSE THEN
RED_Lamp := TRUE;
ELSE
RED_Lamp := FALSE;
END_IF

You would use WHILE/FOR loops specifically for repeating a piece code for n no. of times and then EXIT. Your code is stuck in the WHILE loop infinitely and hence you get a watchdog. (You could put an EXIT after RED_Lamp := TRUE and then it would work) but again use a Loop when you really need to. For your specific code above IF THEN ELSE is sufficient.

Hope this helps.
Thanks.
 

Similar Topics

We still have Proficy iFix and Kepware. Both has been suffering from lack of innovation and support, IMO. iFix I'm basically given up on but...
5
Replies
390
Views
Can anyone help me with a copy of the ProWorx 32 software or the installer? Need to backup a program from an existing Modicon 984 but site has no...
2
Replies
244
Views
Hi Folks, When am trying to connect to PLC (AXC 3050) in PC Worx with new project, Its not connecting and always getting the below error, The...
0
Replies
321
Views
I heard today's big news—Kepware, ThingWorx, and Proficy are now under the same roof (sold to TPG). Does that make sense to you? Proficy and...
5
Replies
871
Views
having dramas i thought i was working through but i have hit a speed bump. Have an existing Devicenet system with a heap of Tesys-T motor control...
0
Replies
322
Views
Top