The latest form of skill is used in the preset of the street lamp system

1Neuron C Introduction

At the heart of the LonWorks network is the Neuron chip, which manages communications while having input/output and control capabilities.

Neuron C is a programming language specifically designed for the Neu2ron chip. It is derived from ANSI C and is further extended to support the various operating features provided by the firmware in the Neuron chip, allowing it to be directly Supporting the firmware of the Neuron chip has become a powerful tool for developing LonWorks applications.

The extensions to ANSI C mainly include:

1) an internal multitasking scheduler; 2) mapping I/O objects directly to the processor's I/O capabilities;

3) Network variable object definition;

4) Introduce events through the when statement and define the temporary ordering of these events; 5) explicit messaging;

6) seconds and milliseconds software timer object;

7) A library of functions that can perform event detection, input/output management, send or receive messages online, and control the functions of various Neuron chips.

The use of network variables greatly simplifies the development of distributed systems. When the output network variables in a node change, all input network variables of other nodes associated with them also update their values. In this way, communication between nodes and nodes is implicitly done without user intervention. Developers do not have to consider some low-level details such as information caching, node addressing, request, response, retry processing in communication, and can achieve LonMark interoperability, which facilitates programming and node installation, and saves The program's storage space, so many programs use network variables.

2 street lighting control network introduction

The street lighting control network is designed to realize the real-time regulation of tunnels or public lighting. The Echelon power line intelligent transceiver chip PL3120 and i. LON 100 e3 Internet server are used to transmit and transmit data through the power line. Implement intelligent control of terminal equipment.

2. 1 overall plan

The topology is shown as 1. The entire network is divided into 4 subnets. among them:

The dimming node is divided into three logical subnets (corresponding to the entrance, middle, and exit of the tunnel respectively); all sensor nodes form the fourth logical subnet.

2. 2 module function introduction

There are three types of nodes in the control network, namely the dimming node, the metering node and the vehicle detection node. The bus line type LonWorks network is formed by the power line, and the data is transmitted with the host computer on the Ethernet via the i. LON 100 e3 Internet server. transmission.

2. 2. 1 dimming node

The function of the dimming node is to receive information of the photometric node and the vehicle detection node, and to control the switching or brightness change of the electromagnetic induction lamp. Each node controls the switching and brightness adjustment of a set of lamps (total power not exceeding 2000w).

The dimming nodes in the subnet 1 and the subnet 3 calculate the brightness level of the lamp controlled by the node according to the brightness information of the ambient light input by the photometric node, and complete the dimming function.

The brightness level of the dimming node in subnet 2 is set to a fixed value when the project is completed. In the subsequent operation, the dimming node only performs the switching control of the lamp according to the command of the vehicle detecting node or the upper computer.

All dimming nodes accept the switching light command of the vehicle detection node or the upper computer. In addition, the dimming node also accepts the polling request from the upper computer, and uploads the 'illuminance level' of the node to the upper computer according to the requirements of the upper computer.

2. 2. 2 metering node

The illuminance sensor is connected, and the illuminance data outside the tunnel entrance and exit is collected, and the illuminance change information is sent to the dimming node.

A metering node is installed at the entrance/exit of the tunnel, and the ambient light brightness level information is provided to the dimming node in the subnet 1/3 by broadcast. The ambient light level is measured every set time and is released to the subnet controlled by the node, so that all the dimming nodes calculate the illumination level according to the ambient light level.

All the photometric nodes accept the polling request from the host computer, and upload the illumination level of the node to the host computer according to the requirements of the host computer.

2. 2. 3 vehicle detection node

Connected to the vehicle detection sensor, the vehicle detection node of the entrance and exit respectively collects and exchanges traffic flow data. When it is determined that there is no vehicle in the tunnel, the light dimming node is turned off or dimmed; when the vehicle enters the tunnel, the tone is immediately adjusted. The light node emits a light message that turns on or brightens.

The vehicle detection node receives the parameter settings downloaded by the host computer, including the subnet number controlled by the node light-on command. The information of the vehicle detection sensor is collected, the vehicle passing condition in the tunnel is judged, and a control command is issued.

The vehicle detection node buried in front of subnet 3 can be queried by the upper computer to know the number of vehicles in the tunnel.

2. 2. 4i. LON 100 e3 Internet Server

i. The LON 100 e3 combines state-of-the-art Web and routing technologies to simplify network deployment, reduce maintenance costs, and eliminate problems quickly. The universal connectivity it provides makes it easy to connect devices to the i. LON 100 e3 and make the data from these devices effectively applied to corporate IP networks and the Internet. In this system, it acts as a gateway to interconnect Ethernet and LonWorks networks.

2. 2. 5 host computer

The main task of the host computer is to set the working parameters required by the three types of nodes, poll the working status of each node in each subnet, and obtain the current status and measured information of various nodes.

The host computer can also turn all lights on or off as needed, and stop the metering and vehicle detection nodes.

3 control node software design

The street lighting control network is composed of three different functional nodes. The software design of the dimming node is introduced below.

3. 1 dimming node program main variable description

Some standard network variables (shown in 1) are set in the program of the dimming node, and I/O objects of external devices connected to the Neuron chip are defined.

1 dimming node network variable definition

1) Initialize the default level - L d: default lighting level after power-on initialization of the dimming node; 2) brightness level of the middle node of the tunnel - L c: the lighting level of the middle of the default tunnel after power-on initialization of the dimming node 3) Current dimming level - G: Illumination level emitted by the dimming level of the photometric node - G (output variable); 4) Local node number - N: Number of the dip switch generated when the node is installed; 5 Mode switch - Switch: Switch = 1 for car mode, normal dimming; Switch = 0 for carless mode, brightness is adjusted for Ld of the node; 6) Vehicle access indication - Switcha/Switchb: by the entrance and exit counting node Mode Switching - The indication of 'there is no vehicle in the tunnel' issued by Switcha /Switchb (output variable), "0" is no car, "1" is car;

7) On/Off lamp - P: Street lamp on/off variable controlled by the host computer.

The dimming node program network variables and I/O objects are defined as follows: network input SNVT_switch L d = {0, 0}; network input SNVT_switch L c = {0, 0}; network input SNVT_switch G = {0, 0}; Output polled SNVT_count N = 0 network input SNVT_count Switch = 1; network input SNVT_count Switcha = 1; network input SNVT_count Switchb = 1; network input SNVT_switch P = {0, 0}; / / network variable definition

IO_0 output bit io_Switch = 0; / / IO_0 is defined as bit output object io_Switch; IO_7 output bit io_DataDirection;

/ / IO_8 output bit io_SCL; / / IO_9 output bit io_DataOut; / / IO_9 input bit io_DataIn; / / I / O object related to potentiometer X9241 IO_8 output bitshift numbits (8) io_SerData; / / IO_8 is defined as 8-bit output Object io_SerData, used to write potentiometer X9241;

3. 2 dimming node block diagram

The block diagram of the dimming node is shown in 2.

Void SwitchLamp (signed short usLampState) / / Switch lamp subroutine { nvoLampLev. state = usLampState; io_out( io_Switch, usLampState) ; / / Issue a switch light command to the I / O device }

3. 3 program debugging

Firstly, the node program is compiled by NodeBuilder software, then the Lonmaker software is used to download the dimming node program to the smart transceiver PL3120, and then the Lonemaker's own Browserer function is used to browse the polling return value of each network variable of the node. In the Browser interface, the value of the input network variable G is changed, and the corresponding dimming output voltage is also changed accordingly. The measured voltage output full-scale of the X9241 digital potentiometer is 5.07V, then the output voltage and the input network variable are changed. The linear expression is as in (1), where k is a preset parameter, where k = 10 is taken.

V out = 5. 07 63(G - k 3 G /64) (1) See experimental data for 2.

2 dimming node output voltage and G variable comparison table

It can be seen from the data that the resolution of the X9241 digital potentiometer is: 5. 07 /63 = 0. 08; and the maximum error of the error occurring in the experiment is 0. 006, which is much smaller than the resolution of the X9241 digital potentiometer. To the measurement error and the calculation error, the system can be considered accurate. In addition, changing the value of the input network variable P, that is, controlling the amount of switching of the lamp, the corresponding relay switch changes. Therefore, the actual operation of the node meets the original design requirements.

4 Conclusion

The network structure introduced in this paper is completely open. The connection unit structure on the network is equivalent, and the number can be freely increased or decreased. Each node function can flexibly change I/O equipment and related applications according to different requirements. The system has high reliability. And very strong expansion capabilities. Therefore, it is suitable for various public lighting occasions such as tunnels, roads and bridges.

USB Ports 4 Gang Extension Cord supplying power support for multiple electrical devices from a single 4 Way Electric Outlet but also maintain a compact and simple design. The Outlet and Plug can be various type e.g. American, Australian, British, French, German, Universal......

- Compact and Light weight: 4 Outlet Power Board with 6 feet cord power strip is sufficient and easy for most of power needs occasion. Flexible design provides you multiple choices e.g. surge protection, overload protection, USB quick charging etc. 

- advanced flame retardant material is safe and reliable as well as pure copper high conductive elements compliance with international standards like ETL, CE, etc.

4 Gang Power Strip

4 Gang Power Strip, 4 Outlet Power Board, 4 Way Electric Outlet, USB Ports 4 Gang Extension Cord, Surge Protected 4-Outlet Power bar

ZhongShan JITONGLONG Plastic Hardware Co. Ltd. ,

Posted on