CN111580491A - Novel switching value signal recording, storing and replaying method and system based on PLC - Google Patents

Novel switching value signal recording, storing and replaying method and system based on PLC Download PDF

Info

Publication number
CN111580491A
CN111580491A CN202010363043.1A CN202010363043A CN111580491A CN 111580491 A CN111580491 A CN 111580491A CN 202010363043 A CN202010363043 A CN 202010363043A CN 111580491 A CN111580491 A CN 111580491A
Authority
CN
China
Prior art keywords
playback
signal
plc
recording
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010363043.1A
Other languages
Chinese (zh)
Inventor
冯旭
韩亚洲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
AECC Harbin Dongan Engine Co Ltd
Original Assignee
AECC Harbin Dongan Engine 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 AECC Harbin Dongan Engine Co Ltd filed Critical AECC Harbin Dongan Engine Co Ltd
Priority to CN202010363043.1A priority Critical patent/CN111580491A/en
Publication of CN111580491A publication Critical patent/CN111580491A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/42Recording and playback systems, i.e. in which the programme is recorded from a cycle of operations, e.g. the cycle of operations being manually controlled, after which this record is played back on the same machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures

Abstract

The invention relates to the field of machine tools, in particular to a novel switching value signal recording, storing and replaying method and system based on a PLC. The method comprises the following steps: receiving a recording signal; according to the recording signal, starting to record data received by the PLC and the duration of each datum, wherein the data represent the opening and closing conditions of each switching value required to be recorded by certain equipment received by the PLC; storing the recorded data and the corresponding duration time to a storage module of the PLC; receiving a recording stop signal; and stopping recording the data received by the PLC and the duration of each data according to the recording stopping signal.

Description

Novel switching value signal recording, storing and replaying method and system based on PLC
Technical Field
The invention relates to the field of machine tools, in particular to a novel switching value signal recording, storing and replaying method and system based on a PLC.
Background
For the recording of switching values for devices, in particular machine tools, there are currently few universal, low-cost solutions. One device can only monitor and record the switching value signal of one device connected with the device, and cannot record the internal signal of the device. A switch quantity detection system is usually arranged in a numerical control system of a numerical control machine tool, but the problem of long-time monitoring cannot be solved, and monitoring data cannot be exported to the outside for analysis.
Disclosure of Invention
Aiming at the brand A PLC widely existing in a company, a nearly cost-free device switching value signal recording, storing and playback solution is provided. A low cost solution is provided for non-a brand PLC devices. Solves the problems of high cost, inconvenient use and weak universality in the prior art.
The scheme of the invention is as follows:
the invention provides a novel switching value signal recording, storing and replaying method based on a PLC (programmable logic controller), which comprises the following steps of:
receiving a recording signal;
according to the recording signal, starting to record data received by the PLC and the duration of each datum, wherein the data represent the opening and closing conditions of each switching value required to be recorded by certain equipment received by the PLC;
storing the recorded data and the corresponding duration time to a storage module of the PLC;
receiving a recording stop signal;
and stopping recording the data received by the PLC and the duration of each data according to the recording stopping signal.
Further, according to the stop recording signal, after stopping recording the data received by the PLC and the duration of each data, the method further includes:
receiving a playback signal;
playing back the stored data according to the first playback time of each stored data according to the playback signal; the first playback time is the duration;
receiving a playback stop signal;
and stopping the data playback according to the playback stop signal.
Further, according to the stop recording signal, after stopping recording the data received by the PLC and the duration of each data, the method further includes:
receiving a playback signal, a speed change signal and a playback multiple;
and playing back the stored data according to a second playback time of each stored data according to the playback signal and the variable speed signal, wherein the second playback time is the stored data divided by the playback multiple.
Further, the playback is loop playback.
The invention provides a novel switching value signal recording, storing and replaying system based on a PLC (programmable logic controller), which comprises:
a PLC, a device having a plurality of switches; the PLC includes: a storage module and a function module;
the pin of the PLC includes: a recording switch pin for inputting a recording signal and a recording stopping signal, a playback switch pin for inputting a playback signal and a playback stopping signal, a control pin for inputting a speed changing signal, a multiple pin for inputting a playback multiple, a reset pin, a pin for inputting data, and a pin for playing back data;
the storage module stores input data after inputting the recording signal;
the functional module is used for:
receiving a recording signal;
according to the recording signal, starting to record data received by the PLC and the duration of each datum, wherein the data represent the opening and closing conditions of each switching value required to be recorded by certain equipment received by the PLC;
controlling a storage module to store the recorded data and the corresponding duration;
receiving a recording stop signal;
controlling the storage module to stop storing the data received by the PLC and the duration of each data according to the recording stopping signal;
receiving a playback signal;
playing back the stored data according to the first playback time of each stored data according to the playback signal; the first playback time is the duration;
receiving a playback stop signal;
and stopping the data playback according to the playback stop signal.
Further, an I137.0 pin of the PLC is a recording switch pin; an I137.1 pin of the PLC is a playback switch pin; an I137.2 pin of the PLC is a control pin; the I137.3 pin, the I137.4 pin, the I137.5 pin and the I137.6 pin of the PLC are multiple pins; an I137.7 pin of the PLC is a reset pin; I136.0-I136.7 pins of the PLC are used as pins for inputting data; the Q137.0-Q137.7 pins of the PLC are used as the pins for playing back data.
Further, the storage module is DB 2324.
Further, the playback multiple includes: 2 times, 5 times, 10 times, 100 times, and any combination of the foregoing.
Has the advantages that: because the PLC records the time length of the change, the PLC has good recording effect on the low-frequency switching value change for a long time and the high-frequency switching value change for a short time. Since the data is stored in the DB block, the data can be easily extracted and analyzed. For high-frequency data, the playback can be decelerated, the maximum deceleration multiple can reach 10000 times, for low-frequency change, the playback can be accelerated, and the maximum acceleration multiple can reach 10000 times. The shortest recording time can reach 3 ms.
Drawings
FIG. 1 is a schematic diagram of a PLC provided by the present invention;
FIG. 2 is a diagram of a DB2324 provided by the present invention;
fig. 3 is a schematic diagram of a PLC provided in the present invention.
Detailed description of the invention
As shown in fig. 1, the main content of the invention is a packaged PLC functional block, which can be embedded in a PLC program or installed in other S7 series PLCs, and is monitored by a PLC switching value input/output module:
inputs 0-7 are 8 switching value inputs for recording. Outputs 0-7 are 8 switching outputs for playback.
A "record reset" will initialize the function block to keep track of all recorded content.
The "start recording" starts recording the state of inputs 0-7.
"begin playback" enables playback of the recording on outputs 0-7.
"speed-up-down" selects whether to speed-up playback or slow-down playback.
The '2-100 times' selects the speed of the accelerated and decelerated playback. These four options are multiplicative relationships. If 2 and 5 times are selected simultaneously, the actual acceleration and deceleration factor is 2 x 5 to 10 times.
If the switching value signal of the device is to be recorded, the switching value signal can be recorded by recording a key value pair of switching value state-duration-enable, and the scanning period of the PLC is extremely fast, so that the signal can be recorded only at the edge of the signal change. In the PLC, a DB block is used to store data, and key-value pairs are recorded in the DB block. The "enable" is a validity record corresponding to the "on-off state-duration".
The recording content is stored in the "DB 2324" as shown in fig. 2.
The data structure in DB2324 is divided into 8 groups, 0-7 groups. Each component is an array of temporary variables and constructs. The temporary variables are used for maintaining program operation, and the structure array is used for recording the switching value state.
Playback of the state:
the playback of the state is realized by outputting 0-7, and the playback can be displayed by a numerical control system screen, an HMI operation panel, a WinCC, a computer screen connected with a PLC, an output end indication of a PLC module and the like.
The principle of playback:
when the playback is started, the system records the time base of the playback, subtracts the current time from the time base to obtain the time difference in each scanning period, compares the time difference with the recorded duration of the DB2324, changes the output state according to the switch state recorded in the DB2324 when the length of the recording time is reached, resets the time base, and moves the array pointer backwards by one digit, and the process is circulated until the end of the enabling.
The acceleration and deceleration realization principle is as follows:
when acceleration is required, the "duration" in DB2324 is divided by a multiplication factor. When deceleration is required, the "duration" in DB2324 is multiplied by a multiplication factor. The acceleration and deceleration effect is achieved by prolonging or shortening the duration in this way.
Because the PLC records the time length of the change, the PLC has good recording effect on the low-frequency switching value change for a long time and the high-frequency switching value change for a short time. Since the data is stored in the DB block, the data can be easily extracted and analyzed. For high-frequency data, the playback can be decelerated, the maximum deceleration multiple can reach 10000 times, for low-frequency change, the playback can be accelerated, and the maximum acceleration multiple can reach 10000 times. The shortest recording time can reach 3 ms.
Examples of the applications
For a plant using Siemens S7-300PLC control as an example, it is necessary to monitor a set of frequently changing inputs (I136.0-I136.7), and it is desirable to use 8 outputs (Q137.0-Q137.7) for observation. I137.0-I137.7 as control inputs. The control signals are as follows in table 1:
TABLE 1
I137.0 rec_start Start recording
I137.1 play_start Starting playback
I137.2 SpeedUpDown Acceleration and deceleration
I137.3 x2 2 times of
I137.4 x5 5 times of
I137.5 x10 10 times of
I137.6 x100 100 times of
I137.7 var_reset Recording reset
I136.0–I136.7 input00–input 07 Monitored signal input
Q137.0–Q137.7 playout00–playout07 Playback signal output
And adding the packaged functional block 'FC _ var _ reorder [ FC2324 ]' and the data block 'DB _ var _ reorder [ DB2324 ]' into the PLC program block.
In the programming interface, FC _ var _ reorder [ FC2324] is inserted into the last row of OB1, as shown in FIG. 3.
After the insertion is completed, the device is started. Data reset is performed with "var _ reset" equal to 1, and reset is completed with "var _ reset" equal to 0. Recording is started with "rec _ start" equal to 1, and is maintained until "rec _ start" is equal to 0, and recording is completed. Playback is stopped by setting "play _ start" to 1 and "play _ start" to 0 from the first recording. The slow-down playback is performed with "SpeedUpDown" equal to 0, and the fast-up playback is performed with "SpeedUpDown" equal to 1.
The acceleration and deceleration multiples are controlled by I137.3-I137.6, and part of the multiples are shown in a table 2 as follows:
TABLE 2
x2 x5 x10 x100 Total multiple of
1 0 0 0 2
0 1 0 0 5
1 1 0 0 10
1 0 1 0 20
0 1 1 0 50
0 0 0 1 100
The monitoring data can be obtained in DB _ var _ reorder [ DB2324], and the monitoring record value part of input00 is as follows:
TABLE 3
sta00 (recording state) tim00 (duration) cka00 (Enable)
FALSE 1s_235ms TRUE
TRUE 180ms TRUE
FALSE 190ms TRUE
TRUE 240ms TRUE
By these data, the playback recorded value can be observed.
The PLC can be Siemens S7-300/400/1200/1500 and a PLC integrated in a Siemens numerical control system.

Claims (8)

1. A novel switching value signal recording, storing and replaying method based on a PLC is characterized by comprising the following steps:
receiving a recording signal;
according to the recording signal, starting to record data received by the PLC and the duration of each datum, wherein the data represent the opening and closing conditions of each switching value required to be recorded by certain equipment received by the PLC;
storing the recorded data and the corresponding duration time to a storage module of the PLC;
receiving a recording stop signal;
and stopping recording the data received by the PLC and the duration of each data according to the recording stopping signal.
2. The method of claim 1, wherein after stopping recording the data received by the PLC and the duration of each data in response to the stop recording signal, further comprising:
receiving a playback signal;
playing back the stored data according to the first playback time of each stored data according to the playback signal; the first playback time is the duration;
receiving a playback stop signal;
and stopping the data playback according to the playback stop signal.
3. The method of claim 1, wherein after stopping recording the data received by the PLC and the duration of each data in response to the stop recording signal, further comprising:
receiving a playback signal, a speed change signal and a playback multiple;
and playing back the stored data according to a second playback time of each stored data according to the playback signal and the variable speed signal, wherein the second playback time is the stored data divided by the playback multiple.
4. The method of claim 1, wherein playback is loop playback.
5. A novel switching value signal recording, storing and playback system based on a PLC is characterized by comprising:
a PLC, a device having a plurality of switches; the PLC includes: a storage module and a function module;
the pin of the PLC includes: a recording switch pin for inputting a recording signal and a recording stopping signal, a playback switch pin for inputting a playback signal and a playback stopping signal, a control pin for inputting a speed changing signal, a multiple pin for inputting a playback multiple, a reset pin, a pin for inputting data, and a pin for playing back data;
the storage module stores input data after inputting the recording signal;
the functional module is used for:
receiving a recording signal;
according to the recording signal, starting to record data received by the PLC and the duration of each datum, wherein the data represent the opening and closing conditions of each switching value required to be recorded by certain equipment received by the PLC;
controlling a storage module to store the recorded data and the corresponding duration;
receiving a recording stop signal;
controlling the storage module to stop storing the data received by the PLC and the duration of each data according to the recording stopping signal;
receiving a playback signal;
playing back the stored data according to the first playback time of each stored data according to the playback signal; the first playback time is the duration;
receiving a playback stop signal;
and stopping the data playback according to the playback stop signal.
6. The system of claim 5, wherein the I137.0 pin of the PLC is a record switch pin; an I137.1 pin of the PLC is a playback switch pin; an I137.2 pin of the PLC is a control pin; the I137.3 pin, the I137.4 pin, the I137.5 pin and the I137.6 pin of the PLC are multiple pins; an I137.7 pin of the PLC is a reset pin; I136.0-I136.7 pins of the PLC are used as pins for inputting data; the Q137.0-Q137.7 pins of the PLC are used as the pins for playing back data.
7. The system of claim 5, wherein the storage module is DB 2324.
8. The system of claim 5 or 6, wherein the playback multiple comprises: 2 times, 5 times, 10 times, 100 times, and any combination of the foregoing.
CN202010363043.1A 2020-04-30 2020-04-30 Novel switching value signal recording, storing and replaying method and system based on PLC Pending CN111580491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010363043.1A CN111580491A (en) 2020-04-30 2020-04-30 Novel switching value signal recording, storing and replaying method and system based on PLC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010363043.1A CN111580491A (en) 2020-04-30 2020-04-30 Novel switching value signal recording, storing and replaying method and system based on PLC

Publications (1)

Publication Number Publication Date
CN111580491A true CN111580491A (en) 2020-08-25

Family

ID=72124572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010363043.1A Pending CN111580491A (en) 2020-04-30 2020-04-30 Novel switching value signal recording, storing and replaying method and system based on PLC

Country Status (1)

Country Link
CN (1) CN111580491A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231082A (en) * 2020-10-15 2021-01-15 天津津航计算技术研究所 Switching value input and output batch management method under multi-task real-time operating system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004112186A (en) * 2002-09-17 2004-04-08 Canon Inc Signal recording and reproducing system
CN103076755A (en) * 2012-12-20 2013-05-01 中国南方电网有限责任公司调峰调频发电公司天生桥水力发电总厂 Method for realizing large-capacity sequence-of-event (SOE) record based on program logic controller (PLC) device
CN106326155A (en) * 2016-08-19 2017-01-11 南京理工大学 Multi-bus data recording and playback device and method
CN108046131A (en) * 2017-10-27 2018-05-18 盐田国际集装箱码头有限公司 A kind of crane operation state back method and playback system
CN108249240A (en) * 2018-01-18 2018-07-06 上海三荣电梯制造有限公司 A kind of method that can detect record elevator status data automatically

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004112186A (en) * 2002-09-17 2004-04-08 Canon Inc Signal recording and reproducing system
CN103076755A (en) * 2012-12-20 2013-05-01 中国南方电网有限责任公司调峰调频发电公司天生桥水力发电总厂 Method for realizing large-capacity sequence-of-event (SOE) record based on program logic controller (PLC) device
CN106326155A (en) * 2016-08-19 2017-01-11 南京理工大学 Multi-bus data recording and playback device and method
CN108046131A (en) * 2017-10-27 2018-05-18 盐田国际集装箱码头有限公司 A kind of crane operation state back method and playback system
CN108249240A (en) * 2018-01-18 2018-07-06 上海三荣电梯制造有限公司 A kind of method that can detect record elevator status data automatically

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231082A (en) * 2020-10-15 2021-01-15 天津津航计算技术研究所 Switching value input and output batch management method under multi-task real-time operating system

Similar Documents

Publication Publication Date Title
US6008735A (en) Method and system for programming a remote control unit
CN111580491A (en) Novel switching value signal recording, storing and replaying method and system based on PLC
CN101334651B (en) Programable controller and its channel selection method
US4104731A (en) Asynchronous coupling of data between a word-oriented I/O module and the memory of a programmable controller
CN107247650A (en) A kind of servo drive system long-range monitoring method
GB2309804A (en) Acquiring data
US9696712B2 (en) Numerical control device having function of simultaneously executing plurality of commands using data in table format
US5189604A (en) Distributed logic control system and method
US20040100468A1 (en) Method and device for optimising a test programme
US3846761A (en) Positioning controlling apparatus
JPS60118906A (en) Method and apparatus for injecting nc data
KR20200006504A (en) Control system, control device, and program
JP2724492B2 (en) Data logger
US5157508A (en) Television signal equipment assignment matrix including passive switching
US20230198798A1 (en) Method for data communication
JPH1055214A (en) Control method for industrial robot
CN115328057A (en) DCS variable monitoring based historical data storage method and device
KR100449017B1 (en) A High Speed Logging Method for Real Time Process Data
JPH05342698A (en) Device and method for retrieving abnormal operation of video tape recorder
JPH03271678A (en) Control system for defrosting
KR100188948B1 (en) Random access examination method of compact disc driver
JP2003001685A (en) Molding technique collecting device
SU1520523A2 (en) Channel simulator
SU1381429A1 (en) Multichannel device for programmed control
SU1374395A1 (en) Device for controlling stepping motor

Legal Events

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

Application publication date: 20200825