Sign in to follow this  
Followers 0
BadgerGuy

Ton Question

7 posts in this topic

When a TON finishes the timing and the DN bit goes true does it stay on until the timer is reset? I need a way to turn a flip switch (toggle) into a momentary. Thanks

Share this post


Link to post
Share on other sites
I thought of The OSR but the problem is that I need to reset that every minute or so. This is for a test. i am simulating an inductive sensor that triggers a test and I can't have the output high all the time I just need it to send a signal for about a second or so.

Share this post


Link to post
Share on other sites
Using a 2nd timer, try this: XIC I:0.0/0 BST TON T4:0 1.0 1 0 NXB XIC T4:0/DN BST TON T4:1 1.0 1 0 NXB XIO T4:1/DN OTE B3:0/0 BND BND

Share this post


Link to post
Share on other sites
Another option I have used is a counter driven by a free running timer. I set the counter to the overall period I want to repeat, and use the counter done bit to reset it. I then use compare instructions (GRT etc) to set the duty cycle(s) of the output. For more complicated outputs I set up an array of bits with each bit representing the smallest time increment I need. Then use bit shifts driven by a free running timer reloading one end of the array with the bit being shifted out of the other end. Set the bits with the desired output pattern and drive the output from one end of the array. One word of caution on either method is that accuracy is limited to scan time.

Share this post


Link to post
Share on other sites
Use the .TT (timer timing) bit instead of the .DN bit.

Share this post


Link to post
Share on other sites
You can still use a one shot and use a timer to reset the one-shot storage bit. (assuming its a SLC500) XIC SWITCH OSR B3/0 OTE B3/1 XIC SWITCH XIO B3/1 TON T4:0 1.0 60 0 XIC T4:0/DN RES B3/0 Edit.... If you can have your pulse as the end of a minute instead of at the beginning you could also do this. XIC SWITCH XIO T4:0/DN TON T4:0 1.0 60 0 XIC T4:0.ACC/3 XIC t4:0.ACC/4 XIC T4:0.ACC/6 OTE B3/0. B3/0 will be on for four seconds from 56 seconds to 60 seconds. (This hint should start you thinking about some of the dozens of creative ways to sovle the problem). Edited by Alaric

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0