CN107168172B - Switching value acquisition device based on CPLD - Google Patents

Switching value acquisition device based on CPLD Download PDF

Info

Publication number
CN107168172B
CN107168172B CN201710429776.9A CN201710429776A CN107168172B CN 107168172 B CN107168172 B CN 107168172B CN 201710429776 A CN201710429776 A CN 201710429776A CN 107168172 B CN107168172 B CN 107168172B
Authority
CN
China
Prior art keywords
cpld
switching value
signal
cpu
transceiver
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.)
Active
Application number
CN201710429776.9A
Other languages
Chinese (zh)
Other versions
CN107168172A (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.)
Beijing Danhua Haobo Power Science And Technology Co ltd
Original Assignee
Beijing Danhua Haobo Power Science And Technology 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 Beijing Danhua Haobo Power Science And Technology Co ltd filed Critical Beijing Danhua Haobo Power Science And Technology Co ltd
Priority to CN201710429776.9A priority Critical patent/CN107168172B/en
Publication of CN107168172A publication Critical patent/CN107168172A/en
Application granted granted Critical
Publication of CN107168172B publication Critical patent/CN107168172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/21Pc I-O input output
    • G05B2219/21071Configuration, each module has a settable address, code wheel, encoder

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)
  • Selective Calling Equipment (AREA)

Abstract

A switching value acquisition device based on a CPLD technology comprises a switching value input, a photoelectric coupler, a bus driver, a CPLD, a CPU, an RS232 transceiver and an RS485 transceiver; the input end of the photoelectric coupler is connected to the switching value input terminal, and the input end of the bus driver is connected to the output end of the photoelectric coupler; the output end of the bus driver is connected to the input end of the CPLD; the CPLD is connected to the CPU through parallel buses (data bus DB [15:0], address bus AD [25:23], nRD read enable signal, nCS0 chip select signal). The CPU realizes RS232 and RS485 communication through integrating the UART0 and the UART1 and transmits switching value data information to the host, and the switching value sampling device can be used for collecting switching value signals of electric automation equipment and providing high-reliability real-time data collection for realizing automation functions of power equipment. The invention has mature technology and high reliability.

Description

Switching value acquisition device based on CPLD
Technical Field
The invention relates to the technical field of electric power, is mainly used for collecting switching value signals of electric automation equipment and is a common device of the electric automation equipment.
Background
For the field of power automation, multi-way switching value acquisition is often performed. The signal direct transmission method uses the existence or nonexistence of a signal to represent the validity and invalidity of the signal. This approach has a significant disadvantage: when the signal path is interrupted, the receiving end of the signal cannot determine the state of the signal. And the complex programmable logic device CPLD can conveniently realize the wired real-time data transmission with high reliability. At a sending end, data to be transmitted is coded by a CPU and then sent by wired networks such as optical fibers, cables and the like; at the receiving end, the signal after passing through the front end receiving and adjusting circuit is sent to the CPLD, decoded by the decoding circuit and then output to the CPU. The decoding circuit also filters the received data to filter burrs, thereby ensuring the output data to be real and reliable.
In order to be compatible with the electric automation equipment better, the switching value signal sampling control panel based on the CPLD technology is adopted, so that the capacity expansion requirement of the equipment can be well met.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a switching value acquisition device based on a CPLD (complex programmable logic device) to fill the blank of the related technical fields at home and abroad.
The technical scheme of the invention is as follows:
a switching value acquisition device based on a CPLD comprises a plurality of switching value input ends, a plurality of photoelectric couplers, a plurality of bus drivers corresponding to the photoelectric couplers, the CPLD, a CPU, an RS232 transceiver and an RS485 transceiver; it is characterized in that:
each photoelectric coupler obtains a switching value on-off signal from a switching value input end correspondingly connected with the photoelectric coupler, converts the switching value on-off signal into a 5V level signal and sends the 5V level signal to a bus driver correspondingly connected with the photoelectric coupler;
each bus driver obtains the converted 5V level signal from the corresponding photoelectric coupler, converts the 5V level signal into a 3.3V level signal and sends the 3.3V level signal to the CPLD;
the CPLD receives the 3.3V level signals sent by each bus driver, converts each level signal into binary switching value data information, and then stores the switching value data information into a register of the CPLD;
the CPU reads the switching data information from the CPLD into the CPU through parallel buses (a data bus DB [15:0], an address bus AD [25:23], nRD read enable signals and an nCS0 chip select signal).
The CPU outputs switching data information at CMOS level through the integrated UART0, and then converts the CMOS level into RS232 level signal through the RS232 transceiver connected with the CPU, and transmits the switching data information to the host. The host decodes the received binary data information to generate switching value data information.
The CPU outputs switching data information in a CMOS level through the integrated UART1, then converts the CMOS level into an RS485 differential signal through an RS485 transceiver connected with the CMOS level, and transmits the switching data information to a host.
The invention further comprises the following preferred embodiments:
the photoelectric coupler converts the switching value on-off signal into a 5V level signal, and converts the 5V level signal into a 3.3V level signal through a bus driver to be connected to the CPLD.
The CPU reads data information in the CPLD through a 16-bit parallel bus (a data bus DB [15:0], an address bus AD [25:23], an nRD read enable signal and an nCS0 chip selection signal).
The invention has the following technical effects:
1. the switching value signal acquisition device based on the CPLD adopts an RS485 or RS232 communication mode, can realize high-reliability wired real-time data transmission, and has the advantages of good real-time performance, high controllability and flexible organization. The space and the cost of the PCB can be effectively saved.
2. The board card adopts a plug-in structure.
3. The switching value signal acquisition device based on the CPLD is very convenient for the capacity expansion of the electric automation equipment, each sampling control board can be expanded by 80 paths at most, and only the sampling control board is added when the sampling control board exceeds 80 paths.
Drawings
The abstract attached drawing is a structural schematic diagram of the switching value acquisition device based on the CPLD;
fig. 1 is a block diagram of the switching value acquisition device based on the CPLD of the present invention.
Fig. 2 is a diagram of a data transmission model.
Fig. 3 is a schematic diagram of an RS232 transceiver.
Fig. 4 is a schematic diagram of an RS485 transceiver.
Fig. 5 is a diagram of a switching value acquisition front-end circuit.
Fig. 6 is a timing diagram of data access between the CPU and the CPLD.
Wherein U1, U20 represents 20 inverter inverters; U21-U30 are voltage converter chips; u31 is CPLD, U32 is CPU controller, U33 is RS232 transceiver, U34 is RS485 transceiver.
Detailed Description
The technical scheme of the invention is further explained in detail by specific examples in the following with the specification and the drawings.
The invention provides a switching value signal sampling control panel based on a CPLD technology. The working principle of the sampling control board is as follows: the input end of the NOT gate is changed into a 0-5V level signal from a switching device and a photoelectric coupler at the front end, a voltage signal is obtained through RC filtering and a pull-down resistor, the NOT gate inverts the signal, the digital quantity signal is changed into a 0-3.3V level signal after overvoltage transformation, the digital signal of each channel is decoded and filtered through a CPLD, the NOT gate is communicated with a CPU through a parallel bus, the CPU is encoded through an RS232 transceiver and an RS485 transceiver, high-reliability wired real-time data transmission is achieved, and therefore the collection of switching value information is achieved.
The sampling plate consists of a NOT gate, a voltage converter, a CPLD, a CPU, an RS485 transceiver and an RS232 transceiver, and all components are welded on a PCB.
The sampling plate is based on the principle shown in FIG. 1, including NOT gates U1-U20, voltage converters U21-U30, CPLD chip U31, CPU chip U32, RS232 transceiver U33 and RS485 transceiver U34. U1-U20-U21-U30 show that the digital level signal of 0- +5V is inverted and changed into a digital level signal between 0 and +3.3V, the CPLD decodes and filters each path of digital signal, the CPU reads the switching value signal data from the CPLD through a data bus, and the CPU encodes the switching value signal data through RS485 and RS232 and sends out the data, so that the high-reliability wired real-time data transmission is achieved, and the acquisition of the switching value information is realized.
The data transmission model is as shown in fig. 2, the switching value signal data processed by the voltage converter is connected with the CPLD chip in a parallel data transmission mode, decoded and filtered by the CPLD chip, then connected with the CPU in a parallel data transmission mode, and encoded by the CPU and transmitted in a serial data mode through the RS232 transceiver and the RS485 transceiver, thereby realizing high-reliability wired real-time data transmission.
The RS232 transceiver is schematically shown in fig. 3, and has a function of converting a CMOS level signal output by the CPU into an RS232 level signal, enabling it to communicate with an upper computer (or a main control board), and realizing reliable acquisition of switching value signal data through serial data communication.
The RS485 transceiver is schematically shown in fig. 4, and has a function of converting a CMOS level signal output by the CPU into an RS485 differential signal, so that the RS485 differential signal can communicate with an upper computer (or a main control board), and the transmission of differential data enhances the anti-interference performance of the signal, increases the transmission distance, and thus realizes reliable transmission and acquisition of switching value signal data.
The switching value acquisition front-end circuit is shown in fig. 5, and has the main functions of hardware isolation and filtering, a TLP521 optical coupling isolation chip isolates a system from the outside, and the isolated system passes through a filter circuit composed of a resistor and a capacitor and then is connected to a sampling control panel. Through the optical coupling filtering front-end circuit, the common mode and differential mode interference resistance of the system is greatly enhanced, and surge pulse group interference can be effectively inhibited.
The time sequence between the CPU and the CPLD is shown in figure 6, the CPLD is accessed as a memory, when the CPU collects switching value signals, the CPU sends out a chip selection nCS0, an address signal A25-A23 and a read enable nRD signal through a program instruction, the address information of the CPLD memory is output to the AD [25:23], the nCS0 is enabled to be in a low level, after the signal is established and stabilized, a read signal is sent out (pulled down through nRD), then the CPLD reads the corresponding open port data of the address bus and outputs the port data to the data bus DB [15:0], after the CPU reads the switching value data, nRD is pulled up, after the reading is finished, the chip selection and the address signal (the nCS0 is set high, and the AD [25:23] is set to be high resistance), and one-time signal reading is finished.
While the best mode for carrying out the invention has been described in detail and illustrated in the accompanying drawings, it is to be understood that the same is by way of illustration and example only and is not to be taken by way of limitation, the scope of the invention should be determined by the appended claims and any changes or modifications which fall within the true spirit and scope of the invention should be construed as broadly described herein.

Claims (1)

1. A switching value acquisition device based on a CPLD comprises a plurality of switching value input ends, a plurality of photoelectric couplers, a plurality of bus drivers corresponding to the photoelectric couplers, the CPLD, a CPU, an RS232 transceiver and an RS485 transceiver; it is characterized in that:
the NOT gate, the voltage converter, the CPLD, the CPU, the RS485 transceiver and the RS232 transceiver are welded on a PCB;
the on-off signals of every four paths of switching values are connected with the input end of a NOT gate, and the output ends of two NOT gates are connected with the input end of a voltage converter;
each photoelectric coupler obtains a switching signal of the switching value from a switching value input end correspondingly connected with the photoelectric coupler, converts the switching signal into a 5V level signal, obtains a voltage signal through RC filtering and a pull-down resistor, inverts the signal by a NOT gate and inputs the inverted signal into a voltage converter, and the inverted signal is converted into a digital level signal between 0 and +3.3V by the voltage converter and then is sent into the CPLD;
the CPLD receives the digital level signals sent by each voltage converter, decodes and filters each path of digital signals, converts each digital level signal into binary switching value data information, and then stores the switching value data information into a register of the CPLD;
the CPU reads the switching value data information from the CPLD into the CPU through a parallel bus;
the CPU outputs switching value data information in a CMOS level through an integrated serial port UART0, then the CMOS level is converted into an RS232 level signal through an RS232 transceiver connected with a serial port UART0, the switching value data information is transmitted to a host, and the host decodes the received binary data information to generate the switching value data information;
the CPU outputs switching data information in a CMOS level through an integrated serial port UART1, then converts the CMOS level into an RS485 differential signal through an RS485 transceiver connected with a serial port UART1, and transmits the switching data information to a host;
switching value signal data processed by the voltage converter are connected with the CPLD chip in a parallel data transmission mode, decoded and filtered by the CPLD chip, then connected with the CPU in a parallel data transmission mode, and sent out in a serial data mode through the RS232 transceiver and the RS485 transceiver after being coded by the CPU;
the parallel bus between the CPU and the CPLD comprises a data bus DB [15:0], an address bus AD [25:23], an nRD read enable signal line and an nCS0 chip selection signal line;
the CPLD is accessed as a memory, when the CPU collects switching value signals, the CPU sends out a chip selection nCS0, an address signal A25-A23 and a read enable nRD signal through a program instruction, the address information of the CPLD memory is output to the AD [25:23], the nCS0 becomes low level, after the signals are established and stabilized, a read signal is sent out to pull down nRD, then the CPLD reads the data of an open-ended port corresponding to an address bus and outputs the port data to a data bus DB [15:0], after the CPU reads the switching value data, nRD is pulled up, after the reading is finished, the nCS0 is put high, the AD [25:23] is put high resistance, and the signal reading is finished for one time.
CN201710429776.9A 2017-06-09 2017-06-09 Switching value acquisition device based on CPLD Active CN107168172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710429776.9A CN107168172B (en) 2017-06-09 2017-06-09 Switching value acquisition device based on CPLD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710429776.9A CN107168172B (en) 2017-06-09 2017-06-09 Switching value acquisition device based on CPLD

Publications (2)

Publication Number Publication Date
CN107168172A CN107168172A (en) 2017-09-15
CN107168172B true CN107168172B (en) 2020-06-30

Family

ID=59825006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710429776.9A Active CN107168172B (en) 2017-06-09 2017-06-09 Switching value acquisition device based on CPLD

Country Status (1)

Country Link
CN (1) CN107168172B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2561527Y (en) * 2002-07-25 2003-07-23 邯郸钢铁股份有限公司 Online rolling comprehensive parameters measuring instrument for medium plate mills
CN104460386A (en) * 2013-09-14 2015-03-25 刘铮 Multipath switching value control system based on CPLD device
CN105807686A (en) * 2016-04-05 2016-07-27 中国船舶重工集团公司第七〇二研究所 General isolating type on-off input and output module
CN205862149U (en) * 2016-05-18 2017-01-04 南京丹华昊博电力科技有限公司 On-off signal signal acquiring board based on synchronous serial bus technology
CN106787200A (en) * 2016-12-30 2017-05-31 国网浙江省电力公司绍兴供电公司 30 degree of phase angle difference distribution lines do not have a power failure and turn to close solution loop device for system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100365912C (en) * 2006-03-16 2008-01-30 江苏金智科技股份有限公司 Automatic input device and control method for emergency power supply of bus for middle-low voltage section factory
CN102087334B (en) * 2009-12-04 2013-01-16 北京广利核***工程有限公司 High-reliability digital quantity acquisition system
CN103176037B (en) * 2013-02-20 2016-07-06 国网智能电网研究院 A kind of alternating-current signal acquisition board for flexible alternating-current transmission device
CN203366045U (en) * 2013-07-03 2013-12-25 山东科技大学 A digital quantity input-output device based on a CAN bus
CN206178380U (en) * 2016-08-31 2017-05-17 北京德威特继保自动化科技股份有限公司 Switching value acquisition circuit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2561527Y (en) * 2002-07-25 2003-07-23 邯郸钢铁股份有限公司 Online rolling comprehensive parameters measuring instrument for medium plate mills
CN104460386A (en) * 2013-09-14 2015-03-25 刘铮 Multipath switching value control system based on CPLD device
CN105807686A (en) * 2016-04-05 2016-07-27 中国船舶重工集团公司第七〇二研究所 General isolating type on-off input and output module
CN205862149U (en) * 2016-05-18 2017-01-04 南京丹华昊博电力科技有限公司 On-off signal signal acquiring board based on synchronous serial bus technology
CN106787200A (en) * 2016-12-30 2017-05-31 国网浙江省电力公司绍兴供电公司 30 degree of phase angle difference distribution lines do not have a power failure and turn to close solution loop device for system

Also Published As

Publication number Publication date
CN107168172A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN201434881Y (en) RS485 interface circuit and electric energy meter employing same
CN102619501B (en) A kind of data transmission system in oil logging tool
CN103294629B (en) A kind of interface conversion circuit and device
CN205160512U (en) RS485 circuit and metering device who makes with this circuit
CN107168172B (en) Switching value acquisition device based on CPLD
CN208656767U (en) A kind of intelligent monitor system
CN203301498U (en) Redundant communication circuit based on RS485 serial interface
CN101290607B (en) Chip debugging interface device
CN204465545U (en) A kind of based on monolithic processor controlled communication system
CN210693974U (en) Bridge monitoring sensor system based on Can bus
CN201569170U (en) Communication system of gas water heater with function of stagger joint and remedy
CN203708240U (en) RF-485 signal converter
CN207397479U (en) Improved RS-485S transmission circuits
CN101568021A (en) Decoder for up the coax
CN206149237U (en) Multichannel differential signal changes TTL level signal's conversion and protection system
CN221042892U (en) Digital bus communication equipment
CN220605934U (en) Integrated intelligent internet of things host
CN208521163U (en) Multi-serial port Service Circuit based on Cortex-A7 framework
CN203812009U (en) Instrument communication serial port multiplex control device
CN213454127U (en) Air conditioner monitoring circuit and air conditioner
CN207851806U (en) Anti-interference type RS485 circuits
CN220492963U (en) CP signal stoping filter circuit and new energy automobile control system
CN219697667U (en) FlexRay bus communication module based on FPGA
CN216526793U (en) Data acquisition system for big data
CN202103482U (en) Intelligent controller used for circuit breaker

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
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: CPLD based switch value acquisition device

Effective date of registration: 20230906

Granted publication date: 20200630

Pledgee: Zhongguancun Branch of Bank of Beijing Co.,Ltd.

Pledgor: BEIJING DANHUA HAOBO POWER SCIENCE AND TECHNOLOGY CO.,LTD.

Registration number: Y2023110000375