Author Topic: SetCtrSV/SetTimerSV  (Read 12893 times)

Bill

  • Newbie
  • Posts: 21
    • View Profile
SetCtrSV/SetTimerSV
« on: May 05, 2008, 07:53:58 AM »
I have discovered when executing either of the functions SetCtrSV or SetTimerSV from a triggered input or relay, I temporarily loose communication between my PLC and touch screen. I posted a question last fall regarding an anoying  communication problem with Maple System HMI where there was an occasional loss of communication with the PLC. I now see the same problem with Cmore touch panel. The only common denominator between the two systems is the use of these two function. Removing the functions eliminates the issue. In both cases they are being triggered by internal relay.

Any thoughts from Tri Research.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:SetCtrSV/SetTimerSV
« Reply #1 on: May 05, 2008, 09:38:02 AM »
SetTimerSV and SetCtrSV writes to the EEPROM, and during the EEPROM read/write the CPU needs to turn off its interrupts in order to prevent corruption to the read/write data. This could however lead to temporary disruption to communication with a HMI if the write happens midway when receiving a MODBUS command as a byte of character may be lost especially at high communication speed.

You could reduce the communication error occurrence by using the SETTIMERSV and SETCTRSV sparingly. E.g. if you are to make changes to timers or counter set values using some up/down keys, then you should make the changes in DM first which are stored in RAM, and only when the changes have been finalized then write them to the EEPROM via SETTIMERSV and SETCTRSV commands by triggering a "Record" or "Enter" relay.

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

Bill

  • Newbie
  • Posts: 21
    • View Profile
Re:SetCtrSV/SetTimerSV
« Reply #2 on: May 05, 2008, 08:54:58 PM »
Thanks for the information. I have used the technique you suggested. I find the communications to be unstable for some time after the function is executed. In my application counter and timer values are changed automatically based on machine speed. Can you reccomend a method to help synchronize communications after a change is made to the counters or timers.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:SetCtrSV/SetTimerSV
« Reply #3 on: May 06, 2008, 10:27:48 PM »
If you are constantly changing the timers' or counters' set value based on machine speed, then you can avoid using SETCTRSV or SETTIMERSV altogether since you can start off a timer with a desired set value by loading its present value counter with the value that is computed based on the machine speed. For more information, please visit this link:

http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=1046
Email: support@triplc.com
Tel: 1-877-TRI-PLCS