how to declare 1 second pulse in rslogix 5000?

I wanted to use slightly more portable code. DTR certainly does the job, but something like it isn’t always readily available elsewhere.
 
(ZOMBIE THREAD)
Simple solution, do NOT use timers to establish time intervals that require accuracy.

Use the GSV instruction, and you want WAlLCLOCKTIME (send it to an array of 7 DINTs). Take the 'Seconds' value (PLC_Time[5]), and pass it through a DTR instruction to an internal OTE.

Done. A one second period one shot based off of the system clock.

This will still be slightly off, as the system clock isn't perfect, but it's a whole lot closer then using a timer instruction.

BST GSV WALLCLOCKTIME   LocalDateTime PLC_Time[0] NXB DTR PLC_Time[5] 255 Sys_Old_Seconds OTE SYS_One_Second_OS BND 


Sorry to ressurect this old thread, but I'm having a hard time getting the DTR instruction to work. Any insight as to where I may have made a mistake? I copied your code suggested here but my OTE is not changing state. Thanks!

dtr.png
 
Sorry to ressurect this old thread, but I'm having a hard time getting the DTR instruction to work. Any insight as to where I may have made a mistake? I copied your code suggested here but my OTE is not changing state. Thanks!


Are you sure it is not changing state? That OTE will set that One_Second_Pulse for only one scan.


Try running that One_Second_Pulse into a CTU e.g.


Code:
... XIC One_Second_Pulse CTU Count_pulses 1000 0 ...
and see if that counter increments by 1 every second?
 
Are you sure it is not changing state? That OTE will set that One_Second_Pulse for only one scan.


Try running that One_Second_Pulse into a CTU e.g.


Code:
... XIC One_Second_Pulse CTU Count_pulses 1000 0 ...
and see if that counter increments by 1 every second?
Thanks for the reply. I'll give that a try!
 

Similar Topics

I'm new in PLC programming. I have a small project which have 12 temperature sensor. How I should declare the variable for this 12 sensor. I...
Replies
4
Views
2,390
I'm new in PLC programming. I have a small project which have 15 temperature sensor. How I should declare the variable for this 15 sensor. I...
Replies
3
Views
1,888
Hello Folks: I'm trying to create a function that takes an DINT to dynamically set the range to a random number generator. Below is the code, I...
Replies
7
Views
1,854
In my WinCC Runtime program, I have to declare these variables: Dim AllProperties As HMIProperties Dim objProperty As HMIProperty Dim...
Replies
0
Views
2,244
How to declare PIW PQW in WinCC (Analog Values)with simatic manager.... Any Examples Appreciated ..........
Replies
14
Views
7,691
Back
Top Bottom