Author Topic: Porbelm using internal timer  (Read 10311 times)

sengbeng

  • Newbie
  • *
  • Posts: 4
  • I'm a llama!
    • View Profile
Porbelm using internal timer
« on: July 09, 2006, 07:03:07 AM »
 Hi,

I am using the internal Timer to control the solenoid on/off timing. Found that the timing is not accurate when i measure it by scope. For example the timer setting is 20ms but the actual output can be vary 1 out of 10 times to 40 ms.
Can it be due to inconsistent scan time ? Program with number of custom function will cause irregular scan time ? How to over come the problem ?


regards.
sengbeng
    ???

sengbeng

  • Newbie
  • *
  • Posts: 4
  • I'm a llama!
    • View Profile
Re:Porbelm using internal timer
« Reply #1 on: July 10, 2006, 08:46:02 AM »
Hi,

Yes, I'm using high speed timer & setting for the solenoid on/off is 20ms.
What i want to know is the timer operate independently ? The output driver  for the solenoid off time will not affect by the scan time.
eg) long scan time > 20ms due to number of custom function enable within the PLC ladder program.

regards
sengbeng ???

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Porbelm using internal timer
« Reply #2 on: July 10, 2006, 11:30:45 AM »
The scan time of the PLC varies depending on the length of the ladder program and the complexity of the custom function being executed during the current scan. Minimum scan time for T100MD+ PLC is 2ms which is due to the long I/O scan time (which also includes software debouncing). It is possible that during a certain scan your ladder+TBASIC custom function consumes more than 20ms of CPU time. Since the timer contact, just like the I/O are only updated at the beginning of the ladder logic scan if you measure with a scope the timer output may occur only 2 scan time later which could explain what you are observing.

You will probably have to look into your program to reduce the possible bottle neck in your execution if the timing is so critical.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS