From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-23-2015 02:19 PM
hi ,
since i don't have a digital input module i tried to use the serial port RS232 on my Crio to read the data from an absolute encoder in order to perform PID control for a dc motor, but the problem is that the data took too match time to be read; there is a big delay between the first read position and the next one,and when i change the slide controller the indicator took time to change, although it should be instantinouse, here is
a snapshot of my vi.
please i need help.
.
04-24-2015 10:33 AM
Hi Moho,
Looking at your code I see a couple of things that might be causing the issue. How long is the delay that you are experiencing? You are trying to transfer 2000 bytes every loop which will cause some delay. You also have a lot of mathematical operations that can take time between loop iterations. Also what is the VI that you have manipulating your waveform? Have you looked into the PID VIs?
04-24-2015 09:31 PM
I would take a look at the serial query. Does it always return 2000 bytes every time, with the correct data? Is there a delimiter in the message that you can use instead?
04-25-2015 04:41 AM
HI,
i have reduced the number of bytes to read to 4, but still the same problem now some times it start working normal than began to slow down and some time it is too slow even when i change the slide controller its indicator took time to change, although it should be instantinouse.
04-25-2015 06:03 AM
Just put the serial query in a loop by itself and see how fast it can run. Then use a number higher then that to set your loop timing. Also, 9600 is really slow for a serial encoder.