Author Topic: T100MD fastest refresh cycle  (Read 10992 times)

mauro

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
T100MD fastest refresh cycle
« on: November 14, 2004, 11:31:01 PM »
Hello:

I'm looking to find a way to read 16 independent digital inputs which can change their state at rates of 10 to 50 ms.

According to their states I'll have to follow some procedures, do basic math, send that data to a PC and place some states at the digital outputs. I feel quite confident if the routine goes in TBasic (still I can't figure it out how to do it using Ladder).

So far - to test the fundamentals - I have placed a Custom Function with a routine which basically writes a user message, and then changes an output inside a cycle using the SETIO/CLRIO and later the REFRESH (It loops continuosly without returning to the ladder in order to keep it simple to program).

However, with the above, the LCD shows the message to the user, but doesn't refresh the output state accordingly.

The problem seem to dissapear if I place a DELAY of about 1 or 2 secs beetwen every cycle excecution. (Here I understand that it should take only 2ms after the REFRESH is called).

The above derives the following questions about the PLC's behaviour:

  • Does the PLC performs the steps which follow the REFRESH simultaneously to the update of the phisycal states? (I mean, does the REFRESH function performs independent of the other processes?)
  • Does the REFRESH function takes the same estimated of 2ms of the Ladder to update the physical input/output?
I guess that if I could manage efficiently the REFRESH inside the Custom Function, I would be able to perform the activities in a convenient TBASIC program.

I will appreciate any advise about the use of REFRESH, or maybe in the way I should call the Custom Function without having more pieces of code in Ladder.

Best regards,

Mauro

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:T100MD fastest refresh cycle
« Reply #1 on: November 16, 2004, 08:52:18 PM »
When REFRESH is executed, the I/O states will be updated immediately. It does take approximately 2ms to perform a full I/O refresh cycle.  If you execute the REFRESH after you have finished updating the output bit the physical output should update accordingly. I am not sure why you did not see the output change state. Is it because it is too fast and you did not observe the change?
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mauroagain

  • Guest
Re:T100MD fastest refresh cycle
« Reply #2 on: December 07, 2004, 12:28:39 PM »
We have noticed that the delay on the action was related to the MONITOR application. It seems pretty slow when getting states at that rates.

The REFRESH on the PLC was performing correctly.

We have implemented communication to the PC via Hyperterminal in order to get the status of the PLC.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:T100MD fastest refresh cycle
« Reply #3 on: December 07, 2004, 10:37:14 PM »
In order to minimize communication overheads  impose on the PLC, the host link commands are typically only performed at the end of the ladder logic scan. However, if you have a WHILE loop within a custom function that never exit, it will still process the host link command at some time but it may appear to be slow in responding to your host link commands sent from the PC.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS