Sign in to follow this  
Followers 0
Guest Magog

Newbie Question

5 posts in this topic

Hi :*-( , I'm new to PLC programming and am trying to get my head around how to do the following. I want to basically pulse four outputs on and off at a known frequency independant of the state of any inputs. Ideally I'd like different frequencies for each of the outputs. Is this possible with ladder logic or otherwise on a PLC? I'm using an old Mitsubishi FX0 under Melsec. Many thanks Iain

Share this post


Link to post
Share on other sites
The PLC has some bits that toggle on and off at fixed intervals, like 1 second, which you can probably use. Get the FX Programming Manual from www.meau.com and it goes into detail on all of those special bits.

Share this post


Link to post
Share on other sites
I'm going to assume you mean frequencies that are much higher than the scan time. The PLSY instruction will let you do exactly that but on the FX0N, you can only use Y0. I presume you are stuck with that model so..... Do you need all 4 at once? You could set some inputs as selection bits and change between 4 frequencies if you don't mind them all being on Y0. Or you could use timers. Or you could get fancy and check out the following bits per Chris's suggestion: M8011 - 10 millisecond toggle bit M8012 - 100 millisecond toggle bit M8013 - 1 second toggle bit M8014 - 1 minute toggle bit D8099 - ring counter (integer) - increments every 100 microseconds. Counts from 0 to 32767 and then starts again at 0. The problem with using any of the above other than PLSY is that the end of every scan has a long delay (470 microseconds) which will interfere with any attempt at higher frequencies. You could try to stay inside of a single scan and keep refreshing the watchdog (that's quick to do) but then you'd lose your ability to read inputs, timers, etc (if you need them). You could manually refresh the inputs but that takes quite a bit of time too. But for lower frequencies, it can be done. Jim Rowell Edited by JimRowell

Share this post


Link to post
Share on other sites
For a single output use 2 timers. One self latches to give you an OFF time and the next one triggered by this first one will give you the ON time.

Share this post


Link to post
Share on other sites
Here's an example of using timers for very low frequency toggling of 4 outputs. The outputs will be 50% duty cycle (same on and off time). ;Operate the timers. LD M8000 OUT T0 K5 ;500ms OUT T1 K10 ;1 sec OUT T2 K15 ;1.5 sec OUT T3 K20 ;2 sec ;When each timer times out, reset it so it will start counting again ; and then toggle the output. LD T0 RST TO ALT Y0 LD T1 RST T1 ALT Y1 LD T2 RST T2 ALT Y2 LD T3 RST T3 ALT Y3 END Jim Rowell

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