Kkula
Browse Questions » SIMATIC S7-400 / S7-400H / S7-400F /FH: Accurate Hertz rate Sensor reading Including Fm450-1

About User

Questions Asked: 37.9K

Answers Given: 32

0
  • Open

SIMATIC S7-400 / S7-400H / S7-400F /FH: Accurate Hertz rate Sensor reading Including Fm450-1

I have read the manual for the FM450-1, and see that this is used for high-speed counting.  However, I didn't see any description on how to best use this for frequency measurement. It seems like using a software timer and the counts would be prone to some error, and using some type of interrupt would be the way to go.  Is there a recommended way to do this? Like a system clock function or something that should be used in an interrupt? If so, how should that interrupt be implemented exactly (which block, etc.)? Or is there a solution much simpler than this?

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Frequency Measurement with FM450-1

You are correct to question using a simple software timer for frequency measurement with the FM450-1. It's prone to inaccuracies. While the FM450-1 is optimized for high-speed counting, it can be effectively used for frequency measurement using its interrupt capabilities.

Recommended Approach: Interrupt-Driven Measurement

The most accurate method is to utilize the FM450-1's interrupt functionality tied to a system clock. Here's a breakdown:

  1. Timer Block: Use the built-in Timer Block (TB) within the FM450-1.
  2. Interrupt Generation: Configure the TB to generate an interrupt at a precise, known frequency (derived from the system clock).
  3. Count & Calculate: In the interrupt service routine (ISR), read the current count from the FM450-1's counter. Subtract the previous count to determine the number of pulses received during the timing interval. Frequency = (Pulse Count / Time Interval).

Implementation Details

Refer to the FM450-1 manual, specifically the sections on the Timer Block (TB) and Interrupt Controller (IC). Look for examples of using the TB in interrupt mode. The system clock frequency is crucial for accurate time interval calculation.

Resources

This interrupt-driven approach provides significantly improved accuracy compared to software timing methods.

0