CN106353587A - Method and system for processing data of power sensor - Google Patents

Method and system for processing data of power sensor Download PDF

Info

Publication number
CN106353587A
CN106353587A CN201610918407.1A CN201610918407A CN106353587A CN 106353587 A CN106353587 A CN 106353587A CN 201610918407 A CN201610918407 A CN 201610918407A CN 106353587 A CN106353587 A CN 106353587A
Authority
CN
China
Prior art keywords
power sensor
module
control command
data processing
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610918407.1A
Other languages
Chinese (zh)
Other versions
CN106353587B (en
Inventor
刘克农
付武江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Chiffo Electronics Instruments Co Ltd
Original Assignee
Chengdu Chiffo Electronics Instruments Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Chiffo Electronics Instruments Co Ltd filed Critical Chengdu Chiffo Electronics Instruments Co Ltd
Priority to CN201610918407.1A priority Critical patent/CN106353587B/en
Publication of CN106353587A publication Critical patent/CN106353587A/en
Application granted granted Critical
Publication of CN106353587B publication Critical patent/CN106353587B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)
  • Power Sources (AREA)

Abstract

The invention discloses a method for processing the data of a power sensor. The method comprises the following steps: step one, initializing the power sensor; step two, judging whether a first timer is interrupted, if so, carrying out a first task, and if not, carrying out step three; step three, judging whether a second timer is interrupted, if so, carrying out a second task, and if not, carrying out step four; step four, judging whether a host control command is received, if so, analyzing the control command, and carrying out corresponding data processing according to an analytical result; and step five, returning the data after data processing back to a host computer. According to the method for processing the data of the power sensor, disclosed by the invention, different control operations are carried out by setting different interrupt operations, the method is diversified in functions compared with the prior art, and function extension can be carried out conveniently by using an interrupt manner, so that the method is convenient for a user to operate.

Description

A kind of power sensor data processing method and system
Technical field
The present invention relates to power sensor field, particularly to a kind of power sensor data processing method and system.
Background technology
Power reflection meter is commonly used to measure radio frequency (rf) or the power of microwave frequency (mw) signal.Typical power reflection Meter uses power detector or transducer, so that rf or mw power is converted to the electric parameter that can easily measure.Power reflection meter In perhaps eurypalynous rf and mw system, also there is application.
Power sensor determines reflexometer as the topmost ingredient of radio-frequency power reflexometer, its measurement capability Performance, and existing power sensor single function, poor expandability.
Content of the invention
The invention reside in overcoming the above-mentioned deficiency of prior art, provide a kind of vdiverse in function, preferable power of extensibility Sensing data processing method and system.
In order to realize foregoing invention purpose, the technical solution used in the present invention is:
A kind of power sensor data processing method, comprises the following steps:
Step 1, initialization power sensor;
Step 2, judge whether first timer interrupts, if so, then execute first task, if it is not, then execution step 3;
Step 3, judge whether second timer interrupts, if so, then execute the second task, if it is not, then execution step 4;
Step 4, judge whether to receive Host Control Command, if then parsing to described control command, and according to parsing Result carries out corresponding data processing;
Step 5, the data after described data processing is returned to main frame.
Further, described first task is to calculate compensation temperature value.
Further, described second task is to update analog-digital converter array data.
Further, if described Host Control Command is to write calibration data order, described power sensor is connect by usb Mouth receives described calibration data, and described calibration data is write in memorizer.
Further, if described Host Control Command is to control analog board order, described power sensor is connect by spi Mouthful described analog board is controlled, and the data is activation that analog board is returned is to described main frame.
Present invention simultaneously provides a kind of power sensor data handling system, including usb communication interface, spi communication interface, Command analysis module, command execution module, timer module, described timer module connects usb communication module, for when described When power sensor does not receive timer command, make the control command that described usb communication interface Receiving Host sends;Described usb Communication interface connects main frame and command analysis module, the control command sending for Receiving Host, and described control command is sent out Deliver to command analysis module, described command analysis module bind command performing module, for the order after execution parsing;Described life Performing module is made to be also connected with described spi communication interface, described spi communication interface connects analog board, sends out for being resolved to main frame During the control analog board order sent, by spi interface, described analog board is controlled.
Compared with prior art, beneficial effects of the present invention
The power sensor data processing method of the present invention is passed through to arrange the different control operation of different interrupt operation execution, phase Ratio prior art, it is vdiverse in function, easily can carry out Function Extension using interrupt mode simultaneously, be easy to user and operated.
Brief description
Fig. 1 show the power sensor data processing method flow chart of the present invention.
Fig. 2 show the power sensor data handling system module frame chart of the present invention.
Specific embodiment
With reference to specific embodiment, the present invention is described in further detail.But this should not be interpreted as the present invention The scope of above-mentioned theme is only limitted to below example, all models belonging to the present invention based on the technology that present invention is realized Enclose.
Embodiment 1:
Fig. 1 show the power sensor data processing method flow chart of the present invention, comprises the following steps:
Step 1, initialization power sensor;
Step 2, judge whether first timer interrupts, if so, then execute first task, if it is not, then execution step 3;
Step 3, judge whether second timer interrupts, if so, then execute the second task, if it is not, then execution step 4;
Step 4, judge whether to receive Host Control Command, if then parsing to described control command, and according to parsing Result carries out corresponding data processing;
Step 5, the data after described data processing is returned to main frame.
In a detailed embodiment, described first task is to calculate compensation temperature value.
In a detailed embodiment, described second task is to update analog-digital converter array data.
In a detailed embodiment, if described Host Control Command is to write calibration data order, described power passes Sensor passes through calibration data described in usb interface, and described calibration data is write in memorizer.
In a detailed embodiment, if described Host Control Command is to control analog board order, described power passes Sensor is controlled to described analog board by spi interface, and the data is activation that analog board is returned is to described main frame.
The power sensor data processing method of the present invention is passed through to arrange the different control behaviour of different interrupt operation execution Make, compared to existing technology, it is vdiverse in function, easily can carry out Function Extension using interrupt mode simultaneously, is easy to user and carries out Operation.
Present invention simultaneously provides a kind of power sensor data handling system, specifically, referring to Fig. 2, connect including usb communication Mouth, spi communication interface, command analysis module, command execution module, timer module, described timer module connects usb communication Module, for the control when described power sensor does not receive timer command, making described usb communication interface Receiving Host send System order;Described usb communication interface connects main frame and command analysis module, the control command sending for Receiving Host, and will Described control command is sent to command analysis module, and described command analysis module bind command performing module, for executing parsing Order afterwards;Described command execution module is also connected with described spi communication interface, and described spi communication interface connects analog board, is used for When being resolved to the control analog board order of main frame transmission, by spi interface, described analog board is controlled.
During concrete operations, power sensor first carries out upper electricity, after upper electricity, carries out software and hardware initialization first, subsequently into Mastery routine.Power sensor software does not carry out any action in mastery routine, and all of execution operation all completes in interruption, it Interrupt including three: in first timer interruption, second timer interruption and usb communication interface, built-in usb interrupts, and interrupts Priority is from high to low.Wherein first timer interrupts and second timer interrupts belonging to timer module, and usb interrupts belonging to Usb communication interface modules.Interrupt occurring if there are first timer, then preferentially execute, calculate temperature value;If there are the second timing Device interrupts occurring, and does not have first timer to interrupt being responded, then execution second timer interrupts, and updates the number in ad array According to;Usb interrupt priority level minimum that is to say, that when not having first timer and second timer to interrupt occurring at the same time, just meeting The interruption of response usb, if main frame has order to send over, can enter usb communication interface modules, enter solution after receiving order Analysis program, judges main frame operation to be performed according to analysis result, if writing calibration data, then calls calibration module will calibrate Parameter read-in memorizer;If controlling the operation of analog board, then spi module is called analog board to be controlled operate, if Analog board has data to return, then call usb communication interface modules to return data to main frame again.
Above in conjunction with accompanying drawing, the specific embodiment of the present invention is described in detail, but the present invention has been not restricted to State embodiment, in the case of the spirit and scope without departing from claims hereof, those skilled in the art can make Go out various modifications or retrofit.

Claims (6)

1. a kind of power sensor data processing method is it is characterised in that comprise the following steps:
Step 1, initialization power sensor;
Step 2, judge whether first timer interrupts, if so, then execute first task, if it is not, then execution step 3;
Step 3, judge whether second timer interrupts, if so, then execute the second task, if it is not, then execution step 4;
Step 4, judge whether to receive Host Control Command, if then parsing to described control command, and according to parsing Result carries out corresponding data processing;
Step 5, the data after described data processing is returned to main frame.
2. power sensor data processing method according to claim 1 is it is characterised in that described first task is to calculate Compensation temperature value.
3. power sensor data processing method according to claim 1 is it is characterised in that described second task is to update Analog-digital converter array data.
If 4. power sensor data processing method according to claim 1 is it is characterised in that described Host Control Command For writing calibration data order, then described power sensor passes through calibration data described in usb interface, and by described calibration data In write memorizer.
If 5. power sensor data processing method according to claim 1 is it is characterised in that described Host Control Command For controlling analog board order, then described power sensor is controlled to described analog board by spi interface, and analog board is returned The data is activation returned is to described main frame.
6. a kind of power sensor data handling system is it is characterised in that include usb communication interface, spi communication interface, order Parsing module, command execution module, timer module, described timer module connects usb communication module, for when described power When sensor does not receive timer command, make the control command that described usb communication interface Receiving Host sends;Described usb communication Interface connects main frame and command analysis module, the control command sending for Receiving Host, and described control command is sent to Command analysis module, described command analysis module bind command performing module, for the order after execution parsing;Described order is held Row module is also connected with described spi communication interface, and described spi communication interface connects analog board, is resolved to main frame transmission for working as When controlling analog board order, by spi interface, described analog board is controlled.
CN201610918407.1A 2016-10-21 2016-10-21 Power sensor data processing method and system Active CN106353587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610918407.1A CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610918407.1A CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Publications (2)

Publication Number Publication Date
CN106353587A true CN106353587A (en) 2017-01-25
CN106353587B CN106353587B (en) 2020-06-09

Family

ID=57864861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610918407.1A Active CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Country Status (1)

Country Link
CN (1) CN106353587B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090327815A1 (en) * 2008-06-25 2009-12-31 Microsoft Corporation Process Reflection
CN101946241A (en) * 2008-02-14 2011-01-12 国际商业机器公司 Processing of data to monitor input/output operations
CN202267711U (en) * 2011-10-09 2012-06-06 绵阳市维博电子有限责任公司 Variable-frequency power sensor
CN104516780A (en) * 2013-09-30 2015-04-15 瑞萨电子株式会社 Data processing system
CN104637466A (en) * 2013-11-13 2015-05-20 三星电子株式会社 Timing controller, method of operating the same, and data processing system including the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101946241A (en) * 2008-02-14 2011-01-12 国际商业机器公司 Processing of data to monitor input/output operations
US20090327815A1 (en) * 2008-06-25 2009-12-31 Microsoft Corporation Process Reflection
CN202267711U (en) * 2011-10-09 2012-06-06 绵阳市维博电子有限责任公司 Variable-frequency power sensor
CN104516780A (en) * 2013-09-30 2015-04-15 瑞萨电子株式会社 Data processing system
CN104637466A (en) * 2013-11-13 2015-05-20 三星电子株式会社 Timing controller, method of operating the same, and data processing system including the same

Also Published As

Publication number Publication date
CN106353587B (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN105573743B (en) Chip burning system and method and electronic equipment
CN102546843B (en) A kind of method by the multiple UART communication interfaces of software simulated implementation
US20120198101A1 (en) Mobile device peripheral detection with independent state machines
CN102214132B (en) Method and device for debugging Loongson central processing unit (CPU), south bridge chip and north bridge chip
CN103853383B (en) A kind of method realizing touch-screen driving in Uboot
US20130282928A1 (en) Wireless adapter for connecting a computing device directly to a non-master peripheral device with legacy interface and method of use
EP3343530B1 (en) Infrared remote control apparatus and terminal
TWI689211B (en) System and method for testing data packet transceivers having varied performance characteristics and requirements using standard test equipment
CN103822667A (en) Temperature-humidity acquisition system based on Bluetooth technology
CN107466387A (en) A kind of method and device for detecting touch manner
CN202393878U (en) Testing system of radio frequency integrated circuit
CN114328212A (en) Vehicle driving simulation method, device, equipment and storage medium
CN106353587A (en) Method and system for processing data of power sensor
CN105404529A (en) Popup method, device and system of operation system popup for reinstallation
CN102043691B (en) Contactor control device and controller, method of testing and test macro
CN101998691B (en) Method, system and device for data transmission
CN106406154B (en) debugging system and control method thereof
CN109725621A (en) A kind of secondary bus program based on 1553B bus and CAN bus is in line writing method
TWI361351B (en) Testing system of universal serial bus device and method thereof
CN108008854B (en) Method, device and terminal equipment for avoiding antenna carrier interference
US11079903B2 (en) Method and system for quick selection by intelligent terminal, and intelligent terminal
JP2008175599A (en) Weighing apparatus
Sieczkowski et al. A method for real-time data acquisition using Matlab software
CN204188975U (en) A kind of clock system and counter
CN111651310B (en) Radio frequency debugging method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant