Research on Lonworks Network Virtual Monitoring System

Publisher:cloudy德德Latest update time:2012-02-11 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Research on Lonworks Network Virtual Monitoring System

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

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号