CN111831597B - GPIB control system and method based on PRU in gateway of Internet of things - Google Patents

GPIB control system and method based on PRU in gateway of Internet of things Download PDF

Info

Publication number
CN111831597B
CN111831597B CN202010514347.3A CN202010514347A CN111831597B CN 111831597 B CN111831597 B CN 111831597B CN 202010514347 A CN202010514347 A CN 202010514347A CN 111831597 B CN111831597 B CN 111831597B
Authority
CN
China
Prior art keywords
gpib
pru
data
internet
address
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
CN202010514347.3A
Other languages
Chinese (zh)
Other versions
CN111831597A (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 Wanchuang Technology Co ltd
Original Assignee
Chengdu Wanchuang 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 Chengdu Wanchuang Technology Co ltd filed Critical Chengdu Wanchuang Technology Co ltd
Priority to CN202010514347.3A priority Critical patent/CN111831597B/en
Publication of CN111831597A publication Critical patent/CN111831597A/en
Application granted granted Critical
Publication of CN111831597B publication Critical patent/CN111831597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/36Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/362Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a GPIB control system and method based on a PRU in an Internet of things gateway, wherein a GPIB control scheme is realized by using a programmable real-time unit (PRU) of a CPU of the Internet of things gateway to realize GPIB data monitoring and acquisition, devices such as an MCU (microprogrammed control Unit) and the like are not required to be added, and the main control logic is in a software part, so that the defects of complex hardware connection, high cost, complex software part realization logic and reduction of connectable equipment caused by USB or RS232 occupation existing in the prior art introduced into the Internet of things gateway are overcome, and meanwhile, the purpose of saving cost can be achieved.

Description

GPIB control system and method based on PRU in gateway of Internet of things
Technical Field
The invention relates to an Internet of things gateway, in particular to a GPIB control system and method based on a PRU in the Internet of things gateway.
Background
In the GPIB standard interface bus system, there are at least three kinds of devices, namely, speaker, listener and controller, for effective communication.
The speaker is an instrument device (such as a measuring instrument, a data acquisition unit, a computer and the like) which sends instrument messages through a bus, and in a GPIB system, a plurality of speakers can be arranged, but only one speaker can play a role at a certain moment.
The listener is a device (such as a printer, a signal source, etc.) that receives a message sent from a speaker via a bus, and in a GPIB system, a plurality of listeners can be provided and allowed to operate simultaneously.
The masters are organizers and controllers in the data transfer process, for example, addressing other devices or allowing a "speaker" to use a bus, etc. The existing scheme for realizing the GPIB controller comprises the following steps: ISA, PCI or PCMCIA card is installed in PC; a serial port is converted into a GPIB controller; USB to GPIB controller; and the network port is converted into a GPIB controller.
The existing scheme for realizing GPIB control is realized by a USB, an RS232 or a CPLD and the like, the core of the controllers is a singlechip MCU, one end of the singlechip MCU is connected with a RS232 serial port of a computer, the other end of the singlechip is connected with a GPIB interface of an instrument, and the singlechip receives an SCPI instruction from a computer super terminal and forwards the SCPI instruction to the instrument with the GPIB interface for execution. And after the instrument executes the completion instruction, the execution result is sent to the controller, and the controller transmits the received data to the computer through the serial port. However, in the gateway of the internet of things, to support the GPIB function, it is obviously not applicable to add these schemes directly, for the following reasons:
first, the complexity of the hardware connections is increased and the cost of implementation is much higher;
second, the software part implementation logic is very complex;
thirdly, the USB or RS232 are common resources, and after the occupation, the number of the peripherals which can be connected with the gateway is reduced.
Disclosure of Invention
The invention aims to overcome the defects of complex hardware connection, high cost, complex logic realization of a software part and reduction of external equipment caused by occupation of a USB or RS232 in the prior art, provides a GPIB control system and a GPIB control method based on a PRU in an Internet of things gateway, can realize GPIB control without adding devices such as an MCU and the like, and can achieve the purpose of saving cost.
In order to achieve the above purpose, the invention provides the following technical scheme:
a GPIB control system based on PRU in thing networking gateway includes:
the Internet of things gateway is connected with the GPIB equipment through the GPIB bus;
the internet of things gateway comprises a PRU, a GPIB pin protection circuit and a GPIB connector, wherein the GPIB pin protection circuit is arranged between the PRU and the GPIB connector, and the internet of things gateway is connected to a GPIB field bus through the GPIB connector.
The invention uses the programmable real-time unit (PRU) of the gateway CPU of the Internet of things to realize the GPIB control scheme so as to realize the monitoring and acquisition of GPIB data, does not need to increase devices such as a MCU (single chip microcomputer), and the like, has main control logic in a software part, overcomes the defects of complex hardware connection, high cost, complex logic realization of the software part and reduction of connectable equipment caused by USB or RS232 occupation existing in the prior art introduced into the gateway of the Internet of things, and can well achieve the purpose of saving cost.
Preferably, the PRU provides 32 pins externally, and the GPIB connector has 24 pins.
A GPIB control method based on PRU in an internet of things gateway, the GPIB control method using the GPIB control system according to any one of claims 1 to 2, the GPIB control method comprising:
in a PRU firmware layer, the function of converting PRU to GPIB is realized, the level of all pins of the corresponding GPIB is converted into binary data, and the binary data is read into an RAM (random access memory) of the PRU;
controlling the state of the PRU to carry out initialization, operation, reset, stop and clear RAM operations in a driving layer; importing data received by an ATN pin and 8 data IO pins of GPIB in the binary data into a cache of an application layer, and simultaneously adding a time stamp to the imported data for recording;
reading the cache data in the cache at an application layer, and performing data combination and analysis; and setting the address of the listener to be monitored corresponding to the cache data.
Preferably, the PRU firmware layer: and editing codes by using assembly language, realizing a function mechanism of pins connected with the PRU into GPIBs, converting the levels of all the pins of the corresponding GPIBs into binary data, reading the binary data into an RAM (random access memory) of the PRU, and finally compiling the codes after the logic is completed into firmware.
Preferably, the driving layer includes:
controlling the state of the PRU to carry out operations of initialization, operation, reset, stop and RAM clearance;
importing the firmware into a PRU;
and the driving layer leads the ATN pin of the GPIB and the data of 8 data IO lines into a cache of an application layer, and simultaneously records the timestamp of the data monitored.
Preferably, the application layer reads the data in the cache:
when the ATN pin is at a low level, the data on the 8 data IO lines are 8-bit addresses;
when the ATN pin is at high level, the data on the 8 data IO lines is a GPIB control command, and the GPIB control command is directly read and checked against an ASCII table.
Preferably, the 8-bit address on the 8 data lines is:
where 5 bits are the GPIB address of the effective address range 0 to 31, 2 bits are the type of the GPIB address, and the last 1 bit is 0.
Preferably, the types of the GPIB address include a general purpose controller command, a master-listen address, a master-talk address, and a second address.
Preferably, the application layer further includes functionality to add generic command filtering to the IEEE488 protocol.
Compared with the prior art, the invention has the beneficial effects that: according to the GPIB control system and method based on the PRU in the gateway of the Internet of things, a GPIB control scheme is realized by using the programmable real-time unit (PRU) of the CPU of the gateway of the Internet of things, GPIB data monitoring and acquisition are realized, devices such as an MCU (single chip microcomputer) and the like do not need to be added, the main control logic is in a software part, and the defects that hardware connection is complex, cost is high, the realization logic of the software part is complex, and USB or RS232 occupation causes reduction of connectable equipment in the prior art are overcome.
Description of the drawings:
fig. 1 is a schematic diagram of on-site wiring of an internet of things gateway.
Fig. 2 is a schematic diagram of an internal hardware structure of the internet of things gateway.
FIG. 3 is a flow diagram of the application layer, driver layer and PRU layer of the system.
Detailed Description
The present invention will be described in further detail with reference to test examples and specific embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.
According to the IEEE488 protocol, the Internet of things gateway is wired on site as shown in figure 1, a total number of 31 devices can be connected to a GPIB bus, the Internet of things gateway is connected to the bus through a GPIB communication cable, information is obtained from a GPIB male connector, and then analysis is carried out.
An internal hardware structure of the internet of things gateway is shown in fig. 2, a programmable logic unit provides 32 pins outwards, one of GPIB standard connectors has 24 pins, and a protection device is added in the middle of pin connection.
As shown in fig. 3, the GPIB control system software portion includes a PRU firmware layer, a driver layer, and an application layer;
1. PRU firmware layer: and editing codes by using assembly language, realizing a function mechanism of the pins connected with the programmable real-time unit into GPIB, converting the level of all the pins of the corresponding GPIB into binary data, and reading the binary data into a Random Access Memory (RAM) of the PRU. After the logic of the part is finished, the code is finally compiled into firmware;
2. a driving layer:
the following functions should be accomplished
a, controlling the state initialization, operation, reset, stop and RAM clearance of the PRU;
b, importing the assembled firmware into the PRU;
c according to the analysis of the IEEE488 protocol, to realize the monitoring and the collection of GPIB data, attention needs to be paid to data on eight data lines DIO1-DIO8 and ATN. The driving layer needs to finish importing the ATN pin of the GPIB and the values of 8 data IO lines into a cache accessible by the application layer, and meanwhile, the timestamp record of the data is monitored;
3. an application layer: reading data in the cache, and performing data combination and analysis;
when the ATN is low level, addresses are on 8 data lines, and the specific definition is defined according to the address of the table I;
when the ATN is at a high level, GPIB control commands are arranged on 8 data lines, and the GPIB control commands can be directly read and checked by contrasting an ASCII table;
watch 1
Figure GDA0002856830620000061
According to the IEEE488 protocol, communication needs to be firstly set with an address, according to the principle, we can monitor which address GPIB data is or GPIB equipment, which data is interacted when the communication occurs, and can accurately record the time stamp of occurrence of the GPIB communication.
The application layer implements the following functions:
setting the address of a listener to be monitored;
add the function of filtering the generic commands of the IEEE488 protocol, such as "# IDN? "," + CLS "," # OPC? "," + RCL "," + SAV ","? "," TRG "," TST? "and the like.
The existing solutions for implementing GPIB control are implemented through USB, RS232 or CPLD, etc., and all the existing solutions require an MCU, and the solutions are directly added into the Internet of things gateway and obviously are not applicable, firstly, the complexity of hardware connection is increased, and the implementation cost is much higher; second, the software part implementation logic is very complex. And the USB or the RS232 belong to common resources, and after the USB or the RS232 is occupied, the number of peripherals which can be connected with the gateway is reduced. In the GPIB control system and method based on the PRU in the gateway of the internet of things, a GPIB control scheme is realized by using a programmable real-time unit (PRU) of a CPU of the gateway of the internet of things, so that the monitoring and acquisition of GPIB data are realized, devices such as an MCU (microprogrammed control Unit) and the like are not required to be added, the main control logic is in a software part, and meanwhile, the aim of saving cost can be achieved.

Claims (7)

1. A GPIB control method based on a PRU in an Internet of things gateway is characterized by comprising the following steps:
in a PRU firmware layer, editing codes by using assembly language, realizing a function mechanism of pins connected with a PRU into GPIBs, converting the level of all the pins of the corresponding GPIBs into binary data, reading the binary data into an RAM (random access memory) of the PRU, and finally compiling the codes after logic completion into firmware;
in the drive layer, comprising: controlling the state of the PRU to carry out operations of initialization, operation, reset, stop and RAM clearance; importing the firmware into a PRU; the driving layer leads the ATN pin of the GPIB and the data of 8 data IO lines into a cache of an application layer, and simultaneously records a timestamp of the data monitored;
reading the cache data in the cache at an application layer, and performing data combination and analysis; and setting the address of the listener to be monitored corresponding to the cache data.
2. The GPIB control method of claim 1, wherein the application layer reads the data in the cache:
when the ATN pin is at a low level, the data on the 8 data IO lines are 8-bit addresses;
when the ATN pin is at high level, the data on the 8 data IO lines is a GPIB control command, and the GPIB control command is directly read and checked against an ASCII table.
3. The GPIB control method of claim 2, wherein the 8-bit addresses on the 8 data lines are:
where 5 bits are the GPIB address of the effective address range 0 to 31, 2 bits are the type of the GPIB address, and the last 1 bit is 0.
4. The GPIB control method of claim 3, wherein the type of the GPIB address includes a general purpose controller command, an audiomaster address, a talkback address, and a second address.
5. The GPIB control method of claim 1, wherein said application layer further includes a function to add general command filtering to the IEEE488 protocol.
6. A GPIB control system based on a PRU in an internet of things gateway, the GPIB control system using the GPIB control method according to any one of claims 1 to 5, the GPIB control system comprising:
the Internet of things gateway is connected with the GPIB equipment through the GPIB bus;
the internet of things gateway comprises a PRU, a GPIB pin protection circuit and a GPIB connector, wherein the GPIB pin protection circuit is arranged between the PRU and the GPIB connector, and the internet of things gateway is connected to a GPIB field bus through the GPIB connector.
7. The GPIB control system of claim 6, wherein the PRU provides 32 pins out and the GPIB connector has 24 pins.
CN202010514347.3A 2020-06-08 2020-06-08 GPIB control system and method based on PRU in gateway of Internet of things Active CN111831597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010514347.3A CN111831597B (en) 2020-06-08 2020-06-08 GPIB control system and method based on PRU in gateway of Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010514347.3A CN111831597B (en) 2020-06-08 2020-06-08 GPIB control system and method based on PRU in gateway of Internet of things

Publications (2)

Publication Number Publication Date
CN111831597A CN111831597A (en) 2020-10-27
CN111831597B true CN111831597B (en) 2021-05-04

Family

ID=72898481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010514347.3A Active CN111831597B (en) 2020-06-08 2020-06-08 GPIB control system and method based on PRU in gateway of Internet of things

Country Status (1)

Country Link
CN (1) CN111831597B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113985321B (en) * 2021-12-27 2022-04-05 成都万创科技股份有限公司 Cable connection performance testing device and method with intelligent self-learning capability

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070115116A1 (en) * 2005-11-21 2007-05-24 General Electric Company System and method for wireless communication of facility data
CN101582895B (en) * 2009-06-18 2012-07-04 重庆邮电大学 EPA-based embedded industrial wireless WIA-PA gateway
CN106292384A (en) * 2015-05-12 2017-01-04 施耐德电气工业公司 A kind of motor protecter and the method being used for it
CN108040005B (en) * 2017-12-05 2020-07-14 大连理工大学 Digit control machine tool intelligent monitoring gateway based on thing networking
CN109361595A (en) * 2018-11-26 2019-02-19 杭州智尔科技有限公司 A kind of things-internet gateway and method
CN209861071U (en) * 2019-06-05 2019-12-27 内蒙古建筑职业技术学院 PLC gateway device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Beaglebone PRU GPIO example;佚名;《http://credentiality2.blogspot.com/2015/》;20150911;全文 *

Also Published As

Publication number Publication date
CN111831597A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN107066746B (en) Method for realizing PCA9555 function through CPLD based on I2C interface
CN112653738B (en) Internet of things network debugging system and method
CN111831597B (en) GPIB control system and method based on PRU in gateway of Internet of things
CN117148817A (en) Test system
CN112996020A (en) Bluetooth-based automatic testing method and device and Bluetooth testing terminal
CN102662808B (en) Method and device for realizing hardware fault detection on PCIE (peripheral component interconnect express)
CN116303034A (en) Automatic test system, method, equipment and medium for network on chip
CN106126465A (en) A kind of data transmission method and device
CN111562552A (en) Ground radar synchronous network master control device and control method
CN101267350B (en) Debugging method and debugging system
CN204406186U (en) A kind of fieldbus controller
CN113722340A (en) Processing method and system for remote automatic point table updating based on power distribution device
CN102884515A (en) Method, devices and system for serial port redirection process
CN100511172C (en) Inter-board transparent transmission bus test device and method thereof
CN112256503A (en) Test report generation method, device, equipment and computer readable storage medium
CN100498732C (en) Universal serial bus device test system and its method
CN104615128B (en) PROFIBUS bus intelligent diagnostics monitors and method
CN204406197U (en) PROFIBUS bus intelligent diagnostics registering instrument
CN113609052A (en) Chip simulation system based on FPGA and microprocessor and implementation method
CN117744389A (en) ECU simulation method
CN115328708A (en) Parameter testing method and device for serial peripheral interface timing sequence
CN216792886U (en) Data transmission relay equipment and data transmission system
CN112416842A (en) LPC bus-based FARM read-write circuit and method thereof
CN216014148U (en) Server and server backboard
CN113759800B (en) Signal acquisition control device for diesel locomotive

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 610041 doctor Pioneer Park, Chengdu, China, No.5 Gaopeng Avenue, high tech Zone, Chengdu, Sichuan Province

Applicant after: Chengdu wanchuang Technology Co.,Ltd.

Address before: 610041 doctor Pioneer Park, Chengdu, China, No.5 Gaopeng Avenue, high tech Zone, Chengdu, Sichuan Province

Applicant before: VANTRON TECHNOLOGY, Inc.

GR01 Patent grant
GR01 Patent grant