Based on the multichannel temperature value live transmission method of FF agreement
Technical field
The present invention relates to a kind of field bus communication method, particularly relate to a kind of multichannel temperature value live transmission method based on FF agreement.
Background technology
Foundation fieldbus (Fieldbus Foundation), based on ISO/OSI the Open Systems Interconnection model, gets its Physical layer, corresponding level that data link layer, application layer are FF traffic model, and adds client layer on the application layer.The needs that client layer is applied mainly for automatic measure control, define the uniform rules of Information Access, adopt device Description Language to define general functional block collection.The main technical content of foundation fieldbus comprises FF communication protocol, for completing the communication stack of 2-7 layer communication protocol in opening and interconnecting pattern, for describing device characteristics, parameter, the DDL device Description Language of attribute and operation-interface, device description dictionary, measure for realizing, control, the functional block of the functions such as quantities conversion, realize system configuration, scheduling, the systems software technology of the functions such as management and construct integrated automation system, the system integration technology of network system.
FF is the solution for process automation.FF can linking automation system and the field apparatus comprising pressure, temperature and level transmitter.FF can replace 4 ~ 20mA technology.FF can save the cost more than 40% in plan, wiring, debugging and maintenance phase, and greatly improves at functional and secure context.
FF requires less cable, and when using traditional wiring method, each independent signal wire must be connected to the I/O module of Process Control System, and each equipment needs an independently power supply.By contrast, when using FF, only need two line cables just can transmit power supply needed for all information and field apparatus.This not only reduces wiring cost, and decrease I/O module number required in Process Control System.FF allows to realize measuring, control and demarcating by simple two line cables; It even also allows in intrinsic safety region power supply to the device.FF allows at run duration maintenance, connect/disconnect equipment, and does not affect other stations, even also allows so to do at potential blast area.FF has carried out with the user of process control industries (NAMUR) and has cooperated closely, and meets the particular requirement of this application:
In industrial process automation system, the measurement of temperature is essential, the instrument of common FF agreement is the temperature of an instrument measurement point for measuring temperature, and industrial process automation system is general all very huge, need to arrange a large amount of points for measuring temperature, therefore the metered quantity needed is also very surprising, also makes the wiring of instrument very complicated simultaneously.If based on a parallel temperature measure method for FF technology, make to use the instrument of the FF agreement of the method can realize the temperature of a multiple point for measuring temperature of instrument measurement, so will reduce the cost of industrial process automation system and reduce the complicacy of instrument wiring.
Summary of the invention
The invention discloses a kind of multichannel temperature value live transmission method based on FF agreement, cannot the problem of temperature measuring multiple point for measuring temperature in order to the instrument solving FF agreement of the prior art.
Above-mentioned purpose of the present invention is achieved through the following technical solutions:
A kind of multichannel temperature value live transmission method based on FF agreement, wherein, comprise: the multiple temperature data of multiple temperature sensor Real-time Obtainings, and multiple temperature data is transferred to microprocessor, multiple temperature data is stored to designating unit by microprocessor respectively; FF protocol communication unit obtains FF bus signals, signal is delivered to microprocessor by modulation /demodulation, level conversion by FF protocol communication unit, microprocessor carries out deblocking according to FF protocol format to packet, the temperature data of respective channel is carried out the encapsulation of FF formatted data bag by microprocessor afterwards, afterwards microprocessor by data packet transmission to FF protocol communication unit, FF protocol communication unit by data packet transmission to FF bus.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, the multiple temperature data of multiple temperature sensor Real-time Obtainings, is transferred to microprocessor by multiple temperature data by multiple temperature data after signal condition and analog to digital conversion.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, multiple temperature data carries out analog to digital conversion and comprises: filtering, amplification, conversion.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, multiple temperature data is stored to designating unit by microprocessor respectively, and refreshes designating unit in real time.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, multiple temperature data is carried out temperature signal calculating, Linearized correction by microprocessor.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, multiple temperature data transfers to and is with EEPROM (Electrically Erasable Programmable Read Only Memo) to back up by microprocessor.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, FF bus by data packet transmission to FF main website.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, before the multiple temperature data of multiple temperature sensor Real-time Obtainings, first carry out instrument initialization operation.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, the FF request that microprocessor receives FF protocol communication unit is interrupted, and microprocessor takes out the temperature data stored and carries out FF response, and microprocessor sends response message backed off after random and interrupts.
As above based on the multichannel temperature value live transmission method of FF agreement, wherein, FF response comprises: by the temperature value stored in microprocessor by FF protocol requirement carry out packet packing, the judgement of communication frame correctness, function code and length judgement, send respective frame etc. according to request.
In sum, owing to have employed technique scheme, the instrument that the invention solves FF agreement of the prior art cannot the problem of temperature measuring multiple point for measuring temperature, by the data of multiple temperature sensor are stored in microprocessor respectively, and the temperature data being realized corresponding temperature sensor by corresponding FF protocol communication unit is read, the present invention has: a transmitter can substitute the traditional independent mount type instrument of multiple stage, temperature survey is carried out to multiple spot adjacent to each other, reduce the complicacy that measurement point is set, only need to carry out configuration to the parameter of a multi-passage temp. variable transporting device, support FF protocol transmission, be applicable to essential safety occasion, temperature acquisition and request-reply can be carried out in real time, reduce costs, the electronic unit total price of a multi-passage temp. variable transporting device than eight traditional single point temperature transmitters with low 5-6 advantage doubly.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the multichannel temperature value live transmission method that the present invention is based on FF agreement;
Fig. 2 is the FB(flow block) of an embodiment of the multichannel temperature value live transmission method that the present invention is based on FF agreement.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described further:
Fig. 1 is the structured flowchart of the multichannel temperature value live transmission method that the present invention is based on FF agreement, refer to Fig. 1, a kind of multichannel temperature value live transmission method based on FF agreement, wherein, the multiple temperature data of multiple temperature sensor 6 Real-time Obtaining, and multiple temperature data is transferred to microprocessor 1, multiple temperature data is stored to designating unit by microprocessor 1 respectively; FF protocol communication unit 3 obtains FF bus 7 signal, signal is delivered to microprocessor 1 by modulation /demodulation, level conversion by FF protocol communication unit 3, microprocessor 1 carries out deblocking according to FF protocol format to packet, the temperature data of respective channel is carried out the encapsulation of FF formatted data bag by microprocessor 1 afterwards, afterwards microprocessor 1 by data packet transmission to FF protocol communication unit 3, FF protocol communication unit 3 by data packet transmission to FF bus 7.FF protocol communication unit 3 realizes the function of the protocol physical layers of FF, as the modulation /demodulation etc. of synchronous transfer module, level conversion, Manchester's cde, power supply and signal, and carries out bus-powered to instrument.
The multiple temperature data of the present invention's multiple temperature sensor 6 Real-time Obtaining, multiple temperature data is transferred to microprocessor 1 by multiple temperature data after signal condition 4 and analog to digital conversion 2, analog to digital conversion 2 realizes the conversion of temperature signal from analog quantity to digital quantity, signal condition 4 realizes the filtering of analog quantity temperature signal, the undesired signal of filtering industry spot, and realize switching between multiple passage.
The multiple temperature data of the present invention carries out analog to digital conversion 2 and comprises: filtering, amplification, conversion.
Multiple temperature data is stored to designating unit by microprocessor 1 of the present invention respectively, and refreshes designating unit in real time.
More than 1 temperature data is carried out temperature signal calculating, Linearized correction by microprocessor of the present invention.
More than 1 temperature data is transferred to band EEPROM (Electrically Erasable Programmable Read Only Memo) (EEPROM) 5 and backs up by microprocessor of the present invention; EEPROM5 be used for store power down must preserve data.
FF bus 7 of the present invention by data packet transmission to FF main website.
Fig. 2 is the FB(flow block) of an embodiment of the multichannel temperature value live transmission method that the present invention is based on FF agreement, refer to Fig. 2, in one embodiment of the invention: industrial control network supports FF protocol transmission, wherein FF main website, primary responsibility communication cycle, or acyclic communications function, the request of data of appropriate address is handed down to the intelligent multi-channel temperature transmitter met the demands by it by FF bus, after intelligent multi-channel temperature transmitter have received FF claim frame, carry out a temperature acquisition, gather after terminating and return to FF main website by FF bus again.
First carry out instrument initialization operation before the multiple temperature data of the present invention's multiple temperature sensor 6 Real-time Obtaining, instrument initialization is a series of actions of instrument powered on moment.
Further, in one embodiment of the invention: instrument initialization, comprise the operations such as CPU initialization of register, SPC4-2 initialization, communication module initialization, Measurement channel initialization, wherein CPU initialization of register contains the configuration of I/O mouth, house dog configuration and interrupt configuration; SPC4-2 initialization relates to RAM configuration, the initialization of SAP region, buffer zone initialization and DPV0/DPV1 and serves initial configuration; Measurement channel initialization makes AD controller enter into default conditions, to start sampling work at any time.
The FF request that microprocessor of the present invention receives FF protocol communication unit 3 is interrupted, and microprocessor 1 takes out the temperature data stored and carries out FF response, and microprocessor 1 sends response message backed off after random and interrupts.
Further, FF asks to interrupt, the data mainly in SPC4-2 intelligent communication chip automatic reception FF bus, and notifies CPU in the mode of interrupting.Interrupt service routine will set reception buffer zone when message just receives, to be received complete after, data reading is transmitted parsing.
FF of the present invention response comprises: by the temperature value stored in microprocessor 1 by FF protocol requirement carry out packet packing, the judgement of communication frame correctness, function code and length judgement, send respective frame etc. according to request.
The present invention also comprises: AD sampling and process, mainly realizes reading A/D sampled value, data processing, the functions such as conversion unit.