CN108519750A - A kind of digital regulation resistance long-range control method - Google Patents

A kind of digital regulation resistance long-range control method Download PDF

Info

Publication number
CN108519750A
CN108519750A CN201810271756.8A CN201810271756A CN108519750A CN 108519750 A CN108519750 A CN 108519750A CN 201810271756 A CN201810271756 A CN 201810271756A CN 108519750 A CN108519750 A CN 108519750A
Authority
CN
China
Prior art keywords
digital regulation
regulation resistance
data
development boards
stm32 development
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.)
Pending
Application number
CN201810271756.8A
Other languages
Chinese (zh)
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.)
Donghua University
National Dong Hwa University
Original Assignee
Donghua University
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 Donghua University filed Critical Donghua University
Priority to CN201810271756.8A priority Critical patent/CN108519750A/en
Publication of CN108519750A publication Critical patent/CN108519750A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The present invention relates to a kind of digital regulation resistance long-range control methods, it will be connected by way of serial communication between LabVIEW exploitation monitoring platforms and STM32 development boards, wherein, LabVIEW exploitation monitoring platforms are programmed by VISA interface modules, then turn serial port data line and STM32 development boards into row data communication by USB;It will be connected by I2C buses between STM32 development boards and digital regulation resistance, wherein power function is realized by the method for simulated timing diagrams, primary complete I2C communication process is completed further according to the specific communication specification binding function function of digital regulation resistance.The present invention can realize the flexible control to digital regulation resistance.

Description

A kind of digital regulation resistance long-range control method
Technical field
The present invention relates to digital regulation resistance remote control technology fields, more particularly to a kind of digital regulation resistance remote control Method.
Background technology
Digital regulation resistance is a kind of novel electronic device, is applied to instrument and meter, computer and communication apparatus, household The fields such as electric appliance, health care, Industry Control are also used in programmable analog device, personal digital assistant, global positioning system System, fiber laser arrays and control, in the circuits such as signal light control and various converters.Digital regulation resistance is mainly used in adjustable put Big device gain circuitry, for example, liquid crystal display show in contrast adjusting, the broadcasting etc. of digital multimedia.
Programmable digital regulation resistance can be connected with microcontroller by multiple interfaces circuit, microcontroller can read at any time and Current setting value is changed, using these advantages, the intelligent level of equipment and instrument can be improved, especially total with I2C Application in the embedded scm of line is very flexibly simple.In addition in combination with the exploitation software that can realize I2C communication protocols LabVIEW, to support the write operation of the equipment such as digital regulation resistance.The extensive utilization of digital regulation resistance can simplify circuit, reduce Cost improves reliability.
Traditional mechanical potentiometer controls the size of output resistance by way of adjusting manually, is equivalent to sliding variable resistance Device.Resistance body portion that mechanical potentiometer is determined by resistance value and sliding or rotating part are constituted, and by the sliding of convertible tip or are turned The dynamic size for continuously changing resistance value between convertible tip and fixing end.The most common application of potentiometer of this kind of early stage just has tradition Ceiling fan, the adjustable wall lamp of brightness or desk lamp, hereafter the civil field of the daily necessities such as flatiron is employed for TV again Machine, radio receiver, recorder, the fields such as space shuttle simulator.With the development of science and technology, market is to apparatus figure Change, the demand of miniaturization is increasingly promoted, and digital regulation resistance becomes the new focus of electronic industry circle instead of tradition machinery potentiometer.
LabVIEW is not only a fully functional Software Development Platform, while being also a kind of powerful programming language Speech.It is now widely used for instrument controlling, the fields such as data acquisition, data analysis and data shows, the people of close friend can be established Machine interactive interface provides the control object in many instrument panels.
Invention content
Technical problem to be solved by the invention is to provide a kind of digital regulation resistance long-range control methods, can realize logarithm The flexible control of word potentiometer.
The technical solution adopted by the present invention to solve the technical problems is:A kind of digital regulation resistance remote control method is provided Method will be connected between LabVIEW exploitation monitoring platforms and STM32 development boards by way of serial communication, wherein LabVIEW Exploitation monitoring platform is programmed by VISA interface modules, and then turn serial port data line by USB carries out with STM32 development boards Data communicate;It will be connected by I2C buses between STM32 development boards and digital regulation resistance, wherein pass through the method for simulated timing diagrams It realizes power function, primary complete I2C communications is completed further according to the specific communication specification binding function function of digital regulation resistance Process.
The LabVIEW exploitations monitoring platform is passed through control parameter value by the writing unit in VISA interface modules USB turns serial port data line and is transferred to STM32 development boards in real time, meanwhile, it is read simultaneously by the reading unit in VISA interface modules Show the data information of STM32 development boards feedback.
The STM32 development boards using serial ports interrupt mode complete LabVIEW exploitations monitoring platform and STM32 development boards it Between serial communication;STM32 development boards enter interrupt service routine after receiving data, and complete data in interrupting service function Operation and conversion, address judgement and I2C transmission operation.
The decimal data that control is arranged is converted into hexadecimal string number by the LabVIEW exploitations monitoring platform According to, hexadecimal string data are then converted into corresponding ASCII character character data, then be written VISA interface modules transmission Give STM32 development boards;After the serial ports interrupt function of STM32 development boards receives data, automatically ASCII character can be read as corresponding to Hexadecimal data, thus complete the equivalent transmission of data between the two.
The operation that the STM32 development boards complete data in interrupting service function is specially with conversion:STM32 development boards Decimal value is first converted to after receiving hexadecimal data, then calculates the resistance value that digital regulation resistance reaches the numerical requirements The analog switch serial number that should be closed;Then the number is converted to ten two of digital regulation resistance identification that is corresponding or closing on into Register value processed, for changing the resistance value of digital regulation resistance.
STM32 development boards address in interrupting service function, which is adjudicated, is specially:Judgement receives what data to be controlled Then digital regulation resistance address controls corresponding digital regulation resistance by way of I2C bus addressings.
The STM32 development boards generate the beginning of start signal indicator communication, and then STM32 development boards send a word First 7 of joint number evidence, a byte data are digital regulation resistance address, and the 8th is read-write position;STM32 development boards discharge SDA Bus waits for digital regulation resistance response, and after receiving digital regulation resistance response, STM32 development boards send a byte data again, First 2 of one byte data are 0, and intermediate 4 are command bit, and latter two data bit for front two, STM32 development boards are again It discharges SDA buses and waits for digital regulation resistance response, send a byte data again after receiving digital regulation resistance response, this one Byte data is latter eight of data bit;Last STM32 development boards send stop signal to terminate this time to communicate.
Advantageous effect
Due to the adoption of the above technical solution, compared with prior art, the present invention having the following advantages that and actively imitating Fruit:The present invention integrates the advantages of LabVIEW and digital regulation resistance, realizes that LabVIEW controls digital current potential using STM32 development boards The resistance value of device, and flexible and convenient operation, accuracy are high.The present invention not only flexibly can accurately control the resistance of numerical value potentiometer Value, can also improve the friendly of human-machine operation, to user preferably to experience.
Description of the drawings
Fig. 1 is the structure principle chart of the present invention;
Fig. 2 is the LabVIEW program flow diagrams of LabVIEW and STM32 serial communications of the present invention;
Fig. 3 is STM32 overall program flow diagrams of the present invention;
Fig. 4 is the program flow diagram of STM32 and digital regulation resistance I2C communications of the present invention.
Specific implementation mode
Present invention will be further explained below with reference to specific examples.It should be understood that these embodiments are merely to illustrate the present invention Rather than it limits the scope of the invention.In addition, it should also be understood that, after reading the content taught by the present invention, people in the art Member can make various changes or modifications the present invention, and such equivalent forms equally fall within the application the appended claims and limited Range.
Embodiments of the present invention are related to a kind of digital regulation resistance long-range control method, as shown in Figure 1, LabVIEW is opened It is connected by way of serial communication between hair monitoring platform and STM32 development boards, wherein it is logical that LabVIEW develops monitoring platform It crosses VISA interface modules to be programmed, serial port data line and STM32 development boards is then turned into row data communication by USB;It will It is connected by I2C buses between STM32 development boards and digital regulation resistance, wherein function letter is realized by the method for simulated timing diagrams Number completes primary complete I2C communication process further according to the specific communication specification binding function function of digital regulation resistance.
Whole process is to develop monitoring platform and STM32 development board strings by LabVIEW using STM32 development boards as bridge Port communications and STM32 development boards and digital regulation resistance I2C communications realize that LabVIEW develops monitoring platform to digital regulation resistance Remote control.Digital regulation resistance by taking AD5272 as an example, wherein:
LabVIEW develops the serial communication between monitoring platform and STM32 development boards.Monitoring platform is developed in LabVIEW Middle to be programmed using VISA interface modules, the baud rate of configuration " VISA configures serial ports VI " first is 115200, and data bit is 8, check bit 0, stop position is 1.
Then, the resistance value of digital regulation resistance is set by numerical value control, after the numerical value conversion to hexadecimal string Unsteady state operation is to ASCII character again.After adding head and the tail character, STM32 development boards are given by " VISA write-ins " function transfer.Here it needs It is to overcome in LabVIEW " VISA write-ins " it is noted that carrying out multiple data type conversion to the numerical value that control is arranged Character string type data are only written in function, and the interruption service function of STM32 development boards only receives the contradiction of hexadecimal data, To realize equivalent transmission between the two.Addition head and the tail character be in order to indicate the resistance value of different numerical value control settings, to Realize the control of multiple digital regulation resistances.Specific program flow diagram is as shown in Figure 2.
LabVIEW develops the serial communication between monitoring platform and STM32 development boards, using string in STM32 development boards Mouth interrupt mode is completed.The parameter of serial ports interrupt function is configured first, including baud rate is 115200, data bit 8, verification Position is 0, and stop position is 1.STM32 development boards enter interrupt service routine after receiving data, and complete in interrupting service function At sequence of operations such as the operation and conversion of data, address judgement and I2C transmission.It should be noted serial ports interrupt service routine Always the data of reception can be read as corresponding hexadecimal character data as ASCII character, then hexadecimal word one by one Symbol is read out.So the hexadecimal data received every time is stored in array.Decimal value is converted to, and calculates digital electricity Position device needs the analog switch serial number being closed.
The trailing character that reception data are judged in interrupt service routine, configures different digital regulation resistance addresses.It will need Corresponding digital regulation resistance is given in the analog switch serial number of closure and digital regulation resistance address by I2C bus transfers, realizes to more A digital regulation resistance is precisely controlled.Specific procedure flow chart is as shown in Figure 3.
I2C communications between STM32 development boards and digital regulation resistance, complete procedure are following (with digital regulation resistance For AD5272):Generating a start signal indicator communication by host (STM32), then host sends a byte number According to first 7 are slave (digital regulation resistance) address, and the 8th is read-write position (0 indicates to read, and 1 indicates to write).It is total that host discharges SDA Line waits for slave response, receive slave response host send again a byte data (first 2 are 0, intermediate 4 order of the bit positions, after Two are the first two data bit), host discharges SDA buses and waits for slave response again, receives slave response and sends one again A byte data (latter eight of data bit).Last host sends stop signal to terminate this time to communicate.Specific procedure flow chart As shown in Figure 4.
It is not difficult to find that the present invention not only can neatly control digital regulation resistance in real time by the LabVIEW platforms developed Resistance value, and may be implemented to be precisely controlled multiple digital regulation resistances.

Claims (7)

1. a kind of digital regulation resistance long-range control method, which is characterized in that develop LabVIEW exploitation monitoring platforms with STM32 It is connected by way of serial communication between plate, wherein LabVIEW exploitation monitoring platforms are compiled by VISA interface modules Then journey turns serial port data line and STM32 development boards into row data communication by USB;By STM32 development boards and digital regulation resistance Between be connected by I2C buses, wherein power function is realized by the methods of simulated timing diagrams, it is specific further according to digital regulation resistance Communication specification binding function function complete primary complete I2C communication process.
2. digital regulation resistance long-range control method according to claim 1, which is characterized in that the LabVIEW exploitations are surveyed Control parameter value is turned serial port data line by USB by the writing unit in VISA interface modules and is transferred in real time by control platform STM32 development boards, meanwhile, read by the reading unit in VISA interface modules and shown the data letter of STM32 development boards feedback Breath.
3. digital regulation resistance long-range control method according to claim 1, which is characterized in that the STM32 development boards are adopted The serial communication between LabVIEW exploitation monitoring platforms and STM32 development boards is completed with serial ports interrupt mode;STM32 development boards Enter interrupt service routine after receiving data, and complete operation and the conversion of data in interrupting service function, address is adjudicated and The operation of I2C transmission.
4. digital regulation resistance long-range control method according to claim 3, which is characterized in that the LabVIEW exploitations are surveyed The decimal data that control is arranged is converted into hexadecimal string data by control platform, then by hexadecimal string data Corresponding ASCII character character data is converted to, then VISA interface modules are written and are transferred to STM32 development boards;STM32 development boards Both after serial ports interrupt function receives data, can ASCII character be read as corresponding hexadecimal data automatically, thus complete Between data equivalent transmission.
5. digital regulation resistance long-range control method according to claim 3, which is characterized in that the STM32 development boards exist Interrupt service function in complete data operation be specially with conversion:STM32 development boards first turn after receiving hexadecimal data It is changed to decimal value, digital regulation resistance is then calculated and reaches the analog switch serial number that the resistance value of the numerical requirements should be closed; Ten binary register values that the number is then converted to digital regulation resistance identification that is corresponding or closing on, for changing number The resistance value of potentiometer.
6. digital regulation resistance long-range control method according to claim 3, which is characterized in that the STM32 development boards exist Interrupting address judgement in service function is specially:Judgement receives the data digital regulation resistance address to be controlled, and then passes through I2C The mode of bus addressing controls corresponding digital regulation resistance.
7. digital regulation resistance long-range control method according to claim 1, which is characterized in that the STM32 development boards production The beginning of start signal indicator communication is given birth to, then one byte data of STM32 development boards transmission, preceding the 7 of a byte data Position is digital regulation resistance address, and the 8th is read-write position;STM32 development boards discharge SDA buses and wait for digital regulation resistance response, connect After receiving digital regulation resistance response, STM32 development boards send a byte data again, and first 2 of a byte data are 0, in Between 4 be command bit, latter two be front two data bit, STM32 development boards discharge again SDA buses wait for digital regulation resistance Response sends a byte data again after receiving digital regulation resistance response, which is latter eight of data bit; Last STM32 development boards send stop signal to terminate this time to communicate.
CN201810271756.8A 2018-03-29 2018-03-29 A kind of digital regulation resistance long-range control method Pending CN108519750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810271756.8A CN108519750A (en) 2018-03-29 2018-03-29 A kind of digital regulation resistance long-range control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810271756.8A CN108519750A (en) 2018-03-29 2018-03-29 A kind of digital regulation resistance long-range control method

Publications (1)

Publication Number Publication Date
CN108519750A true CN108519750A (en) 2018-09-11

Family

ID=63431242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810271756.8A Pending CN108519750A (en) 2018-03-29 2018-03-29 A kind of digital regulation resistance long-range control method

Country Status (1)

Country Link
CN (1) CN108519750A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296019A (en) * 2021-12-19 2022-04-08 宁波泰丰源电气有限公司 Temperature compensation structure of direct current sensor

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106197654A (en) * 2016-07-14 2016-12-07 中国地质大学(北京) A kind of debris flow infrasound monitoring system and method based on GPRS communication
CN107664967A (en) * 2016-07-29 2018-02-06 河南理工大学 Flight parameter signal generating system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106197654A (en) * 2016-07-14 2016-12-07 中国地质大学(北京) A kind of debris flow infrasound monitoring system and method based on GPRS communication
CN107664967A (en) * 2016-07-29 2018-02-06 河南理工大学 Flight parameter signal generating system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张志强: "双向DC_DC变换器的设计与研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *
邓正泉: "超声复合电加工在线测控系统设计及试验研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296019A (en) * 2021-12-19 2022-04-08 宁波泰丰源电气有限公司 Temperature compensation structure of direct current sensor

Similar Documents

Publication Publication Date Title
CN104698950A (en) Peripheral device control method, microcontroller, upper computer and system
CN108519750A (en) A kind of digital regulation resistance long-range control method
CN201134187Y (en) Modularized laboratory box of micro-controller
CN102567270A (en) USB (universal serial bus)-to-I2C (inter-integrated circuit) adapter
CN209044993U (en) Single-chip microcontroller insertion slot type expansion board and multimode external member for computer programming teaching
CN104240558A (en) Embedded-technology training system and training method thereof
CN106910401A (en) A kind of multifunctional virtual electronic instrument
CN100533424C (en) Single line transmission interface and single byte operational keyboard display module
CN107807558B (en) Multi-bus communication board card circuit based on PCI9054 and control method
CN108534819A (en) A kind of constant current or constant pressure sensor analog system and method
CN203165315U (en) Single chip microcomputer learning experimental device
CN206210220U (en) A kind of multifunctional virtual electronic instrument
CN111338753B (en) System for realizing hardware simulation of electronic control unit based on computer
CN102074150A (en) Sentence and speech conversion device for the deaf to communicate with outside world
CN204695645U (en) EDA Instructional Development experimental box
CN107577574B (en) Debugging switching circuit and debugging circuit board
CN110796939A (en) Programming learning development board with unified extended interface
CN100547561C (en) Computer universal serial bus interface device time-limited timing controller
CN100451905C (en) Programmable controller for temperature and humidity
CN102436772B (en) Voltage-frequency converter controlled by single chip computer and experimental box provided with module
CN205619837U (en) Whole bullet electricity performance simulation testing arrangement of gun -launched missile
CN209729226U (en) A kind of multi-functional element circuit intelligent measurement maintenance training system
CN107992028A (en) Avionics general purpose test equipment debugging box
CN103412845B (en) A kind of serial bus system
CN112714025A (en) Optical module code writing board and control method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180911