05-03-2025 02:48 PM
Hello everyone!
I'm currently making a project connecting Arduino to a VI in LabVIEW and I have some problems...
Note that I'm just a beginner and there's a lot of things that I don't really know, and I'm kinda lost so just asking for help.
I just want to make like a parking barrier that stores data in an excel, and just there I encounter one of my current problems, the dimension of the source is 1 and the dimension of the sink is 2. Is there any way I can make the source convert to a 2 dimension array?
The second problem comes with the arduino communication. I just want that when the camera reads a plate from a car sends a signal to one of the arduino pins and move a servomotor. Right, so moving the servomotor only with arduino program is easy, but I just don't know what blocks and connections I have to do to send it to arduino...
I already trained the ocr and all that, so yes, the program is actually reading those license plates.
Here is my program in labview:
And here is the arduino code:
Solved! Go to Solution.
05-04-2025 09:01 AM
The first question, how do you turn a String into a 2D Array of String, is easy. You've done half of it -- you turned a String into a 1D Array of String. Now turn that 1D Array of String (using the same technique) into a 2D Array of String.
Or you could do it in a single step -- use Initialize Array to initialize a 1x1 Array.
Bob Schor
05-04-2025 09:23 AM - edited 05-04-2025 09:24 AM
I see several general problems that might not function the way you think they should:
Maybe you want to rearchitect this as a simple state machine instead.
05-05-2025 02:31 AM
Right, so it looks that I need to understand some basic things yet...
Just what I want is that if the machine reads a plate, activates the arduino signal, maybe it will be good like this the conversion?
Decimal string to number?
05-05-2025 08:10 AM
Maybe it is because I learned programming with Text-based languages (my favorite was Pascal) that when I started learning LabVIEW (about two decades ago), I quickly stopped using the Number/String Conversion functions and settled on "Format into String" and "Scan from String" functions. Particularly when you are dealing with data from Arduino coming in over VISA (where Best Practice says "Read an entire String in a single command" by using a Termination Character (typically <LF>) and a VISA Read of 1000 (or 1024) bytes (expecting a much smaller string whose length is in the range of 10 to 70 bytes, usually). Now you just need to know how the data are separated ("punctuation" such as commas, tabs, or header strings such at "Width = 5 inches ", where you want the number "5" as an Integer).
Take a look and see if this works for you.
Bob Schor
05-05-2025 09:44 AM
@Zuzguluddi wrote:
Right, so it looks that I need to understand some basic things yet...
Just what I want is that if the machine reads a plate, activates the arduino signal, maybe it will be good like this the conversion?
Decimal string to number?
No, in many countries license plates are a combination of letters and numbers. You need to look at the string and decide what is valid.