Jump to content
OMRON Forums

PLC startup behaviour


rsipkema
 Share

Recommended Posts

Hi, working on my first project using delta tau hardware (UMAC) I have couple of (probably quite simple) questions: 1) How to have only a couple of PLC's enable on startup. I have a fg PLC (PLC0 during development, later PLCC0) running safety routines and want a couple of other PLC's running in the background. I also want to use some PLC's "on demand", i.e. I don't want them enabled on startup. What's a reliable way of doing this. Can I use PLC1 to disable the PLC's I don't want to have enabled on startup. Will PLC1 be scanned before the rest (2..31)? 2) When doing a phase reference, i.e. CMD"#1$" from a PLC, how to reliably check if it's done (within that PLC)? That is, what variables do I check in the while loop(s) following the $ command? TIA –Ronald Sipkema
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

[quote='rsipkema' pid='386' dateline='1272311256'] Hi, working on my first project using delta tau hardware (UMAC) I have couple of (probably quite simple) questions: 1) How to have only a couple of PLC's enable on startup. I have a fg PLC (PLC0 during development, later PLCC0) running safety routines and want a couple of other PLC's running in the background. I also want to use some PLC's "on demand", i.e. I don't want them enabled on startup. What's a reliable way of doing this. Can I use PLC1 to disable the PLC's I don't want to have enabled on startup. Will PLC1 be scanned before the rest (2..31)? 2) When doing a phase reference, i.e. CMD"#1$" from a PLC, how to reliably check if it's done (within that PLC)? That is, what variables do I check in the while loop(s) following the $ command? TIA –Ronald Sipkema [/quote] Ronald, As you mentioned, you can use PLC1 in order to decide which PLCs to be disabled upon power-up/reset. PLC 1 will be scanned before PLC 2..31 unless you have a while loop in your PLC1 before getting to the disable command line. I would suggest using a PLC 1 like this: [code] CLOSE // make sure all buffers are closed DELGAT // make sure free memory is not allocated for gather buffer OPEN PLC 1 CLEAR DISABLE PLC 2..31 DISABLE PLCC 1..31 // Do Some other initialization settings // Enable any necessary PLCs which should run DISABLE PLC 1 CLOSE [/code] Also, the foreground PLCs (PLC0 and PLCC0) are designed for time critical tasks which has to happen at a specified frequency (Real-time interrupt) which can be much less frequent than a background PLCC execution frequency. So if you want to use a PLC for emergency checks, a background PLCC is a better choice. When issuing a phasing command in a PLC, a.e. "#1$", if this initiates a phase search move such as stepper phasing search move or 2-guess phasing search move, then you have to check two bits from motor status register : Phasing reference in progress (bit 9) and Phasing reference error (bit 8). Also in addition you can wait for in-position bit (bit 0). Here is an example using suggested M-variable definitions: [code] CLOSE DEL GAT #define Mtr1InPos M140 #define Mtr1PhaseErr M148 #define Mtr1PhaseSrch M149 #define MachineStatus P1 #define PhaseSearchOK 1 #define PhaseSearchAct 0 #define PhaseSearchFail -1 OPEN PLC 2 CLEAR MachineStatus=PhaseSearchAct Mtr1PhaseErr=0 CMD"#1$" WHILE(Mtr1PhaseSrch=0) // wait for phasing search to start ENDWHILE WHILE(Mtr1PhaseSrch=1 OR Mtr1InPos=0) // wait for phasing to finish IF (Mtr1PhaseErr=1) // if phasing fails while waiting MachineStatus = PhaseSearchFail DISABLE PLC 2 ENDIF ENDWHILE MachineStatus = PhaseSearchOK DISABLE PLC 2 CLOSE [/code] Please keep in mind that this is just an example and you may have to check for more safety parameters in your system.
Link to comment
Share on other sites

[quote='Sina' pid='387' dateline='1272315614'] ... Also, the foreground PLCs (PLC0 and PLCC0) are designed for time critical tasks which has to happen at a specified frequency (Real-time interrupt) which can be much less frequent than a background PLCC execution frequency. So if you want to use a PLC for emergency checks, a background PLCC is a better choice. ... When issuing a phasing command in a PLC, a.e. "#1$", if this initiates a phase search move such as stepper phasing search move or 2-guess phasing search move, then you have to check two bits from motor status register : Phasing reference in progress (bit 9) and Phasing reference error (bit 8). Also in addition you can wait for in-position bit (bit 0). Here is an example using suggested M-variable definitions: [code] CLOSE DEL GAT #define Mtr1InPos M140 #define Mtr1PhaseErr M148 #define Mtr1PhaseSrch M149 #define MachineStatus P1 #define PhaseSearchOK 1 #define PhaseSearchAct 0 #define PhaseSearchFail -1 OPEN PLC 2 CLEAR MachineStatus=PhaseSearchAct Mtr1PhaseErr=0 CMD"#1$" WHILE(Mtr1PhaseSrch=0) // wait for phasing search to start ENDWHILE WHILE(Mtr1PhaseSrch=1 OR Mtr1InPos=0) // wait for phasing to finish IF (Mtr1PhaseErr=1) // if phasing fails while waiting MachineStatus = PhaseSearchFail DISABLE PLC 2 ENDIF ENDWHILE MachineStatus = PhaseSearchOK DISABLE PLC 2 CLOSE [/code] Please keep in mind that this is just an example and you may have to check for more safety parameters in your system. [/quote] Regarding the first issue, I've got this part up and running as expected now. I'll keep in mind only running things with specific timing constraints in PLC (or PLCC) 0. The second part proved somewhat trickier: I tried the code mentioned above; but one thing is still bothering me though. It works perfectly as a single PLC, but when more than one PLC is running it doesn't. My conclusion was that a second PLC scan, started before the phase reference could start, takes such an amount of time that the entire phase reference is finished before it comes back to the while loop. The PLC will continue to wait for the phase reference to start, which will never happen (since it's already finished). I implemented now by setting phasing error to 1 and then waiting for a timer; if there's still an error after the timer has expired than the phasing was unsuccesful. Is there another (preferred) way to do this? Is my analysis correct? TIA –Ronald Sipkema
Link to comment
Share on other sites

[quote='Sina' pid='395' dateline='1272476642'] The second PLC can not delay the scan of your first PLC that much. Why do you have another PLC while doing the phase search move? What are you trying to do? [/quote] The other PLC continuously does safety checking (air supply pressure, etc.). I don't understand why this PLC couldn't delay the execution of the other "that much". How long is "that much" anyway? What is the time needed for things to start. If it's theoretically possible to be preempted for some time the I think the (psuedcode): start something; while not started wait; while not finished wait; way of handling things will always be error prone. I need an approach that's always going to work, not 99% of the time. In some of the examples I've seen there's half a dozen PLC's running at the same time. But even if I managed to write a very long and slow PLC that preempts another for the maximum duration I want my code to work. –Ronald Sipkema
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...