You are not logged in.
Pages: 1
Topic closed
Hi guys.
I began to experiment with rex and unipi and decided measure time of powered digital input signal, which indicate material flow and later calculate amount of material used during the day. So i put square generator enabled by input in project and connect counter to it. So i expected to see when generator is 10Hz and is on 10s, there will be 100 pulses counted for calculations, but it is more like 89 pulses in 10s window when i examine situation in rexview, so if time scale of those graphs is ok, pulses seems stretchched. Is this something in timing of project settings which create delays?
Thanks.
Offline
Hi michmir,
thank you for your question.
According to your description, it seems that there is an issue in timing of your project. Please, can you upload all your project files so we can have a look at it and help you to solve the issue? If you mind sharing it with community send it via email to support(at)rexcontrols.com.
Regards, Tomas
Offline
Hi again,
the problem you are touching in your project is a feature of discrete systems.
Your task period is set to 20 ms. Therefore it is not possible to produce a square signal with period 100 ms (10 Hz). It's not possible to produce 50 ms pulses using 20 ms task period. Because there are 5 ticks for whole square signal period. In case of square signal there have to be even number of ticks.
The fastest frequency using 20 ms task period you can achieve is 25 Hz (40 ms = 20 ms HIGH + 20 ms LOW).
Note that the task period should be finest among all other time constants.
If you require any further information, feel free to contact me.
Regards, Tomas
Offline
Hi Tomas,
Thanks for quick help and clarification of discrete behavior of generator, i was thinking not so discrete of him before .
michmir
Offline
So here is the file, for anyone interested in logging digital input long time (include impulse counter in ON state. 10 impulses in 1s) for easy work with data in excel.
Offline
Hi michmir,
thank you for sharing your example on logging digital input - nice work!
If I may I would suggest to use RTOI (Real to Integer) function block instead of TSE function block. Do you use it to convert Real signal output from Signal Generator to Integer input of counter, am I right?
Another suggestion is about project timing. Be careful with too fast tasks periods - your main task is running with 1 ms period. Is it really necessary? For only one Digital Input it can be enough however for more complex tasks I would definitely extend the period.
You are logging every single event as separate item, right? May I ask what is the post-processing of your data in Excel?
Recently we have created example on measuring running hours - I thought it can be interesting for you:
Hour_Meter_example.zip
Good luck with your project!
Regards, Tomas
Offline
Pages: 1
Topic closed