Traditional instruments, whether early analog instruments or current digital intelligent instruments, although their functions are increasingly perfect and powerful, all functional blocks exist in the form of hardware, which makes their development and application lack flexibility. The emergence of virtual instruments is a deep combination of test technology and computers, which has brought test technology to a new level. Virtual instruments have outstanding advantages in engineering applications. After the general hardware platform is determined, they can replace the hardware in traditional instruments with software to complete the functions of the instrument. The functions of the instrument can be defined by the user through software according to needs, and can even complete the testing work that is difficult to complete with traditional instruments due to the limitations of process and manufacturing level. With the continuous development of communication technology and network technology, applying network technology to the field of virtual instruments to form networked virtual instruments is a trend in the development of virtual instruments. This paper introduces a virtual instrument monitoring system for Lonworks network (abbreviated as LON network), and gives the interface design and communication method of Lonworks network and virtual instruments using LabVIEW software development platform and Lonworks network as signal transmission channel.
1 Structure of the Lonworks network virtual instrument system
Figure 1 shows a block diagram of a network virtual instrument system. In the figure, the virtual instrument consists of a PC and application software developed by LabVIEW. LabVIEW is a virtual instrument software development tool based on a graphical programming language. It provides a rich set of functional modules and can support multiple bus standards such as GPIB, PXI, VXI, and serial ports. Users can use different module combinations to compile graphical software flow charts to achieve a variety of test functions. The system operation panel is flexible in design and is not restricted by "standard parts" and "processes".
Lonworks bus is a local operation network developed by Echelon Corporation and is a serial digital communication link. It supports twisted pair, power line, optical fiber, coaxial cable and other communication media, and supports multiple network topologies, which can be used to establish connections between field devices in the production field and between higher-level control process devices. The Neuron neuron chip is the core device of the Lonworks system equipment. In the Lonworks network, the intelligent node with the Neuron chip as the core mainly completes the signal acquisition and control of each field device. A Neuron chip can connect multiple physical I/O devices, and the node can be connected to the Lonworks bus to form a field measurement and control network. The communication between each node and between the node and the host computer can be realized through the Neuron chip and the LonTalk communication protocol. Since the bus has serial characteristics, LabVIEW provides support for serial ports, and PCs generally have serial interfaces, the serial ports can be used to realize the interaction between virtual instruments and the Londons network, and control signals can be formed by operating the soft panel to control a given node. The node then sends the status signal of the field equipment to the virtual instrument for display and analysis.
2 Design of Virtual Instrument and Lonworks Interface Card
Although the I/O pins of the Neuron chip provide RS232 half-duplex asynchronous serial working mode, there are still great limitations in terms of transmission rate, data format and communication mode. The communication between nodes on the network is realized through the LonTalk communication protocol in the form of network variables or explicit message packets. In order to achieve more flexible applications, the author designed a LON-RS232 interface card to realize the mutual conversion between the RS232 protocol and the LonTalk protocol, thereby realizing high-speed, full-duplex communication. The hardware structure of the interface card is shown in Figure 2.
The interface card includes a 51 protocol conversion module, a LON network interface module and an RS232 communication module. The interface card uses dual CPU technology. The 51 protocol conversion module is composed of a P89C51 single chip, which is also the main CPU of the interface card and is used to complete the conversion between RS232 standard signals and LonTalk protocols. The interface card communicates with the virtual instrument upwards through the RS232 communication module and communicates with the TMPN3150 through a parallel port downwards.
The LON network interface module consists of the TMPN3150 chip, transceiver FTT-10A, program memory, data memory, etc. This module can parse the message received by the main CPU into LONTalk protocol message, and then transmit it to the LON network through the transceiver, or forward the LONTalk protocol message received from the LON network to the main CPU. The TMPN3150 chip is connected to the P89C51 through 11 I/O ports (IO0~IO10), and it adopts the slave A working mode of the parallel I/O mode. In this way, IO0~IO7 will be connected to P0.0~P0.7 of P89C51 as bidirectional data lines, IO8 will be connected to P2.0 pin as chip select signal line, IO9 will be read/write signal line connected to WR pin of P89C51, IO10 will be handshake signal line connected to P2.1 pin, data transmission between host (P89C51) and slave (TMPN3150) is realized through virtual write token transfer protocol, and the party with token has write control over the data line.
RS232 communication module uses RS232 interface chip to complete the link and protocol of serial communication network. It is driven by UART of P89C51 and adopts interrupt drive mode.
3. Implementation of system communication method
Usually, virtual instruments test fewer physical quantities, and the devices being tested are relatively concentrated, so the signal channels are generally parallel. However, when designing a network virtual instrument system, in addition to solving the interface problem, it is also necessary to consider the effective communication problem between the virtual instrument and each node due to the various topological structures of the network, such as addressing information, control information, and data transmission.
3.1 Transmission of control signals
A Lonworks network includes multiple nodes, each of which can monitor multiple signals, that is, a node has multiple measurement channels. When a virtual instrument wants to obtain a certain measured data, it must specify the node and channel where the measured data is located at the same time. The selection switch can be set on the soft panel of the virtual instrument according to the actual physical quantity to be measured. When a switch is selected, the program will automatically form control information containing the node number and channel number according to the pre-set settings. The message format includes 3 bytes of node number, channel number, and control command code. After conversion by the interface card, the node number, channel number, and control command code will be written into the first three bytes of the LonTalk explicit message data. The message code is CONTROL_MSG, and the message is broadcast on the LON network. The specific implementation code is as follows:
IO_0 parallel slave s_bus; //Define parallel port I/O object
#define DATA_SIZE 255
Typedef struct
{
unsigned int length;
unsigned int data[255];
} piio; //Define parallel port communication structure
far pio p_in;
msg_tag tag_out0;
when(io_in_ready(s_bus)) //parallel port has data
{
p_in.length=DATA_SIZE
io_in(s_bus,&p_in);//Read data from the parallel port
//Construct explicit message
msg_out.code=CONTROL_MSG//CONTROL_MSG is a predefined message code
memcpy(msg_out.data,p_in.data,3);
msg_out.dest_addr.bcast.type=BROADCAST;
msg_out.dest_addr.bcast.domain=0;
msg_out.dest_addr.bcast.subnet=0;
msg_out.tag=tag_out0;
msg_send();
}
Generally, a node receives the message through when(msg_arrives(CONTROL_MSG)), and then determines the node information of the first byte of the message data. If it is not the current node, no processing is performed. If it is the current node, the channel number of the second byte is determined, and then corresponding processing is performed and the data of the selected channel is transmitted.
3.2 Transmission of measurement data
In the measurement and control system, the number of data that needs to be collected for each parameter to be measured may be different, ranging from one data to thousands of data. Therefore, after the node receives the control signal from the virtual instrument, the monitoring data of the selected channel should be transmitted using explicit message packets. In the LON network, the designed interface card is also a node. When the other nodes receive the control signal sent to this node, they will send the data of the corresponding channels to the interface card at the same time. The author uses message tag addressing. The message tag is a connection point for explicit messages. The network management tool assigns a unique network address to the input tag and each output tag. In this way, the message tag of the explicit message sent by each node to the interface card can be connected to the message input object msg_in of the interface card node by using the binder, so that point-to-point data transmission can be realized. The following takes the example of node 2 receiving data required to be sent to channel 1, and the channel sends 40 bytes of data each time, and gives its sending program: [page]
msg_tag LON_232;
when(msg_arrives(CONTRL_MSG))
{
if(msg_in.data[0]==2)
{
switch(msg_in.data[1])
{ case 1: // channel 1
msg_out.tag=LON_232;
msg_out.code=0x0c; //Message code, the interface card processes the received data according to this
msg_out.service=ACKD;
memcpy(msg_out.data,ch1_buf,40);
msg_send();
break;
Case 2: //Other channel processing
......
}
}
}
LON_232 is the defined output message tag. The network manager associates LON_232 with the input message tag msg_in of the interface card. The procedure for processing the message on the interface card is as follows:
far pio p_out;
when(msg_arrives(0x0c))
{
p_out.length=msg_in.len;
memcpy(p_out.data,msg_in.data,msg_in.len);
//Receive data from LON network
mio_out_request(s_bus); //Request the parallel bus to obtain a token
}
when(io_out_ready(s_bus))
{
io_out(s_bus,&p_out); //Data is transmitted to the parallel port bus
}
4 Conclusion
By using Lonworks network virtual instrument, the data of all measurement channels can be transmitted on the Lonworks bus, thus avoiding the disadvantages of multi-channel parallel wiring and effectively realizing remote data acquisition and control. Through the network interface card, the virtual instrument can be hung anywhere on the LON network, so it can be made into a portable instrument and can be tested on the LON network conveniently and flexibly.
Previous article:Design of Aircraft Electrical Integrated Test Management System Based on LabVIEW
Next article:Designing a Robotic Device for Studying Flying Insects Using LabVIEW
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Exposing unscrupulous merchants [Jimu Microelectronics Flagship Store]
- esp32,stm32: add machine.I2S to support I2S protocol
- 【McQueen Trial】Python Programming (3)
- How to sign in on the mobile version?
- Free sharing of LDO and DCDC basic principle explanation video
- No response when controlling GPIO in user mode?
- Logistics POS machine with serial port expansion IC
- EEWORLD University Hall----Live Replay: Infineon system solutions make electric motorcycle design more reliable and efficient!
- EEWORLD University Hall----Live Replay: ADI's smoke detector integrated solution based on ADPD188BI
- [Popular Science] Why is there an error in the output voltage of a power amplifier?