How would I send an analog signal every 5 seconds in Click PLC software?

Aljubovic

Member
Join Date
Jan 2023
Location
Louisville, Ky
Posts
88
I need to change my program to increase a IP transducer by 0.5 psi every 5 seconds. I am making a automated pressure tester using a pump, IP transducer, pressure transmitter and more.

Right now I have the program setup where it starts to ramp up the IP transducer by 1 psi every second. Once the program detects that it has passed a certain pressure point using the pressure transmitter, it switches to 0.5 psi every second.

I do this by just putting a 1 second edge NO command on the rung, and the output is a math function that adds 0.5 psi to the Ip trasnducer. Inststead of adding 0.5 psi every second to the IP transducer, I want to send 0.5 psi every 5 seconds. Is there a special clock I can use in the click program to enable the math function every 5 seconds?

I was thinking about using a timer for 5 seconds and when it is done it enables a command that sends 0.5 psi to the transducer. Then it resets after it is done and repreats after 5 seconds until it stops. Not sure how I will reset it after every 5 seconds thought. Is there an easier way to do this?
 
Last edited:
My first thought would be look at the Timed Drum instruction block. Automation direct has some great videos on how to use the drum instruction. Just my 2 cents
 
I don't know what you mean by "send."

If "send" means via Modbus or some other protocol, and the send is being triggered programmatically by a device (e.g. PC, RaspberryPI, etc.), you could simple send the 1.0 or 0.5 value to a Click-internal tag, let's call it INCREMENT, at each time period expiry, and have the Click PLC continuously perform two steps:

  1. Add the value of INCREMENT to the IP transducer value
  2. Assign a value of 0.0 to INCREMENT
That way, most of the time, the first step will be adding 0.0 to the transducer value.

And any time the external device or process writes a value of 0.5 (or any non-zero value) to that INCREMENT tag, the Click will add that value, but only once because of the second step.
 
^^^+1 to what Timlindz said

I would definitely be looking at a drum instruction for this application.

If you had to go the timer route I supposed you would have to set the output of the timer to a one shot coil so that it can trigger the math and then let it reset the timer.
 
Oh, sorry, I misread the original request.

Two approaches

  • The one you describe: use a Normally Closed contact with the timer bit (Tn) as the contact's operand on the rung feeding the 5s timer. That contact will reset the timer every 5s (approximately), and the Tn bit will be 1 for one scan cycle every 5s so it can trigger the math instruction.
  • Run the 1s edge to a counter that has a preset of 5. The counter bit (Cn) triggers two things:
    • the math instruction to add 0.5 to the IP transducer output
    • either resetting the Cn counter or writing a 0 to the Cn accumulator value
    • N.B. having Cn trigger a reset may not work if the 1s signal is not an edge (one-shot) because the 1s signal may still be 1 on the next scan cycle, which may cause the counter to increment to 1 on that next scan.
 
Or... You could send 0.1 every second ?. that is 0.5 every 5 seconds.
Or as posted, reciprocating timer
N/C Txx OUT Txx, timer starts because the timer has not reached it's SP,
When it does Txx contact turns on, thus next scan Txx Coil is true so timer turns off in other words every 5 seconds the timer coil is only on for one scan.
 
I would probably use a single self-resetting timer to trigger the incremental addition to the analog output value. Then I would have logic to control varying the timer preset and logic to control the size of the increment at the different sections of the test cycle.

How accurate does the time time increment need to be? Be aware that when you use a simple self-resetting timer (a timer that has a NC 'done' contact in its enabling logic), the actual time between increments will always be slightly more than the preset. That's because you always lose one PLC scan while the timer is being reset and because the act of resetting zeros the timer, losing any accumulated time in excess of the preset.

For example, say you have a PLC with a scan time of six milliseconds and a self-resetting timer with a preset of 1000 milliseconds. Worst case, the scan before the timer reaches its preset (Scan 0), the accumulated value is 999 milliseconds. In the next scan (Scan 1), the accumulated value will be 1005 milliseconds, so the timer instruction turns on its 'done' bit. In the next scan (Scan 2) the timer is no longer enabled, so the accumulated value is driven to zero and the 'done bit is turned off. You just lost eleven milliseconds.
 

Similar Topics

So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
428
can the slc500 5/05 send a email and text over Ethernet ?
Replies
3
Views
185
Hello Friends I have took the sample program from AB webpage and modified, but I can only send 127 chars...
Replies
1
Views
181
I have followed the videos & still having issues getting the email out. Does anyone have knowledge or has sent an email notification via gp pro ex?
Replies
0
Views
193
Hi there! I have a question to a (maybe) simple issue that I hope some of you can help me with. I''ve made an FC containing the TCON, TDISCON...
Replies
13
Views
3,193
Back
Top Bottom