Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: PLC program with configurable Timer object

PLC program with configurable Timer object 12 years 2 months ago #1023

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
I am using the Timer object in my PLC program to delay a signal. Currently I have defined a fixed TimerTime but this should be configurable without changing the PLC program. Can the TimerTime parameter be set at RunTime in some way?

Otherwise I would probably use a CArithm object with some simple C-code.

Ondrej
The administrator has disabled public write access.

Re:PLC program with configurable Timer object 12 years 2 months ago #1025

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3048
  • Thank you received: 454
  • Karma: 125
Hi Ondrej,

Yes, you can set the TimerTime in runtime, for example from the plc-code with a StoAp or CStoAp.

/Claes
The administrator has disabled public write access.

Re:PLC program with configurable Timer object 12 years 2 months ago #1026

  • robert
  • robert's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 178
  • Karma: 0
Changing the TimerTime to a timer-object won't take effect for an active timer-object (one that is already counting). It will take effect first when the timer is retriggered.

/Robert
The administrator has disabled public write access.

Re:PLC program with configurable Timer object 12 years 1 month ago #1027

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
Hi Claes and Robert,

this works perfectly.

Thanks for your help, Ondrej
The administrator has disabled public write access.

Re:PLC program with configurable Timer object 12 years 1 month ago #1030

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
Now I ran into another problem.

In some cases I need to stop/reset (not restart) the timer. This doesn't seem possible. Is there some other object I could use instead?

Ondrej
The administrator has disabled public write access.

Re:PLC program with configurable Timer object 12 years 1 month ago #1031

  • robert
  • robert's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 178
  • Karma: 0
I guess you could play with the internal attributes of the timer object (timercount and timerflag). The best way though is to put some logic after the timer object that makes the job for you.

/Robert
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 4.525 seconds