# Trend a Photoeye

I currently have a photo eye (bool) that’s reading 160 pins per minute in a rotating wheel. I tried to trend this photoeye to show the spike in a graph everytime the photo eye turns 0 and 1. I was expecting to see 160 spike on the chart but rather 3 spike, one of them on for 30 secs, one for 10 secs, etc. By analyzing the graph, it seems like the photoeye was staying on for too long but it was actually changing 1 to 0 everytime the photo eye change its status. I used the same signal in a counter to see if the signal wasn’t consistent but the Counter was counting up at the same rate as eye.
My question is, is Ignition capable of storing the info coming from the photo eye at the same rate? If so, what should I do. Is the graph not set properly? By the way, I am using an easy chart and 0.001 for the timing.

Some quick math indicates that your maximum scan time for that tag would have to be 375 ms. That’s pretty quick… that’s also assuming that the pin, gear or whatever it is that you’re reading with the photo eye has the same amount of time off and on, i.e. the duty cycle is 50% which also probably is not the case. Without knowing the specifics of your system it’s hard to say if this is even possible.

You’d be much better off calculating the pins per minute value in the PLC and then trending that value every second or couple of seconds. You would get much more reliable, and probably useful, data that way.

Thanks. Would you be able to elaborate more?

What are you ultimately looking for? That would help determine the best way to get the data you want.

If it were me, I would probably use the PLC to count the time between photo eye pulses (leading edge from one pin trigger to leading edge of the next pin trigger) and then use that time to calculate what the pins per minute value would be.

So, for example, say your wheel (or whatever it is) is rotating at 160 pins per minute. The time between pin triggers would be 375 ms, so you would take 60/.375 to get 160 pins per minute. I would then create a tag in Ignition that would look at the pins per minute value in the PLC and I would trend that tag at whatever scan rate was appropriate.

If you just try to trend each pulse from the photoeye then you will have to manually count the number of pulses to figure out how many pulses per minute you are getting, I don’t think you want to do that.

*Also, some PLC’s have a frequency function that you can use on inputs to calculate this for you.

Ivwill try to do option #1.Thank You very much!