CN101673102A - Method for controlling port by PLC in numerically-controlled machine tool system - Google Patents

Method for controlling port by PLC in numerically-controlled machine tool system Download PDF

Info

Publication number
CN101673102A
CN101673102A CN200910196297A CN200910196297A CN101673102A CN 101673102 A CN101673102 A CN 101673102A CN 200910196297 A CN200910196297 A CN 200910196297A CN 200910196297 A CN200910196297 A CN 200910196297A CN 101673102 A CN101673102 A CN 101673102A
Authority
CN
China
Prior art keywords
port
plc
address
timer
information
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
CN200910196297A
Other languages
Chinese (zh)
Other versions
CN101673102B (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.)
Shanghai Naikai Technology Co ltd
SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO LTD
Original Assignee
SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Shanghai Naikai Electronic Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI WEIHONG TECHNOLOGYCO Ltd, Shanghai Naikai Electronic Science and Technology Co Ltd filed Critical SHANGHAI WEIHONG TECHNOLOGYCO Ltd
Priority to CN2009101962972A priority Critical patent/CN101673102B/en
Publication of CN101673102A publication Critical patent/CN101673102A/en
Application granted granted Critical
Publication of CN101673102B publication Critical patent/CN101673102B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

The invention discloses a method for controlling a port by a PLC in a numerically-controlled machine tool system, which comprises the following steps: (1) obtaining current port information comprisingport address information from a timer by the PLC; (2) processing the port by a PLC command through the PLC according to the obtained port information; and (3) returning the obtained port informationto a drive R0; obtaining the information of the current port by the circular scanning of the timer, then carrying out the corresponding control processing by the PLC according to the obtained port information to control the output of the port and the detection of an input port effectively. The invention has simple and convenient processing procedure, stable and reliable working performance and extensive application range and is more economical.

Description

The method of PLC control port in a kind of numerically-controlled machine tool system
Technical field
The present invention relates to the numerically-controlled machine tool system field, the method for PLC control port in particularly a kind of numerically-controlled machine tool system of numerically-controlled machine tool system port controlling technical field.
Background technology
Manufacturing industry is the basic industry of national economy, and the height of manufacturing level is an important symbol of weighing an industrial development degree of country, and the height of numerically-controlled machine level is concerning the height of national manufacturing industry level.
In the prior art, we can utilize digital control system to cut accordingly or welding etc., when utilizing lathe to carry out the high-pressure water-jet cutting machine operation, perhaps during other cutting engravings, sometimes need to open the output of certain port, water valve during for example water cuts, high pressure, sand valve etc., simultaneously also need some the time close the output of some ports, simultaneously also need some input is detected, the result who detects is handled accordingly, as some warnings; Because with a kind of cutting machine, but the input of the different needed ports of producer, output neither be identical, if run into the different just exploitations again of inputing or outputing of port, that just needs the cost great amount of manpower, and financial resources, this method is obviously uneconomical.
Therefore, press for a kind ofly on original basis, only need to revise output and method that some configuration file just can reach control port importing and port being detected.
Summary of the invention
The method that the purpose of this invention is to provide PLC control port in a kind of numerically-controlled machine tool system has overcome above-mentioned shortcoming of the prior art, effectively the output of control port and the detection of input port, processing procedure is simple and convenient, stable and reliable working performance, the scope of application is extensive, more economically.
The present invention solves the technical scheme that its technical matters takes:
The method of PLC control port is characterized in that in a kind of numerically-controlled machine tool system, and it comprises the steps:
(1) PLC obtains the current port information that comprises port address information from timer Timer;
(2) by the PLC instruction port is handled according to the port information that obtains by PLC;
(3) port information that obtains is returned to driving R0.
In one embodiment of the invention, timer Timer obtains current port information by the mode of scan round, and the scan period of timer Timer is per 20 milliseconds of run-downs, guarantees the degree of accuracy of port information.
In one embodiment of the invention, described port is divided into input port and output port, and described port addresses according to channel mode, 32 numberings of each passage, and promptly each passage can hold 32 ports.
In one embodiment of the invention, described port address is made up of channel number and bit address, and bit address is low 2 (decimal system), and channel number is high 3 (decimal systems), and the Base Serial Number of described channel number and bit address all is 0.
In one embodiment of the invention, described port also comprises the integrated circuit board port, and described integrated circuit board port is that unit forms a Port with 8, and each Port has a Port offset address.
Further, offset address is that 0 Port represents the invalid address, and the address, corresponding port is also invalid.
Further, per 4 input type Port just can form an input channel, and per 4 output type Port form an output channel, and the integrated circuit board port mapping is become port address.
In one embodiment of the invention, described method also comprises the detection to port, and when the port that scans some characteristic as timer Timer had output, PLC can produce events corresponding and report to the police, promptly stops.
The method of PLC control port in the numerically-controlled machine tool system of the present invention, obtain to work as the information of front port by timer scan round, carrying out control corresponding by PLC according to the port information that obtains again handles, the effectively output of control port and the detection of input port, processing procedure is simple and convenient, stable and reliable working performance, the scope of application is extensive, more economically.
Description of drawings
Fig. 1 is the FB(flow block) of the method for PLC control port in the numerically-controlled machine tool system of the present invention.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
Embodiment
As shown in Figure 1, the method for PLC control port in the numerically-controlled machine tool system of the present invention, it comprises the steps:
(1) PLC obtains the current port information that comprises port address information from timer Timer;
(2) by the PLC instruction port is handled according to the port information that obtains by PLC;
(3) port information that obtains is returned to driving R0.
In the present invention, timer Timer obtains current port information by the mode of scan round, and the scan period of timer Timer is per 20 milliseconds of run-downs, guarantees the degree of accuracy of port information.
In the present invention, described port is divided into input port and output port, and described port addresses according to channel mode, 32 numberings of each passage, and promptly each passage can hold 32 ports.
Wherein, in the present embodiment, input port and output port have respectively been divided 100 passages, and this just means that system can hold 3200 physics input ports and 3200 physics output ports; Described port address is made up of channel number and bit address, and bit address is low 2 (decimal system), and channel number is high 3 (decimal systems), and the Base Serial Number of described channel number and bit address all is 0; Wherein the channel number scope of input port is 000~099; The channel number scope of output port is 100~199.
PLC address 02308 expression channel number is 23 the 8th bit address input port; PLC address 11227 expression channel numbers are 112 the 27th bit address output port.
In the present invention, described port also comprises the integrated circuit board port, and described integrated circuit board port is that unit forms a Port with 8, and each Port has a Port offset address, and offset address is that 0 Port represents the invalid address, and the address, corresponding port is also invalid; Add a base address number when actual motion, can for integrated circuit board physical port address, can notify driver number what to be for the base address simultaneously.
Per 4 input type Port just can form an input channel, and per 4 output type Port form an output channel, and the integrated circuit board port mapping is become port address.
Such as:
m_nInPortAddr[0]=0x0030 ;BIO1_PA
m_nInPortAddr[1]=0x0032 ;BIO1_PC
m_nInPortAddr[2]=0x0000 ;BIO3_PB
m_nInPortAddr[3]=0x0000 ;BIO3_PC
m_nInPortAddr[4]=0x0000 ;BIO3_PA
m_nInPortAddr[5]=0x70 ;BIO2_PA
m_nOutPortAddr[0]=0x31 ;BIO1_PB
m_nOutPortAddr[1]=0x72 ;BIO2_PC
m_nOutPortAddr[2]=0x71 ;BIO2_PB
Wherein, be designated as 6 input Port of 0~5 down, form the 0th passage for preceding four, latter two forms the 1st passage, and equal sign the right is the offset address of Port.So port address 00010 expression m_nInPortAddr[1] the 2nd port be the 3rd of BIO1_PC (offset address 0x32), i.e. BIO1_PC.2.Must understand addressing since 0, each Port has 8; Port address 00108 is represented the 1st of BIO2_PA.
Be designated as 3 output Port of 0~3 down, form low 24 ports (10000~10023) of the 100th passage (the initial channel number of output channel), so the 4th port, the i.e. BIO1_PB.3 of 10003 expression BIO1_PB (offset address 0x31).
Processing to output port, in PLC language port handling procedure, some effective output ports are handled, we can utilize port address to handle these ports, and we will utilize the PLC instruction that port is handled, and will write from memory port in certain location or time output.
Input port is detected, in PLC language port handling procedure some effective input ports are handled, we can utilize port address to handle these ports, when reading some input port output are arranged, utilize PLC instruction to do some relevant things, as function such as reporting to the police, promptly stop.
Timer scanning port information, after we utilized the PLC program to carry out inspection to the processing of output port and input port, the master routine that constantly scans the PLC program can carry out record with port status, so that transmission.
Port message is returned driving, the port information that obtains is given driven the processing of being correlated with.
More than show and described ultimate principle of the present invention and principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in the foregoing description and the instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications; these changes and improvements all fall in the claimed scope of the invention, and the claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (8)

1, the method for PLC control port in a kind of numerically-controlled machine tool system is characterized in that it comprises the steps:
(1) PLC obtains the current port information that comprises port address information from timer Timer;
(2) by the PLC instruction port is handled according to the port information that obtains by PLC;
(3) port information that obtains is returned to driving R0.
2, method according to claim 1 is characterized in that, timer Timer obtains current port information by the mode of scan round, and the scan period of timer Timer is per 20 milliseconds of run-downs, guarantees the degree of accuracy of port information.
3, method according to claim 1 is characterized in that, described port is divided into input port and output port, and described port addresses according to channel mode, 32 numberings of each passage, and promptly each passage can hold 32 ports.
4, method according to claim 1 is characterized in that, described port address is made up of channel number and bit address, and bit address is low 2 (decimal system), and channel number is high 3 (decimal systems), and the Base Serial Number of described channel number and bit address all is 0.
5, method according to claim 1 is characterized in that, described port also comprises the integrated circuit board port, and described integrated circuit board port is that unit forms a Port with 8, and each Port has a Port offset address.
6, method according to claim 5 is characterized in that, offset address is that 0 Port represents the invalid address, and the address, corresponding port is also invalid.
7, method according to claim 5 is characterized in that, per 4 input type Port just can form an input channel, and per 4 output type Port form an output channel, and the integrated circuit board port mapping is become port address.
8, method according to claim 1 is characterized in that, described method also comprises the detection to port, and when the port that scans some characteristic as timer Timer had output, PLC can produce events corresponding and report to the police, promptly stops.
CN2009101962972A 2009-09-24 2009-09-24 Method for controlling port by PLC in numerically-controlled machine tool system Expired - Fee Related CN101673102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101962972A CN101673102B (en) 2009-09-24 2009-09-24 Method for controlling port by PLC in numerically-controlled machine tool system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101962972A CN101673102B (en) 2009-09-24 2009-09-24 Method for controlling port by PLC in numerically-controlled machine tool system

Publications (2)

Publication Number Publication Date
CN101673102A true CN101673102A (en) 2010-03-17
CN101673102B CN101673102B (en) 2011-09-07

Family

ID=42020355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101962972A Expired - Fee Related CN101673102B (en) 2009-09-24 2009-09-24 Method for controlling port by PLC in numerically-controlled machine tool system

Country Status (1)

Country Link
CN (1) CN101673102B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096390A (en) * 2011-01-30 2011-06-15 深圳市合信自动化技术有限公司 Programmable logic controller, program compiler, compiling system and method
CN102156445A (en) * 2011-03-01 2011-08-17 上海维宏电子科技有限公司 Method for realizing logistic diagnosis of port in numerical control system
CN112792178A (en) * 2020-12-21 2021-05-14 上海维宏电子科技股份有限公司 Pipe bending method of numerical control pipe bender

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096390A (en) * 2011-01-30 2011-06-15 深圳市合信自动化技术有限公司 Programmable logic controller, program compiler, compiling system and method
CN102096390B (en) * 2011-01-30 2014-04-09 深圳市合信自动化技术有限公司 Programmable logic controller, configuration program compiler and method
CN102156445A (en) * 2011-03-01 2011-08-17 上海维宏电子科技有限公司 Method for realizing logistic diagnosis of port in numerical control system
CN102156445B (en) * 2011-03-01 2012-09-26 上海维宏电子科技股份有限公司 Method for realizing logistic diagnosis of port in numerical control system
CN112792178A (en) * 2020-12-21 2021-05-14 上海维宏电子科技股份有限公司 Pipe bending method of numerical control pipe bender
CN112792178B (en) * 2020-12-21 2022-07-12 上海维宏电子科技股份有限公司 Pipe bending method of numerical control pipe bender

Also Published As

Publication number Publication date
CN101673102B (en) 2011-09-07

Similar Documents

Publication Publication Date Title
CN104932421B (en) A kind of work of numerical control machine process CPS modeling methods based on instruction domain analysis
CN105549539B (en) Layout for drilling control system
CN101859135B (en) Method and device for controlling distributed automation system
CN101114174A (en) Built-in type 4 axis sport controller
CN101673102B (en) Method for controlling port by PLC in numerically-controlled machine tool system
CN101436050A (en) Graphic interactive programming unit and method for open type numerical control system
CN106909123B (en) Control programming auxiliary assembly
CN103019156B (en) Automatic rotating angle control method for cutting bed
CN201742359U (en) Double-shaft direct current servo driver
CN102615161B (en) Control system of general two-dimensional numerical control spinning lathe
CN103317507A (en) Chinese teaching method of manipulator motion controller
CN201097202Y (en) A graphic interactive programming device
CN103116315A (en) Control method for achieving cutting tool radius compensation overall interference in numerical control system
CN104730961A (en) Intelligent industrial control machine
CN102478852A (en) Method for controlling PLC (programmable logic controller) ports of numerical control machine system
CN101650562B (en) Method for realizing PLC port control by C language in digital control machine tool system
CN107350633A (en) A kind of long-range networked control systems based on ZigBee
CN102478801A (en) Method for port control in numerically-controlled machine tool system with C language instead of PLC (programmable logic controller)
CN1936746A (en) Inlaid numerical control system G code interpretative device based on ARM
CN201084005Y (en) Embedded machine tool numerical control system based on ARM technology
CN201974672U (en) Steel pipe hollow-bending forming machine set pass adjustment control system
CN204536861U (en) For the digital control system of numerically-controlled machine
CN106444641A (en) Combined woodworking processing equipment with independent A/D (analog/digital) conversion module
CN103163828A (en) Control method and control system of pulse width modulation (PWM) signals and numerical control laser processing machine tool
CN101149595A (en) Production executive system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Free format text: FORMER OWNER: SHANGHAI WEIHONG TECHNOLOGY CO., LTD.

Effective date: 20120514

Owner name: SHANGHAI WEIHONG TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: SHANGHAI NAIKAI ELECTRONIC SCIENCE AND TECHNOLOGY CO., LTD.

Effective date: 20120514

C41 Transfer of patent application or patent right or utility model
C56 Change in the name or address of the patentee
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 201114 MINHANG, SHANGHAI TO: 201108 MINHANG, SHANGHAI

CP01 Change in the name or title of a patent holder

Address after: 201114, G, room 115, 778 Yue Yue Road, Shanghai, Minhang District

Co-patentee after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Patentee after: Shanghai Naikai Technology Co.,Ltd.

Address before: 201114, G, room 115, 778 Yue Yue Road, Shanghai, Minhang District

Co-patentee before: Shanghai Weihong Electronic Technology Co.,Ltd.

Patentee before: Shanghai Naikai Technology Co.,Ltd.

TR01 Transfer of patent right

Effective date of registration: 20120514

Address after: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Patentee after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 201114, G, room 115, 778 Yue Yue Road, Shanghai, Minhang District

Co-patentee before: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Patentee before: Shanghai Naikai Technology Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110907

Termination date: 20200924

CF01 Termination of patent right due to non-payment of annual fee