News:

  • October 12, 2025, 04:49:54 PM

Login with username, password and session length

Poll

hello everyone . new to DS5,  it appears the TMRA is the appropiate timer but the >/= instruction will not accept a number of 1500.0 seconds.   are there any other options to turn on a coil at 1500.0+ seconds and off again at 1800.00 seconds?

1
0 (0%)
1
0 (0%)

Total Members Voted: 0

Author Topic: I require a 30 minute timer (TMRA)?  (Read 7143 times)

Rtony

  • Newbie
  • *
  • Posts: 2
I require a 30 minute timer (TMRA)?
« on: November 12, 2009, 06:35:07 PM »
hello everyone . new to DS5,  it appears the TMRA is the appropiate timer but the >/= instruction will not accept a number of 1500.0 seconds.   are there any other options to turn on a coil at 1500.0+ seconds and off again at 1800.00 seconds?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: I require a 30 minute timer (TMRA)?
« Reply #1 on: November 12, 2009, 06:56:47 PM »
Since TMRAs use two 16-bit words, you must use the CMPD box (Compare Double).  Do a LDD K15000 then a CMPD TA0 (or whatever timer accumulator you are using).

SP60 will be ON when the value in the accumulator is LESS THAN the value in the CMPD instruction
SP61 will be ON when the values are equal
SP62 will be ON when the value in the accumulator is GREATER THAN the value in the CMPD instruction

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: I require a 30 minute timer (TMRA)?
« Reply #2 on: November 12, 2009, 06:58:01 PM »
Oh, those SPs are ONLY VALID IMMDIATELY FOLLOWING THE CMPD instruction, so use them right after the CMPD rung.

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Re: I require a 30 minute timer (TMRA)?
« Reply #3 on: November 13, 2009, 06:45:41 AM »
   are there any other options to turn on a coil at 1500.0+ seconds and off again at 1800.00 seconds?

Rtony,

PLC 06

// Rung 1
// Address 0
STR TA1 K1
AND TA0 K5000
ANDN TA1 K2
ANDN TA0 K8001
OUT Y1

// Rung 2
// Address 9
END

// Rung 3
// Address 10
NOP

// Rung 4
// Address 11
NOP


#BEGIN ELEMENT_DOC
"TA0","","","timer accumulator lower word"
"TA1","","","timer accumulator upper word"

#END
Vaughn

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3761
    • Host Engineering
Re: I require a 30 minute timer (TMRA)?
« Reply #4 on: November 13, 2009, 08:55:10 AM »
That type of logic doesn't really work if those limit values change (e.g. try 12000 to 28000).  CMPD is the proper mechanism for comparing double values, not relational contacts.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: I require a 30 minute timer (TMRA)?
« Reply #5 on: November 13, 2009, 11:24:15 AM »
But that doesn't work very well since he has an upper AND a lower bound to check.  He'd have to LDD one, check it and save the result, then LDD the other limit, check, and combine.  My first inclination is to do:


wad-o-logic --> and NO SP4 -->  CNT C0 K9999


with appropriate reset, and range check CTA0.  SP4 should be a differential contact to be sure not to count the same second multiple times if the timed event flashes on and off rapidly during the on-phase of SP4, but the differentials won't accept SP4 as an address, so you'd have to set up an intermediate coil and use the differential from that.

So the better solution is:

PLC 260

// Rung 1
// Address 0
STR X1
STRN SP1
TMRAF T0 K9999

// Rung 2
// Address 5
STR TA0 K100
STR C0
CNT CT0 K9999

// Rung 3
// Address 11
STR TA0 K100
MATHBCD TA0 "V0 - K100"

// Rung 4
// Address 29
STR CTA0 K1500
ANDN CTA0 K1800
OUT C1


#BEGIN ELEMENT_DOC
"X1","","","Event to Time"
"C0","","","Reset Condition"
"C1","","","Output"
"T0","","","Second Timer"
"CT0","","","Second Counter"
"CTA0","","","Seconds Elapsed"

#END

In the first solution, the counter mostly takes care of the accumulation, so you could get by with the SP4 contact (with differential logic) or a non-accumulating recycling timer.  But the second one is better, because it's accumulating down to the 10ms/1 scan level, so you don't have to worry about phasing issues between the event being timed and SP4.

This way also minimizes scan-time dependency, because of only subtracting 100 from the timer ACC value if it's over 100, as opposed to actually resetting the timer.  Otherwise, you'll accumulate error of 1/2 scan time per second.  
« Last Edit: November 13, 2009, 01:36:36 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: I require a 30 minute timer (TMRA)?
« Reply #6 on: November 13, 2009, 02:38:24 PM »
Or, just two TMRA's:

PLC 260

// Rung 1
// Address 0
STR X1
STR C0
TMRA T0 K15000

// Rung 2
// Address 5
STR X1
STR C0
TMRA T1 K18000

// Rung 3
// Address 10
STR T0
ANDN T1
OUT C1


#BEGIN ELEMENT_DOC
"X1","","","Event to Time"
"C0","","","Reset Condition"
"C1","","","Output"
"T0","","","Start Timer"
"T1","","","Stop Timer"

#END

OR:

PLC 260

// Rung 1
// Address 0
STR X1
STR C0
TMRA T0 K15000

// Rung 2
// Address 5
STR T0
STR C0
TMRA T1 K3000

// Rung 3
// Address 10
STR T0
ANDN T1
OUT C1


which uses T1 as a duration timer.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Rtony

  • Newbie
  • *
  • Posts: 2
Re: I require a 30 minute timer (TMRA)?
« Reply #7 on: November 16, 2009, 10:38:50 AM »
 :)

Thank you very much guys!!!  I got 'er up and running using the LLD,CMPD instructions because I wanted to learn them.    however I did have to reverse the CMPD's output special relays using SP60 to turn on the motor after 15000 sec contrary to the DL105 manual pg 5-58.

fun project,

this forum works great!!   

thanks