Author Topic: Trying to read a pulse period on FMD16  (Read 13103 times)

jbrandall

  • Newbie
  • Posts: 19
  • farmer boy
    • View Profile
Trying to read a pulse period on FMD16
« on: February 18, 2013, 03:04:18 PM »
I have upgraded from a nano to a FMD1616 and am trying to run a program that worked on the nano that I transfered to the FMD.  I am trying to read the pulse period on input #4 on every scan and I did do a PMON 2 on the first scan.  My statement is "temp1=PULSEPERIOD (2)" and when I monitor temp1, the numbers are all over the place, from 300 to 400,000 or more and sometimes negative.  I am using an old nano to trigger input #4 with what I believe to be a pulse every second; on for 2 tenths and off for 8 tenths.  My expectation is to see a number in temp1 around 1,000,000.  I do use input #4 to trigger other events functions.  What all am I missing??

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Trying to read a pulse period on FMD16
« Reply #1 on: February 18, 2013, 05:13:00 PM »
Is the variable temp1 a 32-bit variable (A to Z)?

Is the Nano-10 that you used to send the pulse to the FMD PLC using the same power supply as the FMD? If the two are on different power supply then you must connect a common ground between the two.

You can actually use the PWM output generated from the FMD PLC itself to trigger its input #4 (defined as PMON 2) and you should be able get stable readings. We just tested it and got a reading of 1000000.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

jbrandall

  • Newbie
  • Posts: 19
  • farmer boy
    • View Profile
Re:Trying to read a pulse period on FMD16
« Reply #2 on: February 18, 2013, 06:16:40 PM »
Yes temp1 is a 32-bit variable (T).

Nano running at 24v, FMD running at 12v, common ground.  They didn't play well together, so I put a mechanical relay between them. The led on input #4 blinks at about 60 per minute.  Should I be able to connect output 1 or 2 to the FMD input 4 with the different voltages?

"You can actually use the PWM output generated from the FMD PLC itself to trigger its input #4 (defined as PMON 2) and you should be able get stable readings."  I believe you, but I'm a little fuzzy on how.  Would I take my pulse generating routine and have it output to FMD #8 and then use ladder logic to have it turn input #4 on whenever output #8 is on?

Thanks for the help!

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Trying to read a pulse period on FMD16
« Reply #3 on: February 18, 2013, 07:47:37 PM »
I think what you saw was the relay contact bouncing that is giving you strange values from 300 to 400,000 that you mentioned.

You can try to use output 1 and 2 from the Nano-10 to toggle input to the FMD1616-10. Although they are using different power supply they should still work together as long as the 0v are connected in common (although the output LED will be ON all the time  - you avoid this by connecting a diode in series with the output of the Nano-10 to the input of the FMD1616-10.
 
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

jbrandall

  • Newbie
  • Posts: 19
  • farmer boy
    • View Profile
Re:Trying to read a pulse period on FMD16
« Reply #4 on: February 19, 2013, 10:09:12 AM »
Thank you! Everything works as it should, and I apologize for being so stupid. Seems it is really, really, really important that each end of each wire be where it is supposed to be!!:(  

Unfortunately some people think blue wires should be ground and others think black wires should be ground...  Doesn't make any difference when you just connect them together as in a relay, but it sure makes a difference when you connect only one of them to an output.

Thank you again.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Trying to read a pulse period on FMD16
« Reply #5 on: February 19, 2013, 02:58:10 PM »
 No problems! Thank you for letting us know you have resolved the issue.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS