Author Topic: Help needed with new project.  (Read 13866 times)

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Help needed with new project.
« Reply #15 on: June 10, 2006, 09:59:54 AM »
To add some clarity to the HSC speed discussion - at 14KHz at a single channel the CPU will be spending all its time servicing HSC interrupts. At the specified 10KHz the CPU will be spending 2/3 of its time servicing interrupts, but remaining 1/3 of time it is still able to perform regular PLC program execution and handling host link commands from the serial channels.

If you have two HSC channels running simultanesouly, then try limit the maximum pulse rate to about 5KHz each so that the CPU has time to run its regular task.

The HSC and Stepper motor outputs have the highest interrpt priortiy and as long as you don't run both HSC and stepper at max speed simultaneously HSC does not lose count easily. The serial communication interrupt only moves the data from UART registers into RAM serial buffer and it doesn't take up much CPU overhead. The actual serial command handler (such as MODBUS or host link command handler) are interruptible by the HSC interrupt so they don't affect the HSC count.

To maximize HSC counting speed, avoid using SAVE_EEP or SAVE_EEP$ when the program is handling high speed HSC inputs. During EEPROM save the system interrupts are turned OFF to protect the integrity of the EEPROM write and if you executes lots of EEPROM save when there are high speed incoming pulses it can cause the HSC to lose count.
« Last Edit: June 10, 2006, 10:01:34 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS