I am running into a little bit of an issue and I don’t know what I’ve done wrong.
But I am working with a motor with a digital encoder. That encoder is sending pulses to a IDC-24. I am reading the frequency of that encoder from that card and from the card, it is showing the float number of the frequency. But when I grab the frequency from that port in Pac Control, it rounds the number. I need it to pull the float without rounding.
Attached image is of the card from Groov Manage and the window is a watch window from Pac Control.
Is there a setting that I am not seeing and I didn’t select?
Here are two of them that are retrieving the frequency and they are both acting the same way. And then the variable that I am moving it to to show that I am not moving it to an integer and that is possibly the reason why it isn’t grabbing decimal places.
EDIT: Oh, I forgot that it isn’t with just one Frequency, it is with all of them. I have 10 different frequency inputs that I’m using
EDIT 2: I think I may have messed something up with this request, I said “When I retrieve the freq”. It isn’t just when I retreive it, the first screen shot that I sent was from when you double click on the I/O ports in Pac Control to watch them and it is still showing there. Attached a screen shot of the area in Pac Control that I am talking about.
You will need to rework your logic a little bit and call GetPeriodMeasurementCompleteStatus to check if a period measurement is complete, then call Get & Restart Period. If you call Get & Restart before it is done (like calling in a short loop), you will restart it before it is done and get zero each time.