Author Topic: Speeding up the PLC for time-intensive applications  (Read 12077 times)

Agradon

  • Guest
Speeding up the PLC for time-intensive applications
« on: July 29, 2004, 06:46:02 AM »
The problem I am having is the fact that my application requires me to output a number to the PLC's outputs at a fairly high speed. I wrote the simplest program I could think of that would toggle one output bit on/off using the command "TOGGLEIO out1", "out1" being the name given to the pin output[1],0. I hooked up a probe to this output leading to an oscilloscope and ran the program, resulting in a peak speed of about  5ms per on/off cycle. With a 16 Mhz processor, the output should be able to update a lot faster then that, and I was wondering if there was any way of achieving this result.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Speeding up the PLC for time-intensive applications
« Reply #1 on: August 01, 2004, 10:56:30 PM »
The TOGGLEIO only toggle the memory bit inside the controller. At the end of the ladder logic scan the PLC has to update its entire I/O bank in an I/O refresh cycle. The I/O refresh implements software debouncing technique to filter out glitches that could be introduced by noise and the I/O refresh time takes approximately 2ms. That is the main reason that the PLC is unable to toggle an output quickly.  The minimum scan time of the PLC is therefore = logic scan time (approx. 10us per word) plus I/o scan time (minimum 2ms).

If you need to send out a fixed number of pulses, you may use the STEPMOVE command to achieve it.  That allows you to output a fixed number of pulses at frequency up to 10KHz.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Agradon

  • Guest
Re:Speeding up the PLC for time-intensive applications
« Reply #2 on: August 02, 2004, 10:24:58 AM »
My application requires me to output the binary equivalent of a decminal number to the LED outputs, the STEPMOVE command simply outputs a pulse, so it doesn't help me. It seems that the T100MD will be inadequate for my particular application, which is a shame since I have already programmed most of the application, but the speed limitation is crippling.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Speeding up the PLC for time-intensive applications
« Reply #3 on: August 03, 2004, 08:47:27 AM »
Are you doing some kind of multiplexing of 7 digit LED display? What is the speed required? If it is multiplexing of 7 digit LED as long as it is faster than 30 refresh per second (about 33 ms) it is OK to the human eye. Otherwise you do need a dedicated micro for such purpose as the PLC is designed to handle multiple tasks efficiently but not designed to be particularly quick for I/O refreshing.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

benb2000

  • Jr. Member
  • Posts: 56
  • I love YaBB 1G - SP1!
    • View Profile
Re:Speeding up the PLC for time-intensive applications
« Reply #4 on: August 06, 2004, 08:22:19 AM »
Just to clarify a statement made,

The moderator said" The minimum scan time of the PLC is therefore = logic scan time (approx. 10us per word) plus I/o scan time (minimum 2ms).

If I read this correctly, If I want an interupt service routine to be capable at 150 hz, 6 ms period, I cannot have more than 400 words in the program.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Speeding up the PLC for time-intensive applications
« Reply #5 on: August 09, 2004, 11:36:46 AM »
Interrupt service latency is not dependent on the word length. The only factors that can affect the interrupt latency are other interrupt based services such as host communication, stepper output, high speed counter inputs and EEPROM read or write.  As long as these services are not in the way the interrupt latency usually is not much longer than 2ms.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS