647 views|1 replies

336

Posts

2

Resources
The OP
 

【VisionFive 2 Single Board Computer Trial】+ Complete Test Project [Copy link]

 

Complete test project

  1. Basic Overview
    This test project uses Ethernet real-time transmission technology to complete sampling data transmission, Modbus-TCP to complete data control and display data acquisition, and Node-red to complete basic information display.

    Basic network topology and functional description diagram
    The system uses Ethernet as the basis for data transmission, uses pcap technology to quickly receive data content from multiple data terminals in the system (currently one data terminal is implemented), and performs corresponding data processing. The processed data is shared between the acquisition system and the node-red system through modbus-tcp.
  2. Data acquisition channel
    data acquisition uses the pcap technology under Linux to directly intercept Ethernet data frames through the Ethernet link layer and parse them.
    The VisionFive2 system has good support for libpcap. We only need to execute a simple installation command to complete the installation.

    We need to install the two library files libpcap-dev and libpcap0.8 before we can carry out subsequent development.
    For details, please refer to the test post: https://bbs.eeworld.com.cn/thread-1251111-1-1.html
  3. modbus-tcp data sharing channel
    Modbus protocol is a common communication protocol in the field of industrial control today. It is used in countless IoT products and can be found in IoT solutions such as industry and agriculture. Modbus network is an industrial communication system, which is composed of programmable controllers and computers of intelligent terminals connected by public lines or local dedicated lines. Its system structure includes both hardware and software, and is used for various data acquisition and process monitoring.

    Through the Modbus protocol, controllers can communicate with each other or with other devices via a network (such as Ethernet). The Modbus protocol uses master-slave communication technology, that is, the master device actively queries and operates the slave device. Generally, the protocol used by the master device is called Modbus Master, and the protocol used by the slave device is called Modbus Slave. Typical master devices include industrial computers and industrial controllers; typical slave devices include PLC programmable controllers. The physical interface of Modbus communication can be a serial port (including RS232 and RS485) or an Ethernet port.
    Here we choose the Modbus-TCP network interface communication method, and use the very famous modbus development library libmodbus to complete the basic development.
    The basic installation process of the library file is as follows:

    The process is very simple.
    In the application, as a data provider, a Modbus-TCP device end (i.e. server end) software is implemented. It provides the functions of holding register access and coil control.
    Serial number Data content register direction
    1 Collect data 1 Holding Register 0 Output
    2 Collecting data 2 Holding Register 1 Output
    3 Collect data 3 Holding Register 2 Output
    4 Acquisition control Coil Control 0 input Output
  4. Node-RED display and control system
    Node-RED is an IoT programming tool that connects hardware devices, application interfaces, and online services in a novel and interesting way.
    It not only provides a browser-based programming environment and rich node types, making it very easy to create processes, but also provides a runtime environment for the operation of processes and realizes the ability of one-click deployment.
    Node-RED is based on the lightweight runtime environment of Node.js, which fully inherits the advantages of event-driven and non-blocking models, so that it can not only run in the cloud platform, but also run very well on low-power hardware devices such as Raspberry Pi at the edge of the network.
    With more than 220,000 existing Node module resources, it is very easy to expand the type range of component panels and the capabilities of the entire tool.
    Node-RED provides a browser-based process editor, which can not only easily assemble the rich nodes on the panel into processes, but also install them into the runtime environment through the one-click deployment function. The
    rich text editor can be used to create JavaScript functions.
    The preset code library can be used to save useful functions, templates, and reusable processes.
    4.1 Data communication
    Install modbus operation control in node-red. For details, please refer to: https://bbs.eeworld.com.cn/thread-1250342-1-1.html for relevant instructions.
    Here, use the modbus-read control to read the register content of FC3 and obtain the data collected in the acquisition system.
    Use the modbus-wirte control to complete the start and stop control process of the acquisition process.

    4.2 Display screen
    Install the dashbord control in node-red, and use the Chart control to complete the curve display, use the button control to complete the input of the start and stop process control, use the file reading control to obtain the processor temperature, and use the gauge control to display it. The
    display interface is the node-red editing interface network address: 1880/ui
  5. Tests and Videos

A data terminal emulation environment was developed through QT to generate data sources.

The running main program completes data acquisition and provides modbus data services:

Provide the corresponding display interface through node-red

video

vf2-modbus

This post is from Domestic Chip Exchange

Latest reply

Newbies in electronic design, come and learn and see how the masters think.  Details Published on 2023-8-14 22:30
 
 

195

Posts

0

Resources
2
 
Newbies in electronic design, come and learn and see how the masters think.
This post is from Domestic Chip Exchange
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list