Designing a Structured Serial Communication Between Arduino and LabVIEW for Conveyor Automation
In the mini conveyor sorting system, LabVIEW acts as a Human-Machine Interface (HMI) that receives real-time data from Arduino Nano and transmits control commands back to the embedded controller. The communication is implemented using USB serial and VISA-based data handling.

Serial Communication Architecture

As shown in the LabVIEW block diagram, communication begins with:
- VISA Configure Serial Port
- Baud rate configuration
- USB port selection
The system continuously monitors the serial buffer using Bytes at Port, ensuring that LabVIEW only reads available data.
This prevents partial-frame parsing and buffer overflow.
Data Reception and Parsing

Arduino transmits sensor data as raw comma-separated numeric values.
In LabVIEW:
- VISA Read captures the full string.
- Match Pattern validates data frame termination.
- Scan From String converts CSV string into numeric values.
- Parsed values are mapped to:
- RED
- GREEN
- BLUE
- OTHERS
- HEIGHT (CM)
- Conveyor Status
The block diagram clearly shows numeric conversion blocks feeding into indicator terminals such as:
- RED COUNT
- GREEN COUNT
- BLUE COUNT
- OTHERS COUNT
This structured parsing ensures consistent UI updates.
Indicator and State Handling
The block diagram uses Case Structures to control:
- RUN indicator
- STOP indicator
- Color detection state (True/False logic)
- Object detection validation
When detection is TRUE, the corresponding case block activates:
- Color LED indicator
- Counter increment logic
This prevents false increments during idle conditions.
Parameter Transmission from LabVIEW to Arduino
The right side of the block diagram shows numeric controls for:
- Conveyor Speed
- Minimum Height Detect
- Minimum Height Object
- Maximum Height Object
- Delay Check
When RUN or STOP buttons are pressed, LabVIEW transmits command strings via VISA Write.
Commands include:
- Start operation
- Stop operation
- Reset counter
- Speed update
The RESET COUNT button triggers a confirmation dialog before sending reset command.
Communication Stability Measures

Based on the implementation:
- Data reading only occurs when "Read" boolean is TRUE.
- Transmission is separated from parsing loop.
- Case structures isolate command execution from monitoring logic.
- Baud rate is configurable from the front panel.
This design prevents:
- Data overlap
- Blocking UI execution
- Serial buffer corruption
Engineering Insight
The integration of VISA Read, Scan From String, and structured case logic provides:
- Deterministic parsing
- Real-time visualization
- Stable bidirectional control
- Clean separation between monitoring and command logic
This architecture demonstrates a practical approach to PC-based industrial automation using LabVIEW and embedded controllers.
#Arduino#
#LabVIEW#
#EmbeddedSystem#
#SerialCommunication#
#IndustrialAutomation#
#HMI#
#AutomationSystem#
#ConveyorSystem#LabVIEW#
#EmbeddedSystem#
#SerialCommunication#
#IndustrialAutomation#
#HMI#
#AutomationSystem#
#ConveyorSystem#
Sign In Or Register Comment after
No comments yet. Be the first to comment!