Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide a kind of data with waveform multiframe writing function
Acquisition system can carry out deep storage to data, and carry out the storage of multiframe subregion to the waveform for meeting trigger parameter, convenient for using
Observe waveform details in family.
In order to realize the above goal of the invention, it includes acquisition that the present invention, which has the data collection system of waveform multiframe writing function,
Module, central control module, trigger module, channel data selecting module, trend waveform snap shot module, trend Waveform caching mould
Block, depth stored waveform front end caching and conversion module, memory control module, deep stored waveform rear end caching and conversion module,
Deep stored waveform snap shot module, external memory, host computer, display screen, wherein central control module, trigger module, port number
According to selecting module, trend waveform snap shot module, trend Waveform caching module, deep stored waveform front end caching and conversion module, deposit
Reservoir control module, deep stored waveform rear end caching and conversion module, deep stored waveform snap shot module are realized in FPGA;
Acquisition module remembers that the number of channels of acquisition module is N, sample rate χ will be acquired for being acquired to data source
To N circuit-switched data stream be sent to channel data selecting module:
Central control module receives the channel position n that host computer is sent and is transmitted to channel data selecting module, receives upper
The snap shot coefficient ε that machine is sent1It is transmitted to trend waveform snap shot module, receives the snap shot coefficient ε that host computer is sent2It is transmitted to deep deposit
Waveform snap shot module is stored up, the trend waveform write operation instruction that host computer is sent is received and is transmitted to trend Waveform caching module, receive
The storage depth Q for the multiframe record that host computer is sent1, the corresponding record frame number of separate storage region quantity M, K triggering type
φk, deep stored waveform write operation instruction and deep stored waveform read operation instruction be transmitted to memory control module, wherein capturing wave
The instruction of shape write operation receives host computer comprising writing initial address, pre-trigger depth predepth and rear triggering depth postdepth
The trigger parameter T of K triggering type of transmissionkIt is transmitted to trigger module;Trend waveform number is read from trend Waveform caching module
According to Datai2Be transmitted to host computer, from memory control module receive deep stored waveform data write full marking signal be transmitted to it is upper
Machine receives deep stored waveform data forwarding to host computer from deep stored waveform snap shot module;
Trigger module is used to receive the trigger parameter T of K triggering type of central control module forwardingk, generate K correspondence
Trigger signal SigkIt is sent to memory control module;
Channel data selecting module receives channel position n, the channel n of gated acquisition module of central control module forwarding,
It is received to acquire data Data and be sent to trend waveform snap shot module and deep stored waveform front end caching and conversion module;
Trend waveform snap shot module receives the snap shot coefficient ε that central control module is sent1, acquisition data Data is taken out
Point obtains main Wave data Datai1It is sent to trend Waveform caching module;
Trend Waveform caching module receives main Wave data Data after receiving the instruction of trend waveform write operationi1It carries out
Caching;
Deep stored waveform front end caching and conversion module acquire data Data and are cached for receiving, and be converted to
Under the clock of external memorizer, the data Data that will be converted toj1It exports to memory control module;
Memory control module is used to carry out write operation control to external memorizer and read operation controls, and particular content is such as
Under:
What the deep stored waveform write operation signal of memory control module reception central control module forwarding, multiframe recorded deposits
Store up depth Q1, the corresponding record frame number φ of separate storage region quantity M, K triggering typek, according to writing initial address and independently deposit
The address range λ of each separate storage region is calculated in storage region quantity Mm;Memory control module receives center control mould
The corresponding record frame number φ of K triggering type of block forwardingk, it is that k-th of triggering type distributes φkA separate storage region;
Memory control module receives K trigger signal Sig from trigger modulek, successively select each trigger signal to depth
Stored waveform carries out triggering storage, detailed process are as follows:
1) the separate storage region serial number r=1 of k-th of triggering type is enabled;
2) from deep stored waveform front end caching and reading data Data in conversion modulej1, by data Dataj1Recurrent wrIting
In corresponding r-th of separate storage region of k-th of triggering type, and according to k-th of trigger signal SigkTriggering judgement is carried out,
If do not triggered, do not make any operation, if triggering, latches triggering address tri_addrk,r, continue to external memorizer
Postdepth data are written, then sends k-th of triggering type r frame depth storing data to central control module and writes full scale
Will signal;If triggering is not implemented in preset time T, current address is latched as triggering address tri_addrk,r, after
Continue to external memorizer and postdepth data are written, it is deep then to send k-th of triggering type r frame to central control module
Storing data writes full marking signal;
If 3) r < φk, then r=r+1, return step 2 are enabled), otherwise select next trigger signal;
Storage control module receives the deep stored waveform read operation signal of central control module forwarding, successively calculates k-th
Type r frame depth storing data is triggered in the reading initial address begin_addr=tri_addr of external memoryk,r-
Since predepth read α from corresponding separate storage region reading initial address2A data, by φ1+φ2+...+φN
Frame depth stored waveform data constitute data Dataj2It is sent to deep stored waveform rear end caching and conversion module;
Deep stored waveform rear end caching is used for conversion module to data Dataj2It is cached, and is converted to FIFO
Reading clock under, the data Data that will be converted toj3It exports to deep stored waveform snap shot module;
Deep stored waveform snap shot module receives the snap shot coefficient ε that central control module is sent2, to data Dataj3It is taken out
Point obtains data Dataj4It is sent to central control module;
External memory is for storing deep stored waveform data;
Host computer calculates the parameter of each module according to the parameter of user setting, by central control module to modules into
Row setting, and received data are handled, it specifically includes:
1) the storage depth Q of the multiframe record of user setting is received1=L*W, L are that the record of each frame when multiframe records is long
Degree, W are the bit wide of each data point, and external memory is divided intoA mutual separate storage region,
Middle Q is the memory capacity of external memory,It indicates to be rounded downwards, m=1,2 ..., M;
2) the trigger parameter T of the triggering type of user setting is receivedkAnd the corresponding record frame number φ of each triggering typek,
K=1,2 ..., K, K indicate the quantity of triggering type, need to meet φ1+φ2+...+φN≤M;
3) host computer receive user's input channel selecting serial number n, it is slow when base gear TiWith it is fast when base gear Tj, calculate master
Trend waveform snap shot coefficient ε1With deep stored waveform snap shot coefficient ε2, wherein main waveform snap shot coefficient ε1Calculation formula it is as follows:
Wherein, α indicates the data point that display screen shows that the main waveform of a frame needs, and β indicates that display screen shows the lattice of main waveform
Number;
Deep stored waveform snap shot coefficient ε2Calculation method it is as follows:
It solves according to the following formula and obtains applicable equivalent sampling rate χ2With sampling number α2Combination:
χ2=α2/(β*Tj)
s.t.χ2≤χ,α2< Q1
As needed in applicable equivalent sampling rate χ2With sampling number α2Combination in select one group, then calculate capture
Waveform snap shot coefficient ε2=χ/χ2;
Host computer is by channel selecting serial number n, the trend waveform snap shot coefficient ε being calculated1With deep stored waveform snap shot system
Number ε2, multiframe record storage depth Q1, separate storage region quantity M, K triggering type trigger parameter TkAnd K triggering
The corresponding record frame number φ of typekIt is sent to central control module, and sends trend waveform write operation letter to central control module
Number and deep stored waveform write operation signal, deep stored waveform write operation signal include writing initial address, pre-trigger depth
Predepth triggers depth postdepth with rear, wherein predepth+postdepth=α2;
Whenever host computer receive central control module forwarding a screen trend Wave data, then be sent to display screen into
Row display;Whenever host computer receives the φ of central control module forwarding1+φ2+...+φKA stored waveform writes full marking signal
Afterwards, stored waveform read operation signal is sent to central control module, receives the φ of central control module feedback1+φ2+...+φK
Then frame depth stored waveform data are sent into display screen frame by frame and are shown, otherwise do not make any operation;
Display screen is used to show the trend Wave data received and deep stored waveform data.
The present invention has the data collection system of waveform multiframe writing function, is carrying out conventional Christmas to acquisition data, is delaying
Other than depositing and showing, multiframe record also has been carried out to acquisition data, method particularly includes: the multiple triggering types of user setting, it is raw
At trigger signal, external memory is divided into multiple separate storage regions and distributes to each triggering type;Data will be acquired
Some separate storage region is written, is then carried out triggering judgement with corresponding trigger signal and stored to obtain deep stored waveform number
According to, and snap shot is carried out to deep stored waveform data according to the snap shot coefficient being calculated and is then shown.
The present invention has following technical effect that
1) present invention supports user to preset the record frame number of triggering type and each type, sets rear data and adopts
Collecting system automatically can continuously record the critical event for having trigger condition, guarantee within a continuous period not
User can be missed and think critical event to be captured, and recorded in strict accordance with the triggering class queues of user preset;
2) present invention observes the general picture of waveform by the real-time display to trend waveform convenient for user, stores wave by deep
The details of waveform is observed in the display of graphic data convenient for user;
3) present invention is under long-term unattended usage scenario, and can catch the exception event for a long time, by simply setting
It sets and the remotely located triggering type log-on data acquisition system of user can be realized, and be arranged when being triggered every time and all record triggering
Time, to realize the record to data source a few days or a few weeks longer, user can finish in record and extract further according to the triggered time
Data are analyzed.
Embodiment
Fig. 1 is the specific embodiment structure chart for the data collection system that the present invention has waveform multiframe writing function.Such as
Shown in Fig. 1, the present invention have waveform multiframe writing function data collection system include acquisition module 1, central control module 2,
Before trigger module 3, channel data selecting module 4, trend waveform snap shot module 5, trend Waveform caching module 6, deep stored waveform
End caching is taken out with conversion module 7, memory control module 8, deep stored waveform rear end caching and conversion module 9, deep stored waveform
Point module 10, external memory 11, host computer 12, display screen 13, wherein central control module 2, trigger module 3, channel data
Selecting module 4, trend waveform snap shot module 5, trend Waveform caching module 6, deep stored waveform front end caching and conversion module 7,
Memory control module 8, deep stored waveform rear end caching are with conversion module 9, deep stored waveform snap shot module 10 in FPGA
It (is realized in (Field-Programmable Gate Array, field programmable gate array).Next modules are carried out
It is described in detail.
Acquisition module 1 is for being acquired data source, and the number of channels of note acquisition module 1 is N, and sample rate χ will be adopted
The N circuit-switched data stream collected is sent to channel data selecting module 4.Acquisition module 1 is acquired using the ADC on 128 tunnels in the present embodiment
Board, data bit width 16bit, sample rate 100MS/s.
Central control module 2 is for controlling the transfer of information and date between host computer 12 and other each modules, comprising:
It receives the channel position n that host computer 12 is sent and is transmitted to channel data selecting module 4, receive what host computer 12 was sent
Snap shot coefficient ε1It is transmitted to trend waveform snap shot module 5, receives the snap shot coefficient ε that host computer 12 is sent2It is transmitted to deep stored waveform
Snap shot module 10, the trend waveform write operation for receiving the transmission of host computer 12, which instructs, is transmitted to trend Waveform caching module 6, in reception
The storage depth Q for the multiframe record that position machine 12 is sent1, the corresponding record frame number of separate storage region quantity M, K triggering type
φk, deep stored waveform write operation instruction and deep stored waveform read operation instruction be transmitted to memory control module 8, wherein capturing
The instruction of waveform write operation receives upper comprising writing initial address, pre-trigger depth predepth and rear triggering depth postdepth
The trigger parameter T for the K triggering type that machine 12 is sentkIt is transmitted to trigger module 3;
Trend Wave data Data is read from trend Waveform caching module 6i2It is transmitted to host computer 12, controls mould from memory
Block 8, which receives deep stored waveform data, to be write full marking signal and is transmitted to host computer 12, receives depth from deep stored waveform snap shot module 10
Stored waveform data forwarding is to host computer 12.
Trigger module 3 is used to receive the trigger parameter T of K triggering type of the forwarding of central control module 2k, it is a right to generate K
The trigger signal Sig answeredkIt is sent to memory control module 8.
Channel data selecting module 4 receives the channel position n that central control module 2 forwards, the channel of gated acquisition module 1
N receives it and acquires data Data and be sent to trend waveform snap shot module 5 and deep stored waveform front end caching and conversion module 7.
Trend waveform snap shot module 5 receives the snap shot coefficient ε that central control module 2 is sent1, acquisition data Data is carried out
Snap shot obtains trend Wave data Datai1It is sent to trend Waveform caching module 6.
Trend Waveform caching module 6 receives trend Wave data Data after receiving the instruction of trend waveform write operationi1Into
Row caching.Due to the sampling, storage of trend waveform in the present invention and show rolling mode of work when slow under base, it is desirable to be able to
The module of read-while-write caches waveform, therefore trend Waveform caching module 6 realized using the FIFO inside FPGA.Data are arranged to read
Write bit width is W, and W is the bit wide of data Data, and the storage depth of FIFO is arranged in the case where saving resource.
Deep stored waveform front end caching is cached with conversion module 7 for receiving acquisition data Data, and is converted
To the clock of external memorizer, the data Data that will be converted toj1It exports to memory control module 8.Similarly, deep storage
Waveform caching module also uses the FIFO inside FPGA to realize, setting read-write bit wide is W, to occupy minimum logical resource as rule
The storage depth of FIFO is set.It enables the read port clock of FIFO connect the synchronised clock of acquisition data Data, is in the present embodiment
The write port clock of 100Mhz, FIFO connect the user clock of external memorizer, are 200Mhz in the present embodiment, to realize data
Cross clock domain to external memorizer is converted.
Memory control module 8 is used to carry out write operation control to external memorizer 11 and read operation controls, particular content
It is as follows:
Memory control module 8 receives the deep stored waveform write operation signal of the forwarding of central control module 2, multiframe records
Storage depth Q1, the corresponding record frame number φ of separate storage region quantity M, K triggering typek, according to writing initial address and independence
The address range λ of each separate storage region in external memory 11 is calculated in storage region quantity Mm.Fig. 2 is the present embodiment
The division schematic diagram of external memory.As shown in Fig. 2, note writes initial address in the present embodiment by the way of continuous dispensing
For A, then the address range λ of m-th of separate storage regionmFor [A+ (m-1) Q1,A+mQ1].Memory control module 8 receives center
The corresponding record frame number φ of K triggering type that control module 2 forwardsk, it is that k-th of triggering type distributes φkA separate storage area
Domain.
Memory control module 8 receives K trigger signal Sig from trigger module 3k, successively select each trigger signal pair
Deep stored waveform carries out triggering storage, detailed process are as follows:
1) the separate storage region serial number r=1 of k-th of triggering type is enabled.
2) from deep stored waveform front end caching and reading data Data in conversion module 7j1, by data Dataj1Recurrent wrIting
In corresponding r-th of separate storage region of k-th of triggering type, and according to k-th of trigger signal SigkTriggering judgement is carried out,
If do not triggered, do not make any operation, if triggering, latches triggering address tri_addrk,r, continue to external memorizer
Postdepth data are written, then sends k-th of triggering type r frame depth storing data to central control module 2 and writes full scale
Will signal;If triggering is not implemented in preset time T, current address is latched as triggering address tri_addrk,r, after
Continue to external memorizer and postdepth data are written, it is deep then to send k-th of triggering type r frame to central control module 2
Storing data writes full marking signal.That is, if k-th of triggering type in current data be not implemented triggering, when
Between store current data when counting full.
If 3) r < φk, then r=r+1, return step 2 are enabled), otherwise select next trigger signal.
Storage control module receives the deep stored waveform read operation signal that central control module 2 forwards, and successively calculates k-th
Type r frame depth storing data is triggered in the reading initial address begin_addr=tri_addr of external memory 11k,r-
Since predepth read α from corresponding separate storage region reading initial address2A data, by φ1+φ2+...+φN
Frame depth stored waveform data constitute data Dataj2It is sent to deep stored waveform rear end caching and conversion module 9.
Deep stored waveform rear end caching is used for conversion module 9 to data Dataj2It is cached, and is converted to FIFO
Reading clock under, the data Data that will be converted toj3It exports to deep stored waveform snap shot module 10.Similarly, deep stored waveform
Rear end caching also realizes that setting read-write bit wide is ε with conversion module 9 using the FIFO inside FPGA, to occupy minimum logic money
Source is the storage depth of rule setting FIFO.FIFO read port clock connects the user clock of memory, FIFO write port clock
Connect Dataj2Synchronised clock, with realize external memory 11 to FPGA internal data cross clock domain convert.
Deep stored waveform snap shot module 10 receives the snap shot coefficient ε that central control module 2 is sent2, to data Dataj3It carries out
Snap shot obtains data Dataj4It is sent to central control module 2.
External memory 11 is for storing deep stored waveform data.
Host computer 12 calculates the parameter of each module according to the parameter of user setting, by central control module 2 to each mould
Block is configured, and received data are handled and shown, is specifically included:
1) host computer 12 receives the storage depth Q of the multiframe record of user setting1=L*W, L are each frame when multiframe records
Record length (unit: points), W be each data point bit wide, external memory 11 is divided into
A mutual separate storage region, wherein Q is the memory capacity of external memory 11,It indicates to be rounded downwards, m=1,2 ...,
M。
2) host computer 12 receives the triggering type T of user settingkAnd the corresponding record frame number φ of each triggering typek, k
=1,2 ..., K, K indicate the quantity of triggering type, need to meet φ1+φ2+...+φN≤M。
3) host computer 12 receive user's input channel selecting serial number n, it is slow when base gear TiWith it is fast when base gear Tj, calculate
Main trend waveform snap shot coefficient and capture waveform snap shot coefficient, calculation method difference are as follows:
● trend waveform snap shot coefficient
Note display screen 13 shows that a frame trend waveform needs α data point, total β lattice, then the sampling time of a frame waveform
For β * Ti, then the time interval of two points is t on display screen 131=(β * Ti)/α, the display sample rate of trend waveform are χ1=
[α/(β*Ti)], i.e., when base gear value can not be divided evenly when selection, choose χ1For approximate integer value, work as so as to calculate
Trend waveform snap shot coefficient when preceding under base gear
13 1 frame waveform of display screen needs 1000 data points in the present embodiment, totally 10 lattice, 100 points of every lattice, therefore is arranged
Maximum storage depth is 1kpts.Assuming that base gear is 200ms/div, the two o'clock time of display screen 13 when slow set by user
It is spaced t1=(200ms*10)/1000=2ms shows sample rate χ1=1/2ms=500S/s, so as to calculate snap shot coefficient ε1
=100M/500=2 × 105。
● deep stored waveform snap shot coefficient
The storage depth for remembering external memorizer 11 is δ, wherein δ > > α.The sample rate χ of acquisition module 1 is that capture waveform is adopted
The upper limit of sample rate, therefore in the present invention, the base gear T when calculating fastjUnder equivalent sampling rate and sampling number must assure that two
A condition:
(a) it is no more than χ to guarantee equivalent sampling rate as far as possible the higher the better.
(b) guarantee sampling number α2Less than currently stored depth δ.
Due to equivalent sampling rate χ2With sampling number α2Relational expression be χ2=α2/(β*Tj)α2=χ2*β*Tj, therefore basis
Following formula solves to obtain applicable equivalent sampling rate χ2With sampling number α2Combination:
χ2=α2/(β*Tj)
s.t.χ2≤χ,α2< δ
As needed in applicable equivalent sampling rate χ2With sampling number α2Combination in select one group, ordinary priority selection
Equivalent sampling rate χ2Maximum combination.Then capture waveform snap shot coefficient ε is calculated2=χ/χ2。
It is assumed herein that 100M is highest sample rate, storage depth 100kpts, when base 10 μ s/div under, first determine equivalent
Sample rate χ2For 100MS/s, then calculating sampling number is α2=(10 μ s*10) * 100M=10kpts, to calculate snap shot coefficient
ε2=100M/100M=1, i.e. not snap shot;For another example storage depth 100kpts, when base 500 μ s/div under, if being sampled with highest
Rate 100M is as equivalent sampling rate χ2, then sampling number α2=(500 μ s*10) * 100M=500kpts is greater than currently stored depth
100kpts, therefore first determine that sampling number is 100kpts, calculate equivalent sampling rate χ2=100k/ (500 μ s*10)=20MS/s,
To calculate snap shot coefficient ε2=100M/20M=5.
Host computer 12 is by channel selecting serial number n, the trend waveform snap shot coefficient ε being calculated1With deep stored waveform snap shot
Coefficient ε2, multiframe record storage depth Q1, separate storage region quantity M, K trigger type TkAnd K triggering type is corresponding
Record frame number φkIt is sent to central control module 2, and sends trend waveform write operation signal and depth to central control module 2
Stored waveform write operation signal, deep stored waveform write operation signal include write initial address, pre-trigger depth predepth and after
Depth postdepth is triggered, wherein predepth+postdepth=α2.In general, trigger ground to make to capture in waveform
The corresponding data in location are located among display screen 13, enable predepth=α2/2。
Whenever host computer 12 receives a screen trend Wave data of the forwarding of central control module 2, i.e. α1A trend waveform
Data, α1The sampling number of expression trend waveform is then sent to display screen 13 and is shown.In host computer 12 receives
The φ for entreating control module 2 to forward1+φ2+...+φNAfter a stored waveform writes full marking signal, depth is sent to central control module 2
Stored waveform read operation signal receives the φ that central control module 2 is fed back1+φ2+...+φNFrame depth stored waveform data, then
It is sent into display screen 13 frame by frame to be shown, does not otherwise make any operation.
Display screen 13 is used to show the trend Wave data received and deep stored waveform data.In general,
Display screen 13 before being shown to trend Wave data and deep stored waveform data, can be counted according to sampling number and display into
Row snap shot.
Technical solution in order to better illustrate the present invention has the electrographic recording of waveform multiframe writing function to the present invention
The workflow of instrument is briefly described.
After host computer 12 calculates snap shot coefficient according to the when base of user setting, trend waveform snap shot is issued to by controller
Module 5 and deep stored waveform snap shot module 10, then acquisition module 1 carries out signal acquisition, and channel data selecting module is according to upper
The serial number of corresponding channel is sent to trend waveform snap shot module 5 and deep stored waveform front end by the channel position being arranged in the machine 12 of position
Caching and conversion module 7.Trend waveform snap shot module 5 carries out snap shot, caching to trend Waveform caching mould according to its snap shot coefficient
Block 6 reads feeding host computer 12 by central control module 2 and is continuously displayed.Deep stored waveform front end caching and conversion module 7
Data are acquired for caching.
The trigger parameter for the K triggering type that trigger module 3 is arranged in host computer 12 according to user generates K triggering letter
Number it is sent to memory control module 8.The parameter that memory control module 8 is arranged according to user in host computer is by external memory
11 are divided into several separate storage regions, distribute to different triggering types.Then it caches and converts from deep stored waveform front end
Acquisition data are read in module 7, are triggered using the corresponding trigger signal of K triggering type, by the deep stored waveform of triggering
Data are stored into corresponding separate storage region, are sent deep stored waveform to host computer after storage is full and are write full marking signal.
Host computer 12 reads trend Wave data and is continuously displayed.Then whenever host computer 12 receives center control mould
The φ that block 2 forwards1+φ2+...+φNAfter a stored waveform writes full marking signal, then deep storage is issued by central control module 2
Waveform read operation signal, reads φ from external memory 111+φ2+...+φNFrame depth stored waveform data store wave through deep
Shape rear end caching carries out caching and clock conversion with conversion module 9, then passes through after deep 10 snap shot of stored waveform snap shot module
Centre control module 2 feeds back to host computer, is sent into display screen 13 and is shown.
Although the illustrative specific embodiment of the present invention is described above, in order to the technology of the art
Personnel understand the present invention, it should be apparent that the present invention is not limited to the range of specific embodiment, to the common skill of the art
For art personnel, if various change the attached claims limit and determine the spirit and scope of the present invention in, these
Variation is it will be apparent that all utilize the innovation and creation of present inventive concept in the column of protection.