LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication not correct and too slow

Solved!
Go to solution

Hey there,

so i have a 3D-Hall-Sensor (Infineon TLE493d-a2b6) connected to my computer via an arduino board (mega 2560). after a bunch of programming i managed to get the measurements sent to my computer correctly with a rate of about 50hz. Here is a screenshot from the Arduino IDE with the values.

Screenshot (214).png

i would´ve liked to have more than 50hz but it is fine for now.

 

The next step was to get the data into my labview program. This is the one i wrote (file attached):

Screenshot (5).png

Everything looked good until i started testing.

 

  1. The very first problem i noticed was that i had spikes in my x-graph, so the very first element that reaches labview. In my arduino IDE it read for example "0.13;0.00;0.00;" so x,y and z. But this string didnt reach labview like that. As you can see in the following screenshot, instead of reading "0.13" for x, the first symbol gets lost and it reads ".13". So it plots 13 as my measurement even though it is actually 0.13.

Screenshot (7).png

So that is the first problem that i couldn´t solve.

 

 2. After saving my data to a file i discovered another major issue.  instead of getting 50 measurements per second (which is already low) i get only 3 or 4.

 

Screenshot (8).png

So yeah that also something that is couldn´t solve yet on my own.

 

Maybe somebode of the community had a similar problem and has some suggestions on how to solve it.

 

Every help is much appreciated.

 

Thank you guys!

 

 

0 Kudos
Message 1 of 4
(1,713 Views)

First I recommend you watch this video: VIWeek 2020/Proper way to communicate over serial

 

Second, take a look at my response to this post: Can anyone help me how to read multiple sensors on Visa?

========================
=== Engineer Ambiguously ===
========================
Message 2 of 4
(1,708 Views)
Solution
Accepted by Jugo

1. Remove the wait.  This is limiting your loop rate instead of the data coming in.

2. Remove the VISA Clear.  This is clearing out data that is in the buffer, which I'm pretty sure you don't want.

3. Are you using the Serial.PrintLn() to send the data from the Arduino?  Make sure you are since that will append the Line Feed termination character for you, making life easier when reading.

 

Further, you might want to check out this presentation: VIWeek 2020/Proper way to communicate over serial



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(1,701 Views)

Hey man 😊

first of all, sorry for the late response!

 

I just removed the wait and the VISA Clear and It works so far just the way i am wanting it to😁 I really really appreciate that you took your time and helped me with my problem. Thank you very much👍

Cheers!

 

Message 4 of 4
(1,640 Views)