Sign in to follow this  
Followers 0
KenE

Multi-process structured programming question.

1 post in this topic

Hello, I am looking for a new PLC system to replace an old "home grown" solution at the company I work for, for several reasons. We are looking at AB, Mitsubishi, and Siemens. I would like to program multiple processes (or tasks, or threads, you might call them) (upward to 16 or so) in structured text language, and have them scan all in under 1ms. Most of the processes are simple sequences such as: Cyl01 := TRUE; wait_with_timeout( Input:= Cyl_01_Forward, Timeout := 100, errcode := 1); Cyl01 := FALSE; wait_with_timeout( Input:= Cyl_01_Back, Timeout := 100, errcode := 2); Cyl02 := TRUE wait_with_timeout( Input:= Cyl_02_Forward, Timeout := 150, errcode := 3); etc, etc.... where the wait_with_timeout() function waits for the input to be true, or times out with an error code if it doesn't happen in time, and waits for operator confirmation before falling through. as you can see, most of the time the process is doing nothing, just waiting for the next input to be true from some actuator's input signal. Is there a way to do this with Step7? How can you make the processor go to the next process while you are waiting for an IO condition? I was originally going to have a SFC program that called the 16 Structured text functions in a parallel branch way, but how does the PLC go onto the next process in the SFC branch if the one before it is stuck in a "WHILE" loop waiting on input? Do I need to go to timed scan execution, which is potentially less efficient than continuous scan? I think the fundamental problem is that Structured text doesn't scan effectively like ladder or instruction list, because the way you program is different (or should be). Unfortunately a lot of the examples I've seen of Structured text programming have been direct conversions from ladder, which doesn't make sense because ladder will probably run those types of programs more effectively, for instance: if(input1) output1 := true; endif if(input2) output2 := true; endif etc, etc. Unfortunately this isn't effective use of structured programming and is quite waistful. Am I going about this all wrong? I know that somebody out there must be doing these kinds of things effectively in a structured programming manner! :o) Where should I be looking? Thanks, ~Ken

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