CN114035538A - LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method - Google Patents

LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method Download PDF

Info

Publication number
CN114035538A
CN114035538A CN202111238027.0A CN202111238027A CN114035538A CN 114035538 A CN114035538 A CN 114035538A CN 202111238027 A CN202111238027 A CN 202111238027A CN 114035538 A CN114035538 A CN 114035538A
Authority
CN
China
Prior art keywords
signal
acquisition
signals
angle
displacement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111238027.0A
Other languages
Chinese (zh)
Other versions
CN114035538B (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.)
Wuhan Yawei Technology Co ltd
Original Assignee
Wuhan Yawei 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 Wuhan Yawei Technology Co ltd filed Critical Wuhan Yawei Technology Co ltd
Priority to CN202111238027.0A priority Critical patent/CN114035538B/en
Publication of CN114035538A publication Critical patent/CN114035538A/en
Application granted granted Critical
Publication of CN114035538B publication Critical patent/CN114035538B/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
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

The invention discloses a synchronous acquisition method of a multipath heterogeneous signal based on LabVIEW, which relates to the technical field of analog signal acquisition and solves the technical problem of data loss caused by time difference of a plurality of existing data acquisition, and comprises the following steps: after the acquisition instruction is obtained, respectively acquiring a displacement signal, an angle signal and a pressure signal through a displacement sensor, an angle sensor and a pressure sensor, and an external clock participates in auxiliary acquisition of the angle signal; aligning the end timestamps of displacement signal acquisition and pressure signal acquisition with the end timestamps of angle signal acquisition respectively; respectively aligning the data quantity sum of the collected displacement signals and pressure signals with the angle signals according to the data quantity; and drawing an angle-displacement curve and an angle-pressure curve. The invention has the advantages of ensuring the efficiency and avoiding data loss when simultaneously collecting three paths of data.

Description

LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method
Technical Field
The invention relates to the field of analog signal acquisition, in particular to the technical field of a LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method.
Background
J2716 is a new standard for communication between automobile sensors and ECU introduced by SAE, has simple protocol, has advantages compared with other traditional communication protocols, is a development trend, is a digital signal transmission protocol, has higher transmission precision and speed, has single-wire data transmission capability, reduces signal wires, reduces cost and has stronger diagnosis function.
Normally performing data acquisition in LabVIEW, wherein each acquisition task respectively uses a cycle to ensure the independence of the acquisition tasks, but the parallel operation of the programs is brought about, the specific operation process progress in each cycle cannot be ensured, and the signal acquisition time difference between channels can reach 30ms at most after the test; if 3 acquisition tasks are placed in a while loop to respectively perform the acquisition tasks, the time difference of about 10ms exists in the final acquired signals due to different execution time and different preparation programs before acquisition of the pulse width acquisition task and the analog quantity voltage acquisition task.
On the other hand, the pressure and displacement signals need to be subjected to pulse width acquisition, each acquisition task can only set the specified acquisition data quantity, the time consumed by each acquisition can not be predicted, and if the two acquisition tasks are placed in the same cycle and are continuously acquired, the acquisition of the two signals is ended in sequence, so that the data loss is caused.
Disclosure of Invention
The invention aims to: the problem of a plurality of data acquisition time difference in LabVIEW lead to data loss is solved. In order to solve the technical problem, the invention provides a multipath heterogeneous signal synchronous acquisition method based on LabVIEW.
The invention specifically adopts the following technical scheme for realizing the purpose:
a synchronous acquisition method of multipath heterogeneous signals based on LabVIEW comprises a displacement sensor, a pressure sensor, an angle sensor, a data acquisition card with a counter and a LabVIEW module, wherein the signal acquisition adopts a J2716 protocol, and the acquisition process is controlled by the LabVIEW module, and comprises the following steps:
step S1: after acquiring an acquisition instruction, respectively acquiring a displacement signal, an angle signal and a pressure signal through a displacement sensor, an angle sensor and a pressure sensor, acquiring the displacement signal and the pressure signal through a counter auxiliary data acquisition card, acquiring the displacement signal and the pressure signal as pulse width acquisition, and assisting in acquiring the angle signal through an external clock;
step S2: aligning the end timestamps of displacement signal acquisition and pressure signal acquisition with the end timestamps of angle signal acquisition respectively; this step is because the displacement signal and the pressure signal specify the number of acquisitions, and the time consumed by the acquisitions cannot be accurately determined;
step S3: respectively aligning the data quantity sum of the collected displacement signals and pressure signals with the angle signals according to the data quantity;
step S4: and drawing an angle-displacement curve and an angle-pressure curve.
Preferably, the type of the data acquisition card is NIPCI-6602.
Preferably, the acquiring of the pressure signal and the displacement signal in the step S1 includes the following steps:
step S11: the acquisition task is pressure acquisition or displacement acquisition, a connected data acquisition card port is confirmed, and acquisition pulse width and a start edge are initialized; when the pressure signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a falling edge; when the displacement signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a rising edge;
step S12: initializing communication parameters, and acquiring physical terminals corresponding to ports of a sensor connected to a data acquisition card;
step S13: the clock mode is an internal implicit clock, the sampling mode is limited sampling, and the data volume needing to be collected is obtained;
step S14: starting acquisition, reading data of the sensor by using the counter through a 1-channel N sampling function, reading all sampling numbers when the sampling numbers are read and input to the counter-1, reading an array and adding a fixed high-level pulse width to obtain an acquired signal array when a pressure signal is acquired, and reading the array and adding a fixed low-level pulse width to obtain an acquired signal array when a displacement signal is acquired;
step S15: stopping the collection task; and clearing the acquisition task and releasing the occupation of hardware connection.
Preferably, in step S1, the angle sensor is connected to the data acquisition card through an encoder, and the angle signal acquisition includes the following steps:
step S21: initializing an acquisition task, confirming a port of a data acquisition card for acquiring angle signals, setting the input of parameter pulses of the encoder to 10000 per rotation, setting an initial angle to 0, setting a starting z index option to be not started, and initializing a connection wire port;
step S22: acquiring an external clock as a clock for collecting angle signals, wherein an effective edge is a rising edge, the speed is input at 2000, the sampling mode is limited sampling, and the data volume to be collected is input;
step S23: acquiring angle data through the angle sensor; reading data by using a counter 1D DBL 1 channel N sampling function, wherein when the read sampling number is input to-1, all the sampling numbers are read, and the read array is an acquired angle signal array;
step S24: stopping the collection task after the collection is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
Preferably, the method for acquiring the external clock in step S22 includes the following steps:
step S221: initializing a CO pulse frequency generation channel, wherein a ctr3 of the data acquisition card is used as a port of an acquired clock signal to form an external clock, the frequency of the initialization signal is 2000Hz, the duty ratio is 50%, and the initialization signal is input into 0.500000;
step S222: initializing a sampling clock as an internal implicit clock, continuously sampling in a sampling mode, and initializing the sampling rate to 2000 Hz; the type of the derived signal and the input signal is a counter output event, and a physical line of a clock sampling port is confirmed;
step S223: starting acquisition, and entering a cycle to ensure that the data acquisition card continuously inputs an external clock until the angle signal acquisition is finished;
step S224: stopping a clock acquisition task when the angle signal acquisition is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
Preferably, the method for aligning the end timestamps of the displacement signal acquisition and the pressure signal acquisition with the end timestamp of the angle signal acquisition in step S2 is as follows: the displacement signals and the pressure signals are pulse width signals, collected displacement signal and pressure signal data arrays are summed respectively to obtain actual output time length, and interception is carried out according to the sampling rate of the angle signals.
Preferably, the specific step of performing array alignment on the data amount sum of the collected displacement signal and pressure signal and the angle signal according to the data amount in step S3 is as follows:
step S31: obtaining the size of an array of displacement signals, angle signals and pressure signals, wherein the number of the displacement signals is x, the number of the angle signals is y, and the number of the pressure signals is z;
step S32: calculating the number p and q of angle signals corresponding to each displacement signal and each pressure signal respectively:
Figure BDA0003318197390000041
Figure BDA0003318197390000042
step S33: placing an array of displacement signals and an array of angle signals into a for cycle, wherein the total for cycle times is the number of the displacement signals in the array of displacement signals, starting a displacement data index function on the array of signals, keeping the array of angle signals unchanged, and accessing the data index function of the array of displacement signals after the number of current cycles is multiplied by p to obtain the nearest integer to obtain the angle signal corresponding to the current displacement signal;
putting the array of the pressure signals and the array of the angle signals into a for cycle, wherein the total number of the for cycle is the number of the pressure signals in the array of the pressure signals, starting a pressure data index function on the array of the signals, keeping the array of the angle signals unchanged, and obtaining the angle signals corresponding to the current pressure signals by accessing the data index function of the array of the pressure signals after multiplying the number of the current cycle by p to obtain the latest integer;
step S34: the for loop outputs array aligned displacement and angle signals and pressure and angle signals.
Preferably, the displacement sensor is of the type KMA 310.
Preferably, the pressure sensor is of the type PT 1907.
The invention has the following beneficial effects:
the invention can realize high-precision synchronous acquisition and display processing of a plurality of paths of signals based on the J2716 protocol and encoder angle signals, and effectively reduces the possibility of further generating wrong test conclusion due to data dislocation caused by signal acquisition time difference in the comprehensive analysis process of signals by aiming at the displacement pressure change conditions of different corners of the motor in the simulation operation process of the vehicle-mounted connecting piece; the protocol is connected through the J2716 protocol, the working mode of the protocol is simple, the efficiency is high, the cost can be reduced by using fewer signal lines, and meanwhile, the diagnostic function is stronger; and the three signals are aligned, so that the synchronization and consistency of the signals are ensured.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a schematic diagram of the structure of the embodiment 1 on which the multi-channel heterogeneous J2716 protocol and the analog signal synchronous acquisition method depend;
FIG. 3 is a block diagram of time stamp alignment implemented in LabVIEW of example 1;
FIG. 4 is a block diagram of the alignment of arrays implemented in LabVIEW of example 1;
FIG. 5 is a block diagram of a curved receipt implemented in LabVIEW of example 1;
FIG. 6 is a LabVIEW block diagram showing the whole structure of example 1.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1, fig. 2 and fig. 6, the present embodiment provides a method for synchronously acquiring multiple heterogeneous signals based on LabVIEW, where based on a conventional acquisition structure, the acquisition structure adopted in the present embodiment includes multiple sensors, a data acquisition card and a LabVIEW module, and the data acquisition card includes a clock generation module; the plurality of sensors comprise a pressure sensor, a displacement sensor and an angle sensor; the LabVIEW module is connected to the data acquisition card; the pressure sensor and the displacement sensor are connected with the data acquisition card through a J2716 protocol, and the angle sensor is connected with the data acquisition card through an encoder; a clock generation module on the data acquisition card assists the data acquisition card in acquiring angle signals through an angle sensor; a counter is arranged in the data acquisition card; and placing the data acquisition processes of the pressure sensor, the displacement sensor and the angle sensor under the same while cyclic function in the LabVIEW module.
According to common knowledge in the field, the LabVIEW module comprises a display panel and a signal acquisition and processing module, wherein the display panel displays data results, and the signal acquisition and processing module executes the work of signal acquisition, data processing and the like according to commands. In this embodiment, the LabVIEW module controls the data collection module to perform the required data collection task.
The specific implementation method of this embodiment is as follows:
a multipath heterogeneous signal synchronous acquisition method based on LabVIEW comprises a plurality of sensors, an angle sensor, a data acquisition card with a counter and a LabVIEW module, wherein the signal acquisition adopts a J2716 protocol, the acquisition process is controlled by the LabVIEW module, and the method comprises the following steps:
step S1: after acquiring an acquisition instruction, respectively acquiring a displacement signal, an angle signal and a pressure signal through a displacement sensor, an angle sensor and a pressure sensor, acquiring the displacement signal and the pressure signal through a counter auxiliary data acquisition card, acquiring the displacement signal and the pressure signal as pulse width acquisition, and assisting in acquiring the angle signal through an external clock;
step S2: aligning the end timestamps of displacement signal acquisition and pressure signal acquisition with the end timestamps of angle signal acquisition respectively;
step S3: respectively aligning the data quantity sum of the collected displacement signals and pressure signals with the angle signals according to the data quantity;
step S4: and drawing an angle-displacement curve and an angle-pressure curve.
Preferably, the data acquisition card is NI PCI-6602, the displacement sensor is KMA310, and the pressure sensor is PT 1907.
Preferably, the method for acquiring the displacement signal and the pressure signal comprises the following steps:
step S11: the acquisition task is pressure acquisition or displacement acquisition, a connected data acquisition card port is confirmed, and acquisition pulse width and a start edge are initialized; when the pressure signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a falling edge; when the displacement signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a rising edge;
step S12: initializing communication parameters, and acquiring physical terminals corresponding to ports of a sensor connected to a data acquisition card, wherein in the embodiment, the physical terminals are/6602/PFI 38 during pressure acquisition, and the physical terminals are/6602/PFI 34 during displacement acquisition;
step S13: the clock mode is an internal implicit clock, the sampling mode is limited sampling, and the data volume needing to be collected is obtained;
step S14: starting acquisition, reading data of the sensor by using the counter through a 1-channel N sampling function, reading all sampling numbers when the sampling numbers are read and input to the counter-1, reading an array and adding a fixed high-level pulse width to obtain an acquired signal array when a pressure signal is acquired, and reading the array and adding a fixed low-level pulse width to obtain an acquired signal array when a displacement signal is acquired; in this embodiment, the fixed high level pulse width is 0.000012s during pressure acquisition, and the fixed low level pulse width is 0.000018s during displacement acquisition;
step S15: stopping the collection task; and clearing the acquisition task and releasing the occupation of hardware connection.
When the collection task is pressure collection, in step S11, the port is 6602/ctr0, the collection pulse width is a low-level pulse width, the start edge is a falling edge, the signal pulse width range is 18us to 200us, the minimum value is 0.000018, and the maximum value is 0.000200.
When the acquisition task is displacement acquisition, in step S11, the port is 6602/ctr1, the acquisition pulse width is a low-level pulse width, the start edge is a rising edge, the signal pulse width range is 33us to 300us, the minimum value 0.000033 is input, and the maximum value 0.000300 is input.
In step S1, the angle sensor is connected to the data acquisition card through an encoder, and the angle signal acquisition includes the following steps:
step S21: initializing an acquisition task, confirming a port of a data acquisition card for acquiring angle signals, setting the input of parameter pulses of the encoder to 10000 per rotation, setting an initial angle to 0, setting a starting z index option to be not started, and initializing a connection wire port;
step S22: acquiring an external clock as a clock for collecting angle signals, wherein an effective edge is a rising edge, the speed is input at 2000, the sampling mode is limited sampling, and the data volume to be collected is input;
step S23: acquiring angle data through the angle sensor; reading data by using a counter 1D DBL 1 channel N sampling function, wherein when the read sampling number is input to-1, all the sampling numbers are read, and the read array is an acquired angle signal array;
step S24: stopping the collection task after the collection is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
The method for acquiring the external clock in step S22 includes the following steps:
step S221: initializing a CO pulse frequency generation channel, wherein a ctr3 of the data acquisition card is used as a port of an acquired clock signal to form an external clock, the frequency of the initialization signal is 2000Hz, the duty ratio is 50%, and the initialization signal is input into 0.500000;
step S222: initializing a sampling clock as an internal implicit clock, continuously sampling in a sampling mode, and initializing the sampling rate to 2000 Hz; the type of the derived signal and the input signal is a counter output event, and a physical line of a clock sampling port is confirmed;
step S223: starting acquisition, and entering a cycle to ensure that the data acquisition card continuously inputs an external clock until the angle signal acquisition is finished;
step S224: stopping a clock acquisition task when the angle signal acquisition is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
In particular, according to the scheme, three signal acquisition tasks are placed in the same while cycle, the sampling mode is set to be limited sampling, and the corresponding sampling number is set according to the preset acquisition time length and the regular length of the acquired signals. For displacement and pressure signals, according to the rule of the J2716 protocol, a packet of data includes 10 pulse signals, and the total length of the packet of data remains unchanged, where the pressure signal is 600us, the displacement signal is 750us, for example, data is collected for 3 seconds, then the total number of pressure signal collections is:
3*1000000/600*10=50000,
the total number of displacement signal acquisition is as follows:
3*1000000/750*10=40000。
the angle signal acquisition mode is to set a fixed sampling rate, each acquisition time is fixed, and 3 seconds of data are acquired, so that the set angle sampling number is 3 × 2000 — 6000. The signal acquisition action is started after the acquisition submitting instruction is sent out, so that the synchronous output of the three signals is ensured through the sequence structure before the program acquires the three signals and enters the submitting function. In order to ensure that the program starts the acquisition task according to the requirement, before the sampling number is input, the waiting in the program process is started through a while loop so as to ensure that the acquisition task is started at the same time by three-way signal acquisition.
The acquisition end time of the displacement and pressure signals cannot be accurately and directly unified with the acquisition end time of the angle signal response. For example, in the present embodiment, the number of pulses of the pressure signal is 49863, the number of pulses of the displacement signal is 40034, and the number of angle data arrays 6013 are acquired by the acquisition. Namely:
the actual acquisition pressure signal duration is theoretically (last acquisition of 3 individual pulses, not a complete data packet, directly dropped) 49860 ÷ 10 ÷ 600 ÷ 1000 ÷ 2991.6ms (calculated as a packet of data 600 us), and 2994.7ms (accumulation of the acquired data);
the actual displacement signal acquisition duration is theoretically (4 single pulses are acquired last, not a complete data packet, and are directly discarded) 40030 ÷ 10 × 750 ÷ 1000 ÷ 3002.25ms (calculated as one packet of data 750 us), and the actual value is 3000.74ms (accumulated data acquisition);
the actual acquisition angle data duration is 6013 ÷ 2000 × 1000 ═ 3006.5 ms.
In the case where the absolute timestamps of the start of the three sets of data remain the same, the next step is to process the pressure and angle signals and the displacement and angle signals to keep the two-by-two end timestamps the same.
Referring to fig. 3, the method for aligning the end timestamps of the displacement signal acquisition and the pressure signal acquisition with the end timestamp of the angle signal acquisition in step S2 includes: the displacement signal and the pressure signal are pulse width signals, the collected displacement signal and pressure signal data arrays are summed respectively to obtain the actual output time length, and interception is carried out according to the sampling rate of the angle signal, wherein the adopted frequency is 2000 Hz; after this process, an angular-alignment pressure array length of 2994.7/1000 x 2000, i.e., about 5989, and an angular-alignment displacement array length of 3002.25/1000 x 2000, i.e., about 6004, were obtained. At the moment, the alignment of the pressure signal and the angle signal time stamp from head to tail is realized, and the alignment of the displacement signal and the angle signal time stamp from head to tail is realized.
In addition, because the pressure and displacement signals only acquire the original pulse width signals, after the signals are further resolved into actual pressure and displacement numerical signals, the data volume is reduced and cannot be guaranteed to be the same as the data volume of the angle signals. For example, if there are 1 data in each 1 packet and there is 3 seconds, the pressure signal has about 50000/10-5000 data, the displacement signal has about 40000/10-4000 data, and the angle signal has about 6000 data, so that finally the pressure and angle, and the displacement and angle, respectively, need to be aligned by sampling, so as to facilitate the subsequent plotting of the angle-pressure and angle-displacement curves.
For the above purpose, referring to fig. 4, the specific steps of performing array alignment on the data amount sum of the collected displacement signal and pressure signal and the angle signal according to the data amount in step S3 are as follows:
step S31: obtaining the size of an array of displacement signals, angle signals and pressure signals, wherein the number of the displacement signals is x, the number of the angle signals is y, and the number of the pressure signals is z;
step S32: calculating the number p and q of angle signals corresponding to each displacement signal and each pressure signal respectively:
Figure BDA0003318197390000101
Figure BDA0003318197390000102
step S33: placing an array of displacement signals and an array of angle signals into a for cycle, wherein the total for cycle times is the number of the displacement signals in the array of displacement signals, starting a displacement data index function on the array of signals, keeping the array of angle signals unchanged, and accessing the data index function of the array of displacement signals after the number of current cycles is multiplied by p to obtain the nearest integer to obtain the angle signal corresponding to the current displacement signal;
putting the array of the pressure signals and the array of the angle signals into a for cycle, wherein the total number of the for cycle is the number of the pressure signals in the array of the pressure signals, starting a pressure data index function on the array of the signals, keeping the array of the angle signals unchanged, and obtaining the angle signals corresponding to the current pressure signals by accessing the data index function of the array of the pressure signals after multiplying the number of the current cycle by p to obtain the latest integer;
step S34: the for loop outputs array aligned displacement and angle signals and pressure and angle signals.
The following is explained by the specific case as the data amount of the pressure signal and the case of array alignment with the angle signal according to the data amount respectively:
1. respectively obtaining the actual size of a pressure signal array and the actual size of an angle signal array, wherein the size of the pressure signal array is 4986, and the actual size of the angle signal array is 6013;
2. dividing the size of the angle signal array by the size of the pressure signal array, wherein 6013/4986 is 1.206, namely each pressure data corresponds to 1.206 angle data;
3. inputting pressure signal array data and angle signal array data into a For cycle, starting a data index of the pressure signal array, keeping the array unchanged For the data of the angle model array, multiplying the current cycle times by 1.206, rounding up the data, and accessing the data into an array index function control of the angle array to obtain an angle data value corresponding to each data in the pressure array;
4. the angle array data output by the For cycle corresponds to the pressure array data one by one.
Finally, referring to fig. 5, an angle-displacement curve and an angle-pressure curve are plotted.

Claims (9)

1. A synchronous acquisition method of multipath heterogeneous signals based on LabVIEW comprises a displacement sensor, a pressure sensor, an angle sensor, a data acquisition card with a counter and a LabVIEW module, wherein the signal acquisition adopts a J2716 protocol, and the acquisition process is controlled by the LabVIEW module, and is characterized by comprising the following steps:
step S1: after acquiring an acquisition instruction, respectively acquiring a displacement signal, an angle signal and a pressure signal through a displacement sensor, an angle sensor and a pressure sensor, acquiring the displacement signal and the pressure signal by a counter auxiliary data acquisition card, acquiring the displacement signal and the pressure signal as pulse width acquisition, and assisting in acquiring the angle signal by an external clock;
step S2: aligning the end timestamps of displacement signal acquisition and pressure signal acquisition with the end timestamps of angle signal acquisition respectively;
step S3: respectively aligning the data quantity sum of the collected displacement signals and pressure signals with the angle signals according to the data quantity;
step S4: and drawing an angle-displacement curve and an angle-pressure curve.
2. The LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method as claimed in claim 1, wherein the data acquisition card is NI PCI-6602.
3. The method for synchronously acquiring the multipath heterogeneous signals based on the LabVIEW as claimed in claim 1, wherein the step S1 of acquiring the displacement signal and the pressure signal comprises the following steps:
step S11: the acquisition task is pressure acquisition or displacement acquisition, a connected data acquisition card port is confirmed, and acquisition pulse width and a start edge are initialized; when the pressure signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a falling edge; when the displacement signal is collected, the collected pulse width is a low-level pulse width, and the starting edge is a rising edge;
step S12: initializing communication parameters, and acquiring physical terminals corresponding to ports of a sensor connected to a data acquisition card;
step S13: the clock mode is an internal implicit clock, the sampling mode is limited sampling, and the data volume needing to be collected is obtained;
step S14: starting acquisition, reading data of the sensor by using the counter through a 1-channel N sampling function, reading all sampling numbers when the sampling numbers are read and input to the counter-1, reading an array and adding a fixed high-level pulse width to obtain an acquired signal array when a pressure signal is acquired, and reading the array and adding a fixed low-level pulse width to obtain an acquired signal array when a displacement signal is acquired;
step S15: stopping the collection task; and clearing the acquisition task and releasing the occupation of hardware connection.
4. The method for synchronously acquiring the multipath heterogeneous signals based on the LabVIEW as claimed in claim 2, wherein in the step S1, the angle sensor is connected to the data acquisition card through an encoder, and the angle signal acquisition comprises the following steps:
step S21: initializing an acquisition task, confirming a port of a data acquisition card for acquiring angle signals, setting the input of parameter pulses of the encoder to 10000 per rotation, setting an initial angle to 0, setting a starting z index option to be not started, and initializing a connection wire port;
step S22: acquiring an external clock as a clock for collecting angle signals, wherein an effective edge is a rising edge, the speed is input at 2000, the sampling mode is limited sampling, and the data volume to be collected is input;
step S23: acquiring angle data through the angle sensor; reading data by using a counter 1D DBL 1 channel N sampling function, wherein when the read sampling number is input to-1, all the sampling numbers are read, and the read array is an acquired angle signal array;
step S24: stopping the collection task after the collection is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
5. The LabVIEW-based multipath heterogeneous signal synchronous acquisition method as claimed in claim 4, wherein the method for acquiring the external clock in the step S22 comprises the following steps:
step S221: initializing a CO pulse frequency generation channel, wherein a ctr3 of the data acquisition card is used as a port of an acquired clock signal to form an external clock, the frequency of the initialization signal is 2000Hz, the duty ratio is 50%, and the initialization signal is input into 0.500000;
step S222: initializing a sampling clock as an internal implicit clock, continuously sampling in a sampling mode, and initializing the sampling rate to 2000 Hz; the type of the derived signal and the input signal is a counter output event, and a physical line of a clock sampling port is confirmed;
step S223: starting acquisition, and entering a cycle to ensure that the data acquisition card continuously inputs an external clock until the angle signal acquisition is finished;
step S224: stopping a clock acquisition task when the angle signal acquisition is finished; and clearing the acquisition task and releasing the occupation of hardware connection.
6. The method for synchronously acquiring the multiple heterogeneous signals based on LabVIEW according to claim 1, wherein the method for respectively aligning the end time stamps of the displacement signal acquisition and the pressure signal acquisition with the end time stamp of the angle signal acquisition in step S2 comprises: the displacement signals and the pressure signals are pulse width signals, collected displacement signal and pressure signal data arrays are summed respectively to obtain actual output time length, and interception is carried out according to the sampling rate of the angle signals.
7. The synchronous acquisition method for the multipath heterogeneous signals based on LabVIEW as claimed in claim 1, wherein the step S3 of performing array alignment on the data amount sum of the acquired displacement signal and pressure signal and the angle signal according to the data amount respectively comprises the following specific steps:
step S31: obtaining the size of an array of displacement signals, angle signals and pressure signals, wherein the number of the displacement signals is x, the number of the angle signals is y, and the number of the pressure signals is z;
step S32: calculating the number p and q of angle signals corresponding to each displacement signal and each pressure signal respectively:
Figure FDA0003318197380000031
Figure FDA0003318197380000032
step S33: placing an array of displacement signals and an array of angle signals into a for cycle, wherein the total for cycle times is the number of the displacement signals in the array of displacement signals, starting a displacement data index function on the array of signals, keeping the array of angle signals unchanged, and accessing the data index function of the array of displacement signals after the number of current cycles is multiplied by p to obtain the nearest integer to obtain the angle signal corresponding to the current displacement signal;
putting the array of the pressure signals and the array of the angle signals into a for cycle, wherein the total number of the for cycle is the number of the pressure signals in the array of the pressure signals, starting a pressure data index function on the array of the signals, keeping the array of the angle signals unchanged, and obtaining the angle signals corresponding to the current pressure signals by accessing the data index function of the array of the pressure signals after multiplying the number of the current cycle by p to obtain the latest integer;
step S34: the for loop outputs array aligned displacement and angle signals and pressure and angle signals.
8. The LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method as claimed in claim 1, wherein the displacement sensor is KMA 310.
9. The LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method as claimed in claim 1, wherein the model of the pressure sensor is PT 1907.
CN202111238027.0A 2021-10-25 2021-10-25 LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method Active CN114035538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111238027.0A CN114035538B (en) 2021-10-25 2021-10-25 LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111238027.0A CN114035538B (en) 2021-10-25 2021-10-25 LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method

Publications (2)

Publication Number Publication Date
CN114035538A true CN114035538A (en) 2022-02-11
CN114035538B CN114035538B (en) 2022-11-29

Family

ID=80141800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111238027.0A Active CN114035538B (en) 2021-10-25 2021-10-25 LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method

Country Status (1)

Country Link
CN (1) CN114035538B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317353A (en) * 2014-10-20 2015-01-28 中国电子科技集团公司第四十一研究所 Hardware circuit based timestamp implementation method
CN104977978A (en) * 2015-07-17 2015-10-14 上海无线电设备研究所 Acquiring and processing method for non-synchronizing signals of system clock
CN107402597A (en) * 2017-07-31 2017-11-28 上海联影医疗科技有限公司 A kind of data and method, apparatus of clock alignment, medium and magnetic resonance equipment
CN107874756A (en) * 2017-11-21 2018-04-06 博睿康科技(常州)股份有限公司 The precise synchronization method of eeg collection system and video acquisition system
CN110321316A (en) * 2019-06-19 2019-10-11 西安思丹德信息技术有限公司 A kind of multi-channel synchronous data acquisition adaptive training control device and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317353A (en) * 2014-10-20 2015-01-28 中国电子科技集团公司第四十一研究所 Hardware circuit based timestamp implementation method
CN104977978A (en) * 2015-07-17 2015-10-14 上海无线电设备研究所 Acquiring and processing method for non-synchronizing signals of system clock
CN107402597A (en) * 2017-07-31 2017-11-28 上海联影医疗科技有限公司 A kind of data and method, apparatus of clock alignment, medium and magnetic resonance equipment
CN107874756A (en) * 2017-11-21 2018-04-06 博睿康科技(常州)股份有限公司 The precise synchronization method of eeg collection system and video acquisition system
CN110321316A (en) * 2019-06-19 2019-10-11 西安思丹德信息技术有限公司 A kind of multi-channel synchronous data acquisition adaptive training control device and method

Also Published As

Publication number Publication date
CN114035538B (en) 2022-11-29

Similar Documents

Publication Publication Date Title
CN102879641A (en) Frequency measurement method and system
CN114035538B (en) LabVIEW-based multi-channel heterogeneous signal synchronous acquisition method
CN101957428A (en) Automatic test method and tool of monitoring circuit board
CN107014432B (en) A kind of analog signal monitoring system and method
CN109030986B (en) T/R assembly phase-shifting precision testing method and system based on triggering function
CN1987488A (en) Electric energy metering chip
CN114964701A (en) Model surface pressure continuous measurement test system based on pressure scanning valve
CN201035741Y (en) Distributed data acquisition instrument
CN110244625A (en) A kind of signal measurement method based on electronic control unit
JP4476228B2 (en) Simulation device
CN103580554B (en) Pilot controller controls the method for servomotor, pilot controller and system
CN114779735B (en) Hardware-in-loop simulation platform and method for distributed fault diagnosis system of aero-engine
CN204856469U (en) General signal acquisition driver
CN113268048A (en) Hand-held portable magnetoelectric Hall rotating speed signal simulator
CN108089468A (en) A kind of medical examination equipment control sequential visualized generation method
CN115265982A (en) Sampling control method of multi-module data acquisition unit and multi-module data acquisition unit
CN111949598A (en) Multiplexing self-adaptation synchronizing circuit of system-on-chip pin
EP1850195A1 (en) Method and device for testing a vehicle control unit and suited vehicle control unit
CN114187767A (en) Traffic signal control method, control module, interface module and simulation test system
CN111198324A (en) Synchronous motor test method, device, test equipment and test system
EP2455830A1 (en) Method for recording changes in entry signals
CN203368439U (en) Pulse-width self-adaptive single bus receiver
CN106647435A (en) Multichannel data sampling method, system and device
CN108279591B (en) Simulation platform digital quantity universal output method
CN106019395A (en) Electrical method receiving and processing system and method thereof based on correlation identification

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