Settings in DEF KRL() file program:
EKI_Check(Ret:IN,Type:IN,strChannelName[]:IN) – Checks if there are any errors in the function
Ethernet KRL outputs a message on the smartHMI in the event of any error. The automatic output of the message can be disabled.
Check if there are any errors when running the function:
The error number will be read and the corresponding information will be output on the smartHMI.
Optional: If a channel name is given, an error parameter will be asked when receiving data.
Parameter 1 EKI_STATUS
The return value of the function being checked
Parameter 2 Type: ENUM
Type of information output on smartHMI:
#NOFY: Prompt message
#STATE: Status information
#QUIT: Confirm information
#WTING: Waiting for information
Parameter 3 (Optional) Type: CHAR Name of the open channel that should be checked
Example: EKI_CHECK(RET,#QUIT)
If automatic message output has been disabled, it is recommended to use EKI_CHECK() to check if there are any errors while running the function:
The error number will be read and the corresponding information will be output on the smartHMI.
If a channel name is given in EKI_CHECK(), it is asked whether there are errors when receiving data.
Each time EKI_CHECK() is called, the routine KRC:R1TPEthernetKRLEthernetKRL_USER.SRC is called. User-specific error responses can be set in this routine.
EKI_Open RET = EKI_Open(CHAR[]) Open the initialized channel
When the external system is configured as a server, EKI_Open() interrupts program execution until the connection to the external system is active.
The connection can only be restored using the EKI_OPEN() function.
When EKI is configured as a client, EKI connects with an external system (= server).
When EKI is configured as a server, EKI waits for connection requests from external systems (= clients).
RET = EKI_Open(channel name)
RET Feedback value, type: EKI_STATUS
Example RET = EKI_Open("Channel_1")
Program Structure:
GLOBALDEFFCKI_STATUS EKI_Open(strChannelName[]:IN)
DECLCHAR strChannelName[] Channel name variable declaration
DECLSTATE_T Stat
DECLMODUS_T Mode
DECLEKI_STATUS Ret
Mode = #SYNC Operating mode: The CWRITE statement is considered to have been executed as soon as the partner has taken the transmitted data from the receive buffer.
Ret = EKI_NULL_STATUS
CONTINUE
CWRITE($FCT_CALL,Stat,Mode,"EFC_eki_Open",strChannelName[])
Use "EFC_eki_Open" to open the channel name of the EthernetKRL file
Ret.Msg_No = Stat.Msg_No
IF(Ret.Msg_No == 0) THEN If the feedback status message number is 0, the connection is considered successful.
Ret.Connected = true
ENDIF
RETURN Ret
ENDFCT
Through the command channel $FCT_CALL
CWRITE
CWRITE calls cannot be made in triggers. Instead, CWRITE can be used in trigger subroutines.
CWRITE writes data to a loaded external module of type LD_EXT_OBJ. In the loaded external module of type LD_EXT_FCT, CWRITE calls a function.
CWRITE writes commands to command channel $CMD.
CWRITE calls a function via the command channel $FCT_CALL.
CWRITE triggers a premature run stop.
CWRITE ( HandleΙ$CMDΙ$FCT_CALL, State, Mode, Fmat, Var1 < ,
…, Var10 >)
HandleΙ type: INT
Processes the variable passed by COPEN to CWRITE to identify the channel to the external module.
$CMD predefined handle variable, used to write command channel $CMD
$FCT_CALL predefined handle variable, used to write command channel $FCT_CALL
State type: STATE_T; automatically returns to the CWRITE state
Mode type: MODUS_T; write mode must be initialized.
Format type: CHAR array
The variables Var1…Var10 must be converted to text strings before they can be written to the channel. The format defines the format of the text to be generated. A format must be specified for each variable.
Var1 … Var10
Variables whose data are written to the channel. Each statement can have up to 10 variables.
For external module of type LD_EXT_FCT and command channel $FCT_CALL: Variables Var1…Var10 contain the passed parameters of the function called with Format.
Format : read/write "format" variable
$FCT_CALL
Management number (handle) of command channel $FCT_CALL
The CWRITE() function can be used to call a function via the $FCT_CALL command channel. The variable itself is write-protected.
Function of command channel $FCT_CALL
Use CWRITE to call the file system functions of the command channel $FCT_CALL. When making the call, the function parameters must be transferred to CWRITE as Var1 ... Var10. In addition, the write mode transmitted by CWRITE must be #SYNC.
File system functions can be called from either the robot interpreter or the submission interpreter. Opening a file from one interpreter and then accessing it from another, such as writing to it or closing it again, is not allowed.
-
Editor: Huang Fei
Previous article:Coherent and TriEye collaborate on shortwave infrared imaging
Next article:How to pause a running GRAPH program?
- Popular Resources
- Popular amplifiers
- Using IMU to enhance robot positioning: a fundamental technology for accurate navigation
- Researchers develop self-learning robot that can clean washbasins like humans
- Universal Robots launches UR AI Accelerator to inject new AI power into collaborative robots
- The first batch of national standards for embodied intelligence of humanoid robots were released: divided into 4 levels according to limb movement, upper limb operation, etc.
- New chapter in payload: Universal Robots’ new generation UR20 and UR30 have upgraded performance
- Humanoid robots drive the demand for frameless torque motors, and manufacturers are actively deploying
- MiR Launches New Fleet Management Software MiR Fleet Enterprise, Setting New Standards in Scalability and Cybersecurity for Autonomous Mobile Robots
- Nidec Drive Technology produces harmonic reducers for the first time in China, growing together with the Chinese robotics industry
- DC motor driver chip, low voltage, high current, single full-bridge driver - Ruimeng MS31211
- 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
- [Review of Arteli Development Board AT32F421] + Have a good understanding of the power supply voltage
- 【Development and application based on NUCLEO-F746ZG motor】4. Share information
- encryption
- Motor control basics - timer basics and PWM output principles
- 5G base stations consume too much electricity. How can we overcome this energy consumption issue?
- Microwave equipment high voltage transformer with schematic diagram
- Who knows RALINK RTP 3352 QA TOOL
- Architecture and Implementation of ADSP-2106X SHARC DSPs Software Simulator
- LED flashing drive circuit diagram analysis
- EEWORLD University----[High Precision Laboratory] Interface