No announcement yet.

P3K tasks and timers

  • Filter
  • Time
  • Show
Clear All
new posts

  • P3K tasks and timers

    Up to this point my experience is with DL260 CPU. I am now using the P3K 550E. It is different animal as I have discovered. I have an application that cycles HP air at up to 6000 psi into 10 sample ports using solenoid valves and pressure transducers. For life cycle testing a pressurization cycle may be repeated up to 25,000 times.
    The pressurization cycle closes an exhaust valve for one second, opens the port valves, then opens the HP air valve. The sequence is repeated in reverse order. That constitutes one cycle.
    My MAIN TASK continuously monitors pressures and operator input. That is run every scan.
    The user selects a cycle test via a C-MORE EA9 HMI. Once the START CYCLE button pressed this sets a boolean value (RUN LINKED CYCLE TEST) to ON. When the main task detects that the contact is ON, it calls the LINKED CYCLE TEST task.
    In that task are timers to control the valves and the delay between the activation of the HP AIR, PORT INLET and EXHAUST valve solenoids. The first scan through the task seems to run fine, but then the main task hooks up. It does not loop through to the end and detect the CYCLE RUN contact to call the RUN CYCLE TASK task (it appears). I am new to this task structure. In the past I would do stage programming. I guess this is how I thought the task structure worked, but I suspect not.
    It would appear that the main loop is not calling the RUN CYCLE TASK again after the task ends.

    Attached is the RUN CYCLE TEST TASK and MAIN LOOP

    Attached Files

  • #2
    You would need to latch in your Run Linked Cycle Test until your Linked Cycle Test is complete. If the boolean bit is only true for one scan it will only call that task fro one scan. You could Set it in logic, or if you could set it to on in the HMI( maybe with toggle) and then use a RST in your Linked Cycle Test where your other RST instructions are.


    • #3
      Thanks for the reply. I think I know what you're saying, but the bit is still set each scan ( I know this because I monitor it). Maybe I can try calling each task from the main loop (no enable bit to call it or not call it), but in the actual task I read the bit. If the bit is not set I enable a Return from Called Task. Once the cycle counter hits the max count, it will reset the Run Linked Cycle Test.


      • #4
        Looking at your logic it looks like you are calling the task from your main task. Just as long as the logic preceding the call instruction on the rung is true it will call the task each scan. Also you only need a Return from called task instruction if you wish to jump out of the task before the end of the task. You do not have to have the instruction at the end of the task. Once it gets to the last rung it will return to the spot in the ladder where the call task was executed and continue to scan ladder.


        • #5
          Thanks, techme. That is how I expected it to work. I am certain that I see the bit always set. It is initially set by the user opening the RUN CYCLE screen. The only even that resets it the cycle count reaching the set maximum. It never gets to that point. Perhaps it's a problem with the timers? I see the DONE bit reset when the timer reset enable logic is set. However the timers keep timing up.


          • #6
            Timers will continue to accumulate after they reach presets. If the timer current time value is continuing to accumulate after you rest it and it is not enabled you should look for duplicate timer tags being used someplace.


            • #7
              Thanks. I changed my timer reset event to a TIMED coil at the end of the task and it's looping properly.