07-05-2018 02:20 AM
I made the change by adding more sensors on the same Arduino and it works fine. Except one thing : at the first loop where I do a read Visa I get that overflow error code. I stop the program, and restart again, and it's ok. This happens one time of two at the begining. Once the first loop is done without any problem, I don't get any error after. This is not new, I alradeay had this problem starting this post. The loop runs at a speed maximum a few milliseconds, except when I press on STOP, where it takes 1 seconds. I am wondering if that doesn't create the overflow when I restart the program next time? I do close the visa port as it should down.
07-05-2018 06:16 AM
@User79 wrote:
at the first loop where I do a read Visa I get that overflow error code. I stop the program, and restart again, and it's ok. This happens one time of two at the begining.
Need to see code to diagnose. But it is sounding like you have something else happening between when you open the port and you start to read from it.
07-05-2018 09:37 AM
The problems occurs in this simplified program I have attached.
With the shift registers :
- If no problem at first loop I don't have have any problems later on
- if problem at first loop, I stop the program. If I start the program immediately after, in general it is ok. But it is seems that if I wait a bit, like 30secs or more, before restarting the program, I get that error on first loop. So the quicker I restart the program the less I havethat first loop problem.
When the shift registers have been deleted :
-I haven't been able to reproduce that problem. Always works fine, never had once this error code.
Regarding the loop timing, with or without shift registers, I get the same behaviour :
- iteration 0 around 10 to 20 ms
- iteration 1 : around 2490 ms
- iteration >1 : around 5ms
- last iteration : around 1000 ms
07-11-2018 09:19 AM
Hi everyone,
I am creating a new post to try to find a solution to my last question in this post (https://forums.ni.com/t5/LabVIEW/Problem-serial-communication-with-Arduino-nano/m-p/3813170#M1076951) that didn't get an answer.
When I run the attached VI I get this error (error code : -1073807252 ( (Hex 0xBFFF006C An overrun error occured during transfer. A character was not read from the hardware before the next character arrived) in some of the conditions below :
With the shift registers :
- If no problem at first loop I don't have have any problems later on
- if problem at first loop, I stop the program. If I start the program immediately after, in general it is ok. But it is seems that if I wait a bit, like 30secs or more, before restarting the program, I get that error on first loop. So the quicker I restart the program the less I have that first loop problem.
When the shift registers have been deleted :
-I haven't been able to reproduce that problem. Always works fine, never had once this error code.
Regarding the loop timing, with or without shift registers, I get the same behaviour :
- iteration 0 around 10 to 20 ms
- iteration 1 : around 2490 ms
- iteration >1 : around 5ms
- last iteration : around 1000 ms
I guess that when I don't use the shift registers, the error at first loop still occurs but it doesn't affect the next iterations.
I could just not use the shift registers, it would work fine, but I would like to understand why I am getting this first loop error (and why time restarting effects the behaviour of the program).
Would anyone have an idea?
Thanks.
User
07-11-2018 09:23 AM
You should be able to unmark the solution and continue your quest there.
07-12-2018 02:20 AM
Crossrultz's answer was a real solution as far as I was at that time. I have unmarked this post as solved if that's how it should be down on the forum.
07-12-2018 07:27 AM
Crossrulz's answer was a good one and would be the solution. The fact it was working then and is not now means something has changed with your communication. Offhand, I can't figure out why your VI is behaving the way you say it is now.
You should run your code and capture some of the data you receive in the string indicator. Save that value as default, then save the VI and attach the actual VI to the forum.
Rather than having a continual streaming of data, you'd be better off if you programmed your Arduino so it behaves like a query/response communication protocol. Have LabVIEW send a message that asks for data. The Arduino, upon receiving that message, then and only then sends back the data. LabVIEW will then read the data and parse it.
Having a query/response prevents the other device from flooding the serial port buffer while it is open as it will only send data when LabVIEW has requested it and is ready to receive it.