Jump to content

Newbie Question


Recommended Posts

Guest Magog
Posted
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

Posted
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.
Posted (edited)
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
Posted
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.
Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...