The DMX512 data sink and in network the method for auto-addressingTechnical field
The present invention relates to the method and the device of distribution network address in network, particularly relate in the network of setting up based on Data Transport Protocol for the method for data sink distribution network address and be used for the device of this method.
Background technology
The DMX512 agreement is the digital dimming communications protocol Digital Dimmer Protocol of an international standard, by the United State Institute for Theatre Technology of U.S. arenas technological associations, Inc. proposing, originally is the standard that can transmit 512 road controllable silicon brightness information on a pair of line that is used for light of stage control.In the network of setting up by control/encoder and no more than 512 data receivers, described control/encoder according to the DMX512 agreement to regulation and control digital coding and outputing in the above-mentioned network, each data sink receives regulation and control data separately, and described regulation and control data are used for lamp brightness is regulated; The application of present described network constantly has been extended to the field to a plurality of or multiple device cooperation control, for example, and to the hydraulic pressure control of each shower nozzle in many shower nozzles fountain, to the brightness or the color control of LED display.
In the network of described establishment based on the DMX512 agreement, regulation and control The data asynchronous communication means, message transmission rate is 250 kbps.As shown in Figure 4, every frame comprises synchronous head D based on the data of DMX512 agreementHWith 512 regulation and control data byte D, described regulation and control data byte D comprises joint start bit BF, regulation and control byte BDWith section end position BEBe adjusted to example with traditional lamplight brightness, described data sink reads the regulation and control byte B of the regulation and control data of relevant position from every frame data for its addresses distributed according to networkD, described regulation and control byte BDThe information of transmitting is exactly the lamplight brightness value.So, be exactly an important ring of guaranteeing to regulate and control that data are accurately transmitted for each data sink distributes the address.
Prior art mainly contains following three kinds of methods and solves the problem of described data sink addressing:
The first, artificial addressing.A dual-in-line toggle switch Dual In-line PackageSwitches is set on each data sink, is called for short DIP switch.By manually stirring described DIP switch, for each data sink is set address code, the single-chip microcomputer in the described data sink is determined the position in frame data of the regulation and control data byte D that it should receive according to this address code, thereby accurately receives regulation and control byte BDThe defective of this method is, manually dials that to establish the DIP switch workload big, be easy to take place to leak dial, many groups or wrong problem such as dial, increased debugging cost, but also can bring very big hidden danger for the later maintenance process.
The second, the synchronous shifted data of SPI, described SPI is the abbreviation of Serial Peripheral Interface Serial Peripheral Interface.Synchronised clock port and data latching enable port are set on general purpose control/encoder and data sink, and set up the transmission line that is used for transmitting synchronous clock signal and data latching enable signal respectively, all data sink serial networkings.Under the synchronous effect of described synchronizing clock signals, frame data are shifted in proper order, when the regulation and control data byte is moved to each self-corresponding data sink coupling, send the data latching enable signal, each data sink latchs regulation and control data byte separately, finishes corresponding addressing and receives data.The defective of this method is, the DMX512 control/encoder that described network can not compatible universal need be reequiped general DMX512 control/encoder; Also to increase transmission line simultaneously, be increased to 5 transmission lines by original 3 transmission lines, and for the applicable cases of long transmission distance, adopt the RS485 interface, transmission line is increased to 8 by original 4, and for actual networking, too much transmission line is can not be received.
The 3rd, use special-purpose control/encoder and receiver.This method generally is the DMX512 agreement of no longer complete compatibility standard, and only in the compatible DMX512 agreement of supporting of tcp data segment, and increase is tested or the training and operation pattern before the transmission data, is used for each data sink write address.Said method needs data sink to make to reply toward contact, therefore also can increase by one or two connecting lines on a small quantity.The defective of this method is, control/encoder and data sink that described method is used all be supporting design, and special function is arranged, and can not adopt the general DMX512 control/encoder of prior art to mate, all totally unfavorable in networking cost and application, the scope of application is little; And connecting line also has the increase of varying number, and networking mode is also comparatively complicated, also different style and very complicated on the control/encoder operation.
Said method all has defective separately, and for the LED light fixture, each light fixture will take a more than address, and for example to the control of red, green, blue three coloured light of light fixture, prior art does not also propose a kind of DMX512 of utilization network and realizes that a data receiver takies the method for a plurality of addresses.Therefore, need a kind of can the compatible various networks of setting up based on the DMX512 agreement, make the method for data sink auto-addressing.
Summary of the invention
The technical problem to be solved in the present invention is to avoid the deficiencies in the prior art part and in the regulation and control data network of the DMX512 control/encoder that proposes at compatible universal, is the method for data sink auto-addressing and the data sink that is used for this method.
The present invention solve the technical problem can be by realizing by the following technical solutions:
Implement a kind of method that in the regulation and control data network of setting up based on the DMX512 agreement, makes the data sink auto-addressing, described regulation and control data network comprises DMX512 Data Control/encoder and n DMX512 data sink, n≤512, the data-out port of described DMX512 Data Control/encoder is electrically connected with the data-in port of a DMX512 data sink, and described DMX512 data sink is connected in series networking according to the mode that self output port is electrically connected the input port of next DMX512 data sink; Especially, described each DMX512 data sink receives every frame data as follows:
A. from data-in port frames received certificate;
B. according to the DMX512 agreement described frame data are decoded;
C. the reception regulation and control amount of bytes k that sets according to described DMX512 data sink self reads preceding k group regulation and control data byte regulation and control byte separately in the described frame data of handling through step B respectively, k≤n;
D. will be through the preceding k group regulation and control data byte deletion in the described frame data of step B processing;
E. the described frame data that will handle through step D are according to the DMX512 protocol code;
F. will handle described frame data through step e exports from data-out port.
The present invention solve the technical problem can be by realizing by the following technical solutions:
Design, a kind of data sink of manufacturing based on the DMX512 agreement, comprise power input mouth, grounding ports, data-in port and data-out port, especially, also comprise the regulation and control data reception module that is connected electrically between described data-in port and the data-out port; Described regulation and control data reception module is at first decoded the frame data of receiving and is read preceding k regulation and control data byte regulation and control byte separately, behind in the delete frame data preceding k the regulation and control data byte frame data recompile is exported then, wherein k is the reception regulation and control byte number that described data sink is set, and described decoding and coding all are according to the DMX512 agreement frame data to be carried out processing procedure.
Described regulation and control data reception module is a single-chip microcomputer, or Digital Logical Circuits.
Compare with prior art, the present invention's's " DMX512 data sink and method of auto-addressing in network thereof " technique effect is:
1. do not need DMX512 Data Control/encoder is done any particular design, each DMX512 data sink can be connected any one position in the regulation and control data network, just can realize the addressing to described data sink, makes networking work simple;
2. in data transmission, each DMX512 data sink all is equivalent to a data relaying, transfer of data is not subjected to distance limit, even do not need to be provided with special-purpose transmission line to strengthen data signal strength under the situation of long transmission distance, makes the simple for structure of described regulation and control data network yet;
3. because each DMX512 data sink all receives the regulation and control data byte according to identical mode, therefore, the data sink in described regulation and control data network all is identical, makes the maintenance of described regulation and control data network easier;
4. described DMX512 data sink can receive k group regulation and control data byte, is equivalent to can receive at a data receiver regulation and control data byte of k address, makes described regulation and control data network have complicated more regulation and control transfer of data and distributes ability.
Description of drawings
Fig. 1 is the electric theory diagram of the DMX512 data sink 200 of the present invention's " DMX512 data sink and method of auto-addressing in network thereof " preferred embodiment;
Fig. 2 is the networking schematic diagram of the DMX512 data regulated and control network of the preferred embodiment of the present invention;
Fig. 3 is the workflow schematic diagram of the regulation and control data reception module 210 of the described DMX512 data sink 200 of the preferred embodiment of the present invention;
Fig. 4 is the data structure schematic diagram of a frame based on the DMX512 agreement.
Embodiment
Be described in further detail below in conjunction with preferred embodiment shown in the accompanying drawing.
The present invention relates to a kind of method that in the regulation and control data network of setting up based on the DMX512 agreement, makes the data sink auto-addressing, as depicted in figs. 1 and 2, described regulation and control data network 300 comprises DMX512 Data Control/encoder 100 and n DMX512 data sink 200, n≤512, the data-out port ID of described DMX512 Data Control/encoder 100 is electrically connected with the data-in port I of a DMX512 data sink, described DMX512 data sink is connected in series networking according to the mode that self output port O is electrically connected the input port I of next DMX512 data sink, especially, described each DMX512 data sink 200 receives every frame data as follows:
A. from data-in port I frames received certificate;
B. according to the DMX512 agreement described frame data are decoded;
C. the reception regulation and control amount of bytes k that sets according to described DMX512 data sink self reads preceding k group regulation and control data byte regulation and control byte separately in the described frame data of handling through step B respectively, k≤n;
D. will be through the preceding k group regulation and control data byte deletion in the described frame data of step B processing;
E. the described frame data that will handle through step D are according to the DMX512 protocol code;
F. will handle described frame data through step e exports from data-out port O.
As shown in Figure 2, described DMX512 data sink 200 serial connection networking modes have been distributed physical address for each data sink 200, and each DMX512 data sink 200 all receives and the corresponding k group of self physical address regulation and control data byte according to steps A to step F.When k=1, described physical address is corresponding with the distribution address of regulation and control data byte; When k>1, each DMX512 data sink 200 takies the distribution address of k regulation and control data byte, this kind situation is applicable to the application scenario that some are special, for example, described regulation and control data network based on the DMX512 agreement is the regulation and control that are used for LED light fixture group, and each described LED light fixture comprises three LED luminous elements that send three kinds of light of red, green, blue respectively, so just need distribute the light modulation data byte respectively for three LED luminous elements in this LED light fixture, in such cases, the reception regulation and control amount of bytes k=3 that sets in the described DMX512 data sink 200.
As mentioned above, described DMX512 data sink 200 is not only finished the reception of regulation and control byte, also frame data are carried out recompile, remove the regulation and control byte that is read by self, the regulation and control byte that next DMX512 data sink 200 need be received is positioned at the first place of frame data, and to new frame data recompile.Described DMX512 data sink 200 has also played the effect of data relayings, makes them can the long-distance transmissions data.
As shown in Figure 1, the invention still further relates to a kind of data sink 200 based on the DMX512 agreement, comprise power input mouth Vcc, grounding ports GND, data-in port I and data-out port O, especially, also comprise the regulation and control data reception module 210 that is connected electrically between described data-in port I and the data-out port O.Described regulation and control data reception module 210 is at first decoded the frame data of receiving and is read preceding k regulation and control data byte regulation and control byte separately, behind in the delete frame data preceding k the regulation and control data byte frame data recompile is exported then, wherein k is the reception regulation and control byte number that described data sink is set, and described decoding and coding all are according to the DMX512 agreement frame data to be carried out processing procedure.In addition, when being used for long-distance transmissions, described data-in port I and data-out port O can adopt the RS485 interface.
Described regulation and control data reception module 210 is single-chip microcomputers, or Digital Logical Circuits.Be the saving hardware cost, the preferred embodiment of the present invention, described regulation and control data reception module 210 adopts single-chip microcomputers, and the reception flow chart of data processing figure of this single-chip microcomputer is as shown in Figure 3.