mostafa Posted May 12, 2013 Report Posted May 12, 2013 hi dears i want to produce a pulse with Arbitrary duty cycle, suppose i have a tag, and i want to turn it on for 5 second and turn it off for 2 second, is this possible?
mostafa Posted May 13, 2013 Author Report Posted May 13, 2013 Unfortunately, my controller is no timer, so as to produce a pulse, I have to use timers citect.
BobB Posted May 13, 2013 Report Posted May 13, 2013 Not a good way to do it - investigate the disk PLC that is built in to Citect - it may be best to do it there.
Dippy Posted September 8, 2014 Report Posted September 8, 2014 From 'Citect Project Editor/system/Events', Create a 1 second event to call the cicode function fnTimeCounter() From 'Citect Project Editor/Tags/(Variable Tags or Local Variables)', Create your digital tag. Using the Cicode Editor, create a function.. INT icounter; ! This is Global Variable ? FUNCTION fnTimeCounter() icounter = icounter + 1; IF icounter <= 5 THEN dTag1 = 1; END IF icounter >5 THEN dTag1 = 0; END IF icounter = 7 THEN icounter = 0; END END Compile and Run the Project. dTag1 will now switch ON for 5 seconds and Switch OFF for 2 seconds continously.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now