04-02-2023 08:05 AM
Hello people! We have to do a project for school and we decided to program 2 Ultrasonic Sensors with Arduino Uno and let the output Signals shown on a Graph on Labview.
Our problem is, that we can't convert the Data, coming from Arduino, into 2 different Signals. We don't see anything on the Graph, on read buffer or on the output 2.
I sent the programs into this feed. I hope someone has a solution for the problem.
Thanks and see ya!
Solved! Go to Solution.
04-02-2023 10:02 AM
Hi Snyko,
unfortunately you use LV2022 for you rVI, which I cannot open. It would help to downconvert for older LV versions, like LV2019!
On your Arduino code: I recommend to change the sent string into something like "number:value", where "number" is a unique identifier for your sensor and "value" it's value. This way you can parse the strings in LabVIEW more easily and decide which value belongs to which sensor…
04-02-2023 10:23 AM
Here is the program for another version, I hope you can open it now. Thanks for your help!
04-02-2023 10:40 AM - edited 04-02-2023 10:41 AM
Hi Snyko,
several suggestions:
- Use InitSerialPort instead of VISAOpen and enable the TermChar (default).
- Then get rid of BytesAtPort and read just 999 bytes - the TermChar will do the work fro you to read full messages!
- Don't use ExpresssVIs just to build a XY graph, a simple Bundle will do the same!
- Initialize shift registers!
- don't use InsertIntoArray when you want to build an array. Guess what BuildArray is for!?
- NEVER delete the label of frontpanel elements!
Suggestion:
04-02-2023 06:11 PM
@GerdW wrote:
Suggestion:
Except I would use a complex array. Only one shift register and append needed, no need for the bundle, etc.
04-04-2023 07:11 AM - edited 04-04-2023 07:18 AM
The scan from string still doesn't work, I sent you the shown error. We don't know what you mean, we have to change in the arduino. It's the first time we use that program. Can you sent us an explanation for that?
Which propertys do we have to set on the Visa serial port?
04-04-2023 07:38 AM
Hi Snyko,
when the VISA resource is valid, but not accessible, then you should close the other tool you currently use to access that port!
There can be only one (software) accessing this shared resource!
@Snyko wrote:
Which propertys do we have to set on the Visa serial port?
Read the help for this function, especially the paragraphs on the TermChar.
Then use it lwith default settings as they match the string sent from your Arduino…
04-04-2023 10:01 AM
Thank you very much, it works!!