Share this

Human-Machine Interface Design for Data Acquisition Based on CAN Bus

2026-04-06 05:11:07 · · #1

Abstract: This paper utilizes CAN bus technology to construct a network and designs a highly visual human-machine interface for data acquisition using VB language, realizing the acquisition of smart meter data (including analog and digital data) and over-limit alarm functions.

Keywords: CAN bus, human-machine interface, VB

Abstract: The thesis introduced the design of the Date Acquisition Human-computer Interface using VB based on CAN Bus. It realized the function that intelligence meter read the analog and digital value, and alarmed when the value went beyond the limit.

Key Words: CAN Bus, Human-computer Interface, VB

0 Introduction

Currently, analog dials are widely used in railway locomotives, causing considerable inconvenience to railway transportation safety management. The use of analog dials has the following disadvantages:

First, it lacks data storage capabilities, making it difficult to obtain precise information about the time of the accident if one occurs.

Secondly, it requires extensive wiring and is inconvenient to install. Adding devices to the existing analog system necessitates rewiring.

Third, it cannot utilize mature modern information processing technologies based on digital signals.

For train locomotive monitoring systems, the speed, accuracy, reliability, storage capacity, and communication flexibility of data measurement and transmission are all crucial. It is necessary to digitize and intelligentize the analog meters within the locomotive, and on this basis, utilize fieldbus technology to construct a measurement and control network to achieve timely acquisition, transmission, storage, display, and alarm functions for important data within the locomotive.

This railway locomotive data platform adopts CAN bus technology. The choice of CAN bus is based on reliability considerations. CAN bus was initially widely used in electronic monitoring within automobiles. Due to the strong high-frequency interference generated by spark plugs and the mechanical vibrations produced by the engine, the reliable operation of the CAN bus under these conditions demonstrates its strong anti-interference capability. The intelligent module in this locomotive data platform uses an 89C51 microcontroller, and its communication section uses the SJA1000 CAN controller. The CAN bus communication controller integrates the physical layer and data link layer functions of the CAN protocol, and can perform framing processing of communication data, including zero-bit insertion and deletion, data block encoding, cyclic redundancy check, priority determination, and other tasks. A characteristic of the CAN protocol is that it abolishes the traditional stack address encoding, replacing it with encoding of communication data blocks. The advantage of this method is that it theoretically allows for an unlimited number of nodes within the network. The identifier for a data block can consist of 11 bits (according to CAN specification 2.0A) or 29 bits (according to CAN specification 2.0B) binary numbers, thus allowing for the definition of 2^11 or 2^29 different data blocks. This block-based encoding method also enables different nodes to receive the same data simultaneously, which is extremely useful in distributed control systems. The maximum data segment length is 8 bytes, meeting the general requirements for transmitting control commands, operating status, and test data in typical industrial applications. Furthermore, 8 bytes will not consume excessive bus time, ensuring real-time communication. The CAN protocol employs CRC checksum and provides corresponding error handling and retransmission functions, guaranteeing the reliability of data communication.

1. Locomotive Data Platform User Manual

1.1 Principle

The locomotive data platform is essentially a distributed computer data acquisition system that utilizes advanced fieldbus technology. It integrates microprocessors into traditional measurement and control instruments, giving each instrument digital computing and data communication capabilities (intelligent instruments). Using easily connectable twisted-pair cables as a bus, multiple measuring instruments are connected into a network. Data transmission and information exchange are achieved between field instruments and a remote computer according to a public and standardized communication protocol (CAN bus protocol). In short, it transforms individual, distributed measuring devices into network nodes, connecting them via the fieldbus to form a network and control system that collectively completes automated control tasks. The fieldbus enables communication between the automated control system and equipment, connecting them into a network system and integrating them into the information network.

This vehicle's data platform utilizes CAN bus technology. CAN stands for Control Area Network, originally introduced by the German company Bosch for data communication between measurement and actuation components within automobiles. As is well known, modern automobiles increasingly employ electronic control devices. Because these controls require the detection and exchange of large amounts of data, using hard-wired signal lines is not only cumbersome and expensive but also difficult to solve problems. The CAN bus effectively solves these issues. Due to the inherent characteristics of the CAN bus, its applications are no longer limited to the automotive industry but have expanded to process industries, machinery industries, textile industries, agricultural machinery, robotics, CNC machine tools, medical devices, and sensor fields.

1.2 Functions

1. Data from each smart meter and the status of each switch are collected once per second. Smart meters include voltmeters, ammeters, pressure gauges, and speedometers; switch status includes the on/off states of relays, contactors, and buttons, the on/off states of indicator lights, and the closing of various switches and contacts.

2. Set the upper alarm limit, lower alarm limit, and deviation alarm limit for each smart meter, and issue an alarm message when each smart meter exceeds the alarm limit.

1.3 Performance Indicators

It can accommodate 54 smart meters and 8 switch quantity acquisition cards (each card has 16 switch quantities).

2. The smart meter inputs are isolated with an isolation voltage of 5000 volts; the switch inputs are also isolated with an isolation voltage of 1500 volts.

3. The smart meter accepts 75mV, 10V and 110V AC/DC input (as per user requirements).

4. Smart meter measurement accuracy 2%.

5. Power Supply:

Input: 70-130V DC/150W

Output: 5V/8A 24V/4A

1.4 Intelligent Instrument Functions

1. It retains the original pointer analog meter function, that is, it accepts an analog input and displays the value of the analog input with a pointer, including voltage, current, speed, temperature and pressure, etc.

2. Convert the input analog quantity into the corresponding digital quantity, isolate it, and send it to the data acquisition station via the CAN bus. The data sent includes alarm information (upper limit, lower limit, deviation limit).

3. Receive setting information from the monitoring alarm, including upper limit setting, lower limit setting, and deviation limit setting.

1.5 Functions, Protocols, and Settings of the Digital Input/Output Card

116 independent opto-isolated switch inputs.

2. Used to detect the on/off state of switches, relays, solenoid valves, etc., and the on/off state of indicator lights.

3. The status of 16 switch inputs is read once per second and then sent to the data acquisition station via CAN bus.

The system can accommodate 8 digital input/output cards, detecting a total of 16 * 8 = 128 digital input/output states. Each input/output card needs to be assigned a unique ID number, ranging from 55 to 62. The ID number is set via a jumper on the input/output card. The ID number is encoded in binary; a shorted jumper corresponds to 0, and a free jumper corresponds to 1.

1.6 Functions of the monitoring alarm, calibration of the smart meter, and setting of alarm limits

1.6.1 Functionality

1. Set the values ​​for upper limit, lower limit, and deviation limit of the smart meter, and send these values ​​to the smart meter and data acquisition station via the CAN bus.

2. Calibrate the smart meter.

3. Receive alarm information from the data acquisition station, display the alarm information, and output the alarm information via relay contact.

1.6.2 Calibrate the smart meter

Press the calibration button to enter calibration mode. The received value from smart meter 01 (intermediate value, full scale = 1000) will be automatically displayed.

2. Press the switch key, then use the keyboard to enter the ID number of the smart meter to be calibrated, press the confirmation key, and the intermediate value of the smart meter will be displayed.

3. Compare the values ​​in this table with the values ​​actually measured using a standard table to determine the error.

4. Adjust the potentiometer VR2 on the smart meter circuit board to eliminate errors.

1.6.3 Setting Alarm Limits

1. In calibration mode, press the switch key, then enter the ID number of the smart meter to be set, press the OK key, and the intermediate value of the smart meter will be displayed.

Press the toggle key twice, and the cursor will switch to the second line. The value displayed in the second line is the stored upper limit value.

3. Modify the upper limit value, and then press the confirmation key. The modified upper limit value will be stored and sent to the smart meter and data acquisition station via the bus.

Press the toggle key to switch the cursor to the third line. The value displayed in the third line is the stored lower limit value.

5. Modify the lower limit value, and then press the confirmation key. The modified lower limit value will be stored and sent to the smart meter and data acquisition station via the bus.

Press the 6-key to switch the cursor to the fourth line. The value displayed in the fourth line is the stored deviation limit value.

7. Modify the deviation limit value, and then press the confirmation key. The modified deviation limit value will be stored and sent to the intelligent table and data acquisition station via the bus.

2. Interface Description and Flowchart

Here we use five smart meters and a set of switch signals to illustrate the main functions of this project:

1. Data from each smart meter and the status of each switch are collected once per second. Smart meters include voltmeters, ammeters, and pressure gauges, etc.

2. Set the upper alarm limit, lower alarm limit, and deviation alarm limit for each smart meter, and issue an alarm message when each smart meter exceeds the alarm limit.

The flowchart is shown in Figure 1:

Figure 1 Overall flowchart of data acquisition interface

Here, the analog quantities are set as shown in Table 1:

Table 1 Analog Quantity Settings

The data acquisition interface is shown in Figure 2:

Figure 2 Data acquisition interface

As shown in Figure 2, the conversion of analog data to digital data is quite accurate; data 1#, 2#, and 5# are all between the lower and upper limits and are operating normally; data 11# and 13# exceed the upper limit and fall below the lower limit, respectively, and both issue alarm warnings.

3. Conclusion

A network was constructed using CAN bus technology, and a human-machine interface for data acquisition was designed using VB language. This interface displays smart meter readings and switch data, and provides alarms when limits are exceeded. After operation (with 6 acquisition modules), the results show stable performance, with data fluctuations of less than 1% and satisfactory data accuracy, fully demonstrating the superiority of the CAN bus.

CAN bus data acquisition human-machine interfaces (HMIs) have applications not only in railway systems but also in other fields. Currently, the author is developing a power monitoring system for engine rooms, which uses CAN bus data acquisition to allow monitoring personnel to obtain necessary data remotely. In conclusion, the development of the locomotive data platform HMI lays the foundation for the application of other monitoring systems.

References:

[1] Fieldbus Technology and Basic Applications. Yang Xianhui. Tsinghua University Press. 1999

[2] Fieldbus and Control Systems. Zhao Tianhong. Automation of Electric Power Systems, 24(13), 2000

[3] The current status and future of fieldbus control systems. Wei Binbin. Transportation and Computer, 2001(19).

[4]Bosch.CAN specification,Version2.0. 1991. Robert Bosch GmbH

Read next

CATDOLL 133CM Sasha Shota Doll

Height: 133cm Male Weight: 28kg Shoulder Width: 31cm Bust/Waist/Hip: 64/59/73cm Oral Depth: 3-5cm Vaginal Depth: N/A An...

Articles 2026-02-22