Event type data collector through NFC interaction
Technical Field
The invention relates to the technical field of communication, in particular to an event type data acquisition unit interacting through NFC.
Background
In the industrial information system, each factory device is connected into the system through a data acquisition device, a large number of data acquisition devices exist in the system, the current data acquisition devices generally only acquire the electrical state of the device, more functions are required to be transmitted to a host through a network and then processed by the host, so that the load of the host is large and the host is too dependent on a communication bus, even if a small number of data acquisition devices with event processing are provided, the event triggering conditions are often fixed and single, and the applicable scenes are few. The initial communication parameters are set and the power is needed to be connected in parallel during field debugging, so that the method is sometimes limited by the installation position and space of a data collector, the operation is very inconvenient, and the efficiency is low.
Therefore, in order to solve the above technical problems, a new technical solution needs to be provided. In particular to an event type data collector interacting through NFC.
Disclosure of Invention
The invention provides an event type data acquisition unit interacting through NFC, aiming at solving the technical problems in the background technology.
The following technical scheme is provided for achieving the purpose: an event type data acquisition unit interacting through NFC comprises an NFC interaction unit, a counting event capturing unit, a code scanning event capturing unit, a power failure data retaining unit, an event output unit, an uplink communication unit and a master controller, wherein the NFC interaction unit, the counting event capturing unit, the code scanning event capturing unit, the power failure data retaining unit, the event output unit and the uplink communication unit are respectively in communication connection with the master controller.
The NFC interaction unit is used for setting parameters and reading running dynamic data in a passive and non-contact mode through NFC (near Field communication).
The counting event capturing unit is used for capturing and processing the counting event according to the set triggering condition.
The code scanning event capturing unit is used for accessing a code scanning gun of the asynchronous communication interface and capturing a code scanning event according to a set frame format.
The power-down data holding unit is used for holding 24-hour running data after power failure.
The event output unit is used for executing and outputting an event.
And the uplink communication unit is used for interaction after being connected with the host end through a 485 or LAN network.
Preferably, the NFC interaction unit antenna adopts a PCB planar coil, an inductance LA, a resistance RA, and a capacitance of C1 of the coil form an LRC resonant circuit, the resonant frequency is 13.56MHZ, and the resonant point conforms to the IEC14443 standard.
U20 is an NFC front-end transponder, as shown in FIG. 3, U20 includes 1K EEPROM and 64 bytes of SRAM 2 data area inside, can access the data area through NFC field communication and I2C communication 2 ways, external NFC equipment reads and writes the data area through non-contact field communication, the master controller reads and writes the data area through I2C communication, and the external NFC equipment and the master controller perform data interaction through U20 data area.
The communication parameters and event parameters of the present invention are stored in the EEPROM area of U20.
The operation data of the invention is dynamically stored in the SRAM area of U20.
The external NFC devices may be very readily available NFC enabled cell phones and PADs. U20 model NT3H 2111.
Preferably, the counting event capturing unit is composed of a signal voltage adapting part, a signal isolation conversion part, a signal edge capturing part and a signal effective time capturing part.
Preferably, the signal voltage adapting part is connected with external signals of various voltage rails (5V system, 24V system and 48V system) to generate the same current.
The light MOS tube U15, U17 and the resistor R14, R15, R17 form a resistor network,
the resistance value of the resistor network is equal to the resistance value of R17 when both U15 and U17 are not conducted;
when the U15 is switched on and the U17 is switched off, the resistance value of the resistor network is equal to the parallel resistance value of R15 and R17;
when the U15 is disconnected, the resistance value of the resistor network is equal to the parallel resistance value of R14 and R17 when the U17 is connected;
according to the setting of signal voltage amplitude parameters, the main controller controls the on-off of U15 and U17, and the purpose that external signals with different amplitudes generate rated driving current through a resistance network is achieved.
F1 is a self-restoring fuse, which can perform overcurrent protection when the set value is inconsistent with the external access signal.
U15 and U17 are TLP170D, and F1 is 1206L005/60 WR.
Preferably, the signal isolation and conversion part adopts a bidirectional optical coupler U19, a primary side driving current of the optical coupler is generated through an external signal, and a secondary side of the optical coupler isolates and converts the signal into a 3.3V system. And R19 connected in parallel at the primary side 2 end of the optical coupler has an anti-interference effect. The U19 model is PC 354.
Preferably, the signal edge capturing section may capture rising edge and falling edge transitions. After the Rising edge signal passes through the D-latch U12, the latch output is connected to pin B of the or gate U13, and the setting pin Rising _ EN of the master is also connected to pin a of U13, when the Rising _ EN pin is high: the output of U13 is high whether the U12 output is high or low. When the Falling _ EN pin is low: the output of U13 depends on the output of U12.
The Falling edge signal is coupled through inverter U18 to D latch U11, the latch output is coupled to pin B of OR gate U16, and the setting pin Falling _ EN of the master controller is also coupled to pin A of U16, when Falling _ EN pin is high: the output of U16 is high whether the U11 output is high or low. When the Falling _ EN pin is low: the output of U16 depends on the output of U11.
The U13 and U12 outputs are connected to pins A and B of AND gate U14, respectively, and the output of U14 is equal to the output of U13 output logic AND U12. The output of U12 is the edge capture pin and is active low.
When the Rising _ EN pin is high and the Falling _ EN pin is low, the Falling edge signal is effective;
when the Rising _ EN pin is low and the Falling _ EN pin is high, the Rising edge signal is effective;
when the Rising _ EN pin is low, the Falling _ EN is low, and both the Falling edge and the Rising edge are active.
U11 and U12 are 74LVC1G74, U13 and U16 are 74LVC1G32, U14 is 74LVC1G08, and U18 is 74LVC1G 04.
Preferably, the signal valid time capturing part is realized by a firmware program of the master. The effective time capture ranges from 1ms to 1 s.
As shown in FIG. 5, the counting event logic executed by the main controller comprises three parts of triggering condition, counting value conversion and event output. And an electrical count value is added after the external signal meets the trigger condition, the electrical original count value is converted into a physical count value through the count value, and the event is triggered to be output when the physical count value is greater than a threshold value.
The triggering conditions comprise three conditions of signal jump, signal effective duration and signal voltage amplitude, the three conditions jointly meet a post-triggering event, and the three conditions can be set.
The count value conversion is a count value relationship that maps the count value of the actual physical object and the electrical signal. The mapping relationship may be set.
And the event output is processed and output by the network host without processing when the physical count value reaches a threshold value. The drive channel number of the output and the type of output level may be set.
The invention has the beneficial effects that:
1. the data collector can be subjected to parameter setting under passive and non-contact conditions by using a mobile terminal (a mobile phone, a PAD and the like) with an NFC function, so that convenience is brought to field debugging and debugging, and the timeliness and convenience of system implementation are greatly increased;
2. the event type mechanism is adopted, so that the burden of a system host is reduced, the dependence on a network is reduced, the capacity of the system is increased, and the reliability of the system is improved;
3. and the event trigger conditions are set in multiple dimensions, so that the flexibility is greatly improved, and the use scenes are widened.
Drawings
FIG. 1 is a diagram of the collector framework of the present invention.
Fig. 2 is a schematic diagram of an NFC interaction unit of the present invention.
Fig. 3 is a diagram of the NFC front-end framework of the present invention.
FIG. 4 is a schematic diagram of a counting event capture unit of the present invention.
FIG. 5 is a logical diagram of the count event mechanism of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the orientations or positional relationships indicated as the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., appear based on the orientations or positional relationships shown in the drawings only for the convenience of describing the present invention and simplifying the description, but not for indicating or implying that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" as appearing herein are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly stated or limited, the terms "mounted," "connected," and "connected" should be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
As shown in fig. 1 to 5, an event type data collector interacting through NFC includes an NFC interaction unit, a counting event capture unit, a code scanning event capture unit, a power down data holding unit, an event output unit, an uplink communication unit, and a host controller, where the NFC interaction unit, the counting event capture unit, the code scanning event capture unit, the power down data holding unit, the event output unit, and the uplink communication unit are respectively in communication connection with the host controller.
The NFC interaction unit is used for setting parameters and reading running dynamic data in a passive and non-contact mode through NFC (near Field communication).
The counting event capturing unit is used for capturing and processing the counting event according to the set triggering condition.
The code scanning event capturing unit is used for accessing a code scanning gun of the asynchronous communication interface and capturing a code scanning event according to a set frame format.
The power-down data holding unit is used for holding 24-hour running data after power-off.
The event output unit is used for executing and outputting events.
The uplink communication unit is used for interaction after being connected with the host end through a 485 or LAN network.
The NFC interaction unit antenna adopts a PCB planar coil, an inductance LA, a resistance RA and a C1 capacitor of the coil form an LRC resonant circuit, the resonant frequency is 13.56MHZ, and the resonant point accords with the IEC14443 standard.
U20 is an NFC front-end transponder, as shown in FIG. 3, U20 includes 1K EEPROM and 64 bytes of SRAM 2 data area inside, can access the data area through NFC field communication and I2C communication 2 ways, external NFC equipment reads and writes the data area through non-contact field communication, the master controller reads and writes the data area through I2C communication, and the external NFC equipment and the master controller perform data interaction through U20 data area.
The communication parameters and event parameters of the present invention are stored in the EEPROM area of U20.
The operation data of the invention is dynamically stored in the SRAM area of U20.
The external NFC devices may be very readily available NFC enabled cell phones and PADs. U20 model NT3H2111, as shown in FIG. 2.
The counting event capturing unit consists of a signal voltage adapting part, a signal isolation and conversion part, a signal edge capturing part and a signal effective time capturing part.
Wherein, the signal voltage adapting part is connected with external signals of various voltage rails (5V system, 24V system, 48V system) to generate the same current, as shown in fig. 4.
The light MOS tube U15, U17 and the resistor R14, R15, R17 form a resistor network,
the resistance value of the resistor network is equal to the resistance value of R17 when both U15 and U17 are not conducted;
when the U15 is switched on and the U17 is switched off, the resistance value of the resistor network is equal to the parallel resistance value of R15 and R17;
when the U15 is disconnected, the resistance value of the resistor network is equal to the parallel resistance value of R14 and R17 when the U17 is connected;
according to the setting of signal voltage amplitude parameters, the main controller controls the on-off of U15 and U17, and the purpose that external signals with different amplitudes generate rated driving current through a resistance network is achieved.
F1 is a self-restoring fuse, which can perform overcurrent protection when the set value is inconsistent with the external access signal.
U15 and U17 are TLP170D, and F1 is 1206L005/60 WR.
The signal isolation and conversion part adopts a bidirectional optical coupler U19, primary side driving current of the optical coupler is generated through an external signal, and a secondary side of the optical coupler isolates and converts the signal into a 3.3V system. And R19 connected in parallel at the primary side 2 end of the optical coupler has an anti-interference effect. The U19 model is PC 354.
The signal edge capturing part can capture rising edge and falling edge transition. After the Rising edge signal passes through the D-latch U12, the latch output is connected to pin B of the or gate U13, and the setting pin Rising _ EN of the master is also connected to pin a of U13, when the Rising _ EN pin is high: the output of U13 is high whether the U12 output is high or low. When the Falling _ EN pin is low: the output of U13 depends on the output of U12.
The Falling edge signal is coupled through inverter U18 to D latch U11, the latch output is coupled to pin B of OR gate U16, and the setting pin Falling _ EN of the master controller is also coupled to pin A of U16, when Falling _ EN pin is high: the output of U16 is high whether the U11 output is high or low. When the Falling _ EN pin is low: the output of U16 depends on the output of U11.
The U13 and U12 outputs are connected to pins A and B of AND gate U14, respectively, and the output of U14 is equal to the output of U13 output logic AND U12. The output of U12 is the edge capture pin and is active low.
When the Rising _ EN pin is high and the Falling _ EN pin is low, the Falling edge signal is effective;
when the Rising _ EN pin is low and the Falling _ EN pin is high, the Rising edge signal is effective;
when the Rising _ EN pin is low, the Falling _ EN is low, and both the Falling edge and the Rising edge are active.
U11 and U12 are 74LVC1G74, U13 and U16 are 74LVC1G32, U14 is 74LVC1G08, and U18 is 74LVC1G 04.
The signal effective time capturing part is realized by adopting a firmware program of a master controller. The effective time capture ranges from 1ms to 1 s.
As shown in FIG. 5, the counting event logic executed by the main controller comprises three parts of triggering condition, counting value conversion and event output. And an electrical count value is added after the external signal meets the trigger condition, the electrical original count value is converted into a physical count value through the count value, and the event is triggered to be output when the physical count value is greater than a threshold value.
The triggering conditions comprise three conditions of signal jump, signal effective duration and signal voltage amplitude, the three conditions jointly meet a post-triggering event, and the three conditions can be set.
The count value conversion is a count value relationship mapping the actual physical object and the electrical signal. The mapping relationship may be set.
And the event output is that the event output is processed and executed by the network host without the processing of the network host after the physical count value reaches the threshold value. The drive channel number of the output and the type of output level may be set.
The above embodiments are only for illustrating the invention and are not to be construed as limiting the invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention, therefore, all equivalent technical solutions also belong to the scope of the invention, and the scope of the invention is defined by the claims.