$softp_end is set by the software when it is installed
Generate EMZ selection box and select welding tongs
DEFFCT INT SetDlgMsg()
DECL KrlMsg_T Msg
DECL KrlMsgPar_T Par[3]
DECL KrlMsgOpt_T Opt
DECL KrlMsgDlgSK_T SK[7]
INT nHandle, nAnswer
Execute EMZ in T2 mode
Msg = { Modul[] "vw_emz", Nr 10, Msg_txt[] "Antriebsschnittstelle selektieren"} Prompt message bar "EMZ uses the tool number for measurement"
SK[1]={ Sk_Type #VALUE, Sk_txt[] "1"} Generated option button
SK[2]={ Sk_Type #VALUE, Sk_txt[] "2"}
SK[3]={ Sk_Type #VALUE, Sk_txt[] "3"}
SK[4]={ Sk_Type #VALUE, Sk_txt[] "4"}
SK[5]={ Sk_Type #VALUE, Sk_txt[] "5"}
SK[6]={ Sk_Type #VALUE, Sk_txt[] "6"}
SK[7]={ Sk_Type #VALUE, Sk_txt[] "7"}
Choose the welding tongs
Opt = { VL_Stop True, Clear_P_Reset True, Log_To_DB FALSE } Information property settings
nHandle = Set_KrlDlg (Msg, Par[],SK[], Opt) Activate message prompt
If (nHandle>0)Then
While (Exists_KrlDlg(nHandle, nAnswer)) Close the dialog window
Wait sec 0.1
Someone
Endif
Return(nAnswer) The value of the selected button is emitted
;
ENDFCT
/////////////////////////////////////////////////////////////
Declaration: 3 position variables, a real variable and an integer variable
E6AXIS GunPosAct, GunPosOpen, GunPosClose
REAL ActPos
INT what
VerBootfile=$softplcint[22]
while VerBootfile << span=""> 420
VwEmzMessage(7,#QuitMsg)
halt
old man
Generation of alarm information
repeat
DiNum=SetDlgMsg() A prompt box appears and select the return value 1-7
EaxNum = $softplcint[DiNum] - 6 Calculation of welding clamp number: $softplcint[1]=7
if (($softplcint[DiNum] > 6) AND ($softplcint[DiNum]<< span=""> 13)) then
EaxNum = $softplcint[DiNum] - 6
else
VwEmzMessage(6,#NotifyMsg) If no selection is made, a message prompt will be issued
halt
endif
until EaxNum>0 with 1 welding clamp EaxNum=1
GunPosAct=$axis_act saves the current axis information to the current position variable
GunPosOpen=$axis_act saves the current axis information to the current welding gun opening position variable
GunPosClose=$axis_act Save the current axis information to the current welding gun closing position variable
SWITCH EaxNum Select the axis number corresponding to the clamp number.
CASE 0 If the clamp number entered is 0
HALT means stop
CASE 1 Clamp No. 1
GunPosOpen.E1=$softp_end[7]-20 Calculate the opening of the E1 axis at the opening position of the welding clamp $SOFTP_END[7]=120.0 -20
GunPosClose.E1=10 Calculate the closing degree of the E1 axis at the closed position of the welding gun 10 mm
CASE 2 Clamp No. 2
GunPosOpen.E2=$softp_end[8]-20 Get the maximum opening position
GunPosClose.E2=10 Close position
CASE 3 Clamp No. 3
GunPosOpen.E3=$softp_end[9]-20
GunPosClose.E3=10
CASE 4 Clamp No. 4
GunPosOpen.E4=$softp_end[10]-20
GunPosClose.E4=10
CASE 5 Clamp No. 5
GunPosOpen.E5=$softp_end[11]-20
GunPosClose.E5=10
CASE 6 Clamp No. 6
GunPosOpen.E6=$softp_end[12]-20
GunPosClose.E6=10
DEFAULT Stop the program after exceeding the input clamp number 6
HALT
ENDSWITCH End selection control
IF $MODE_OP==#T1 THEN When the robot's working mode changes to T1 mode
VwEmzMessage(3,#NotifyMsg) Prompt message: Wrong working mode, use T2 or external automatic
Repeat the loop prompt until the robot's working mode is not T1
wait sec 0.1
until ($mode_op<>#t1) until statement
ENDIF
IF $MODE_OP==#EX THEN External automatic mode
IF $OV_PRO<>100 THEN Robot is not at 100% speed
MerkOvPro = $OV_PRO
$OV_PRO=100 restores to 100% speed
ENDIF
ELSE is not an external automatic mode
IF $OV_PRO<>100 THEN Robot is not at 100% speed
VwEmzMessage(4,#NotifyMsg) prompt message: Robot speed must be 100%
repeat
wait sec 0.1
until ($ov_pro==100) until the robot speed reaches 100%
ENDIF
ENDIF
PTP $AXIS_ACT moves to the current position
PTP GunPosClose GunPosClose position
ActPos=GetActPos(DiNum) Get the current external axis position parameter
;-----------------------------------------------------------
DEFFCT REAL GetActPos(di:in)
INT of
REAL RetGunPos
REAL GunPos[7];
GunPos[1]=sig1_istpos Get the actual position of welding gun No. 1
GunPos[2]=sig2_istpos
GunPos[3]=sig3_istpos
GunPos[4]=sig4_istpos
GunPos[5]=sig5_istpos
GunPos[6]=sig6_istpos
GunPos[7]=sig7_istpos
SIGNAL sig1_sollpos $out[737] TO $out[751]
SIGNAL sig1_istpos $in[737] TO $in[751]
RetGunPos=GunPos[di] / 10 Expression of position feedback value
IF $IN[Sign[di]] THEN If there is E752, the expression of the position will be changed to another one.
RetGunPos=RetGunPos * (-1)
ENDIF
;
RETURN(RetGunPos)
ENDFCT
---------------------------ENDFCT-----------------------
IF ABS(10-ActPos) > 1 THEN
The deviation range of the feedback value of the external axis shall not be less than 5 ABS takes the absolute value, so we can determine that the opening of the welding clamp is 10mm when closing, and the deviation between the theoretical value and the actual value cannot exceed 1mm.
VwEmzMessage(5,#QuitMsg,EaxNum) Prompt message: The external axis information is incorrect
WHILE (ABS(10-ActPos) > 1) The loop starts when the opening deviation value is greater than 1.
wait sec 0.2
I'M IN THE HOUSE
ENDIF
$softplcint[20]=DiNum 例: $softplcint[20]=1
FOR co = 1 TO 10 Loop 10 times to open the switch to the small port
PTP GunPosOpen------------Operating welding gun opening position
PTP GunPosClose C_PTP ---------operating welding gun closed position
ENDFOR
$softplcint[20]=-10 changes the value of $softplcint[20]
PTP GunPosAct Return to the starting position
WAIT SEC 0.2 Wait for 0.2 seconds
$softplcint[20]=0
TotzeitAlt = SysBusDelay[EaxNum] Save the last time value
TotzeitNeu = $softplcint[31] Get the time value of this calculation
SysBusDelay[EaxNum] = TotzeitNeu Save the current time value to SysBusDelay[]
$softplcint[EaxNum+7]=TotzeitNeu Save the current time value to the soft PLC
FOR co = 1 TO 20
IpoVerteilung[co]=$softplcint[99+co]
ENDFOR Assign to array
TraceTime.YEAR=$Date.YEAR records year, month, day, hour, minute, and second
TraceTime.MONTH=$Date.MONTH
TraceTime.DAY=$Date.DAY
TraceTime.HOUR=$Date.HOUR
TraceTime.MIN=$Date.MIN
TraceTime.SEC=$Date.SEC
RobSn=$KR_SERIALNO $KR_SERIALNO : The serial number of the robot is stored in the RDC card
TraceLength=$softplcint[34]
IF $mode_op <> #EX THEN The robot is not in external automatic mode
VwEmzMessage(1,#NotifyMsg,DiNum) Prompt message: The last debugging time is TotzeitAlt times 12 ms, etc.
VwEmzMessage(2,#NotifyMsg,DiNum) Prompt message: The debugging time is TotzeitNeu times 12 ms or so
ENDIF
Calculate the difference time and give it to the soft PLC
Pull overtravel fault:
GLOBAL REAL max_sf=15.0 Maximum deviation value
$softplcreal[20]=max_sf
sf_prog_status Delayed fault program status
$ASYNC_STATE Additional axis status
Therefore, we can conclude that one of the two control units of the pulling fault is the difference value max_sf=15.0, and the other difference time TotzeitNeu is given to the PLC. Therefore, the conditions for the pulling fault in the program are generated.
Other command functions in EMZ:
------------VwEmzMessage----------Volkswagen EMZ message-
DEF VwEmzMessage(msg_nr :IN, MsgTyp :IN, Param :IN )
INT msg_nr, msgtypnr, Param
DECL _MsgType MsgTyp
DECL KrlMsg_T USER_MSG
DECL KrlMsgPar_T Par[3]
DECL KrlMsgOpt_T Opt
DECL State_T st_ausg
INT nHandle, Answer, offset
USER_MSG = { Modul[] "vw_emz", Nr -1, Msg_txt[] " "} prompt message format
Opt = { VL_Stop False, Clear_P_Reset False, Log_To_DB TRUE }
IF Varstate("Param")==#initialized then
Get the state of the input variable "Param" if it is initialized
SWITCH Param
CASE 1
Par[1] = { Par_type #Value, Par_int 1 }
CASE 2
Par[1] = { Par_type #Value, Par_int 2 }
CASE 3
Par[1] = { Par_type #Value, Par_int 3 }
CASE 4
Par[1] = { Par_type #Value, Par_int 4 }
CASE 5
Par[1] = { Par_type #Value, Par_int 5 }
CASE 6
Par[1] = { Par_type #Value, Par_int 6 }
CASE 7
Par[1] = { Par_type #Value, Par_int 7 }
DEFAULT
Par[1] = { Par_type #Value, Par_txt[] " " }
ENDSWITCH
ELSE
Par[1] = { Par_type #Value, Par_txt[] " " }
ENDIF
IF NOT MsgIsSet(msg_nr) THEN If the feedback value of the message category is not set by MsgIsSet
USER_MSG.Nr = msg_nr message number
SWITCH msg_nr
CASE 1 Information prompt number 1
OFFSET=0
SWRITE(USER_MSG.MSG_TXT[],ST_AUSG,OFFSET,"Totzeit Achse%d vor Testlauf= %d *12ms",(EaxNum+6), TotzeitAlt) Timeline before test run
CASE 2 Information prompt number 2
OFFSET=0
SWRITE(user_msg.msg_TXT[],ST_AUSG,OFFSET,"Totzeit Achse%d nach Testlauf= %d *12ms ",(EaxNum+6), TotzeitNeu) Timeline after the test run
CASE 3 Information prompt number 3
USER_MSG.MSG_TXT[]="false Betriebsart - T2 or EXT incorrectly" Wrong operating mode - T2 or EXT required
CASE 4 Information prompt number 4
USER_MSG.MSG_TXT[]="Override auf 100% erforderlich" needs to be overwritten to 100%
CASE 5 Information prompt number 5
USER_MSG.MSG_TXT[]="Externe Achse%1 follows" External axis%1 does not follow
CASE 6 Information prompt number 6
USER_MSG.MSG_TXT[]="Unassigned additional axis - Additional axis"
CASE 7 Information prompt number 7
USER_MSG.MSG_TXT[]="Version bootfile is not supported"
Unsupported version startup file
DEFAULT
USER_MSG.MSG_TXT[]="unknown message" unknown message
ENDSWITCH
SWITCH MsgTyp starts displaying messages
CASE #StateMsg
nMsgHandle[msg_nr] = Set_KrlMsg (#State, USER_MSG, Par[], Opt)
; Status message output
CASE #QuitMsg
Previous article:Let you know what a perfect PLC program looks like?
Next article:The differences and similarities between high-frequency inverters and industrial frequency inverters
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- PlanAhead14.7
- Analog electronics elective test + DC and AC parameters
- Introduction to TI_DSP link command file (*.cmd)
- TI CC1310 sub1G SDK development unique identification number MAC address reading
- FPGA Implementation of ECT Image Reconstruction Algorithm
- Why does the AD21 shortcut key not work after modification?
- [ESP32-Audio-Kit Audio Development Board Review] Basic Use of the Development Board
- Can the SSTX and SSRX of USB3.0 be identified and adjusted? Is it necessary to cross it when making a schematic diagram?
- The battery output is DC3.0V after LDO. Why does it slowly rise from 0V to 3V when tested with an oscilloscope?
- Four advantages and applicable fields of LoRaWAN