9.8.8. Adjust command
Click the “Adjust” icon to enter the Adjust command editing interface.
This command adaptively adjusts the posture of the welding torch for the scene of welding tracking. After recording the three corresponding posture points, add the posture adaptive adjustment command according to the actual direction of the robot’s movement. See Robot Peripherals chapter for details.
Figure 9.8-8 Adjust command interface
9.9. Force control command interface
Figure 9.9 Force control command interface
9.9.1. F/T command
Click the “F/T” icon to enter the F/T command editing interface.
The command includes nine commands: FT_Guard (collision detection), FT_Control (constant force control), FT_Compliance (compliance control), FT_Spiral (spiral insertion), FT_Rot (rotation insertion), FT_Lin (linear insertion), FT_FindSurface (surface positioning), FT_CalCenter (center positioning), FT_Click (click force detection), see the robot peripherals chapter for details.
Figure 9.9-1 F/T command interface
9.9.1.1. Force Control Rotation Insertion Optimization Function
9.9.1.1.1. Overview
The force control rotation insertion function is typically used for undertaking rotation insertion actions. Before running the action, the robot end-effector needs to be moved to a fully aligned taught hole position. According to the application scenario, set corresponding motion parameters and an external force detection failure handling strategy. After completion, if the detected external force does not reach the set threshold, the user can independently choose to stop the entire program (function configured as “Error”, interface displays red error) or choose to continue motion (function configured as “Warning”, interface displays yellow warning).
9.9.1.1.2. Operation Process
Step1: Click sequentially on “Teach Program” -> “Program Programming” -> “Force Control Set” -> “Rot” instruction. Set corresponding motion parameters according to the actual application scenario. The external force detection failure handling strategy can be set to “Error” or “Warning”. When configured as “Error”, if the robot detects that the external force is always less than the set threshold and the set rotation angle has been reached, an error will be reported on the interface and subsequent program execution will stop. When configured as “Warning”, if the robot detects that the external force is always less than the set threshold and the set rotation angle has been reached, a warning will be displayed on the interface and subsequent program execution will continue.
Figure 9.9-2 Force Control Rotation Insertion Parameter Configuration
Step2: The force control rotation insertion function needs to be combined with the “FT_Control” function for motion, with the same motion parameters set. Typical Lua programs with the external force detection failure handling strategy set to “Error” and “Warning” are shown in the figures below respectively.
Figure 9.9-3 Typical Lua Program Configured as “Error”
Figure 9.9-4 Typical Lua Program Configured as “Warning”
9.9.2. Torque command
Click the “Torque” icon to enter the Torque command editing interface.
This command is a torque recording command, which realizes the real-time torque recording collision detection function. Click the “Torque Record Start” button to continuously record the collision situation during the operation of the motion command, and the recorded real-time torque is used as the theoretical value of the collision detection judgment to reduce the probability of false alarms. When the set threshold range is exceeded, the collision detection duration is recorded. Click the “Torque Recording Stop” button to stop recording. Click “Torque Record Reset” to return the status to the default state.
Figure 9.9-2 Torque command interface
9.10. Visual command interface
Figure 9.10 Visual command interface
9.10.1. 3D command
Click the “3D” icon to enter the 3D command editing interface.
This command generates commands for 3D vision program examples. Users can refer to the generated programs and communicate with other vision devices, including two program case references of camera calibration and camera capture.
Figure 9.10-1 3D command interface
9.11. Palletizing command interface
Figure 9.11 Palletizing command interface
9.11.1. Pallet command
Click the “Pallet” icon to enter the Pallet command editing interface.
This instruction generates instructions for the palletizing program, which is consistent with the matrix movement function in Section 3.9.6. For details, refer to that chapter.
Figure 9.11-1 Pallet command interface
This function controls the regular movement of the manipulator by setting the three-point coordinates and the values of the row and column layer and layer height, which is suitable for common palletizing applications. The first step is to select the robot movement mode, “PTP” or “Line”, the second step is to set the robot movement path, “head-to-tail walking method” or “bow walking method”, the third step is to set the stacking method, “stack stacking” or “unstacking”.
Figure 4.11-2 Matrix move
The fourth step is to teach three points according to the path. The first point is the starting point of the first row, and the arm posture is determined by this point during the whole movement process. The second point is the end point of the first row, and the third point is the end point of the last row. The fifth step is to set the number of rows and columns. The sixth step is to set the number of layers and the height of each layer. The last step is to name the matrix motion program file, and a matrix movement program is generated successfully.
Figure 4.11-3 Matrix move
9.12. Communication command interface
Figure 9.12 Communication command interface
9.12.1. Modbus command
Click the “Mobus” icon to enter the Modbus command editing interface.
The command function is a bus function based on the ModbusTCP protocol. The user can control the robot to communicate with the ModbusTCP client or server (the master station communicates with the slave station) through relevant instructions, and perform read and write operations on coils, discrete quantities, and registers.
Figure 9.12-1 modbus command master interface
Figure 9.12-2 modbus command slave interface
For more operating functions of ModbusTCP, please contact us for consultation.
9.12.2. Xmlrpc command
Click the “Xmlroc” icon to enter the Xmlrpc command editing interface.
XML-RPC is a remote procedure call method for transferring data between programs using xml over sockets. In this way, the robot controller can call the function (with parameters) in the remote program/service and obtain the returned structured data. The Robot Controller handles all the details of writing XML-RPC client messages and handling conversions between data types and XML.
Figure 9.12-3 Xmlrpc command interface
Important
The controller acts as a client to connect to the remote custom port;
The controller acts as a client to call the remote function;
Support calling different remote functions;
Support string array parameter input and character array result return, the number of array elements can be customized;
Support double-type array parameter input and double-type array result return, the number of array elements can be customized;
XmlrpcClientCall(serverUrl,methodName,tableType,param)
serverUrl server url, for example:"http://192.168.58.29:50000/RPC2"
methodName Call function name, "example.add"
tableType 1-double array, 2-string array
param call function parameters
XmlrpcClientCall(error, result)
error 0 - no error, 1 - error
result If the parameter is passed in as a double array, the result is a double array,
If the parameter is passed in as an array of string type, the result will be an array of string type9.13. Auxiliary command interface
Figure 9.13 Auxiliary command interface
9.13.1. Thread command
Click the “Thread” icon to enter the Thread command editing interface.
The Thread command is an auxiliary thread function. Users can define an auxiliary thread to run simultaneously with the main thread. The auxiliary thread mainly performs data interaction with external devices, supports socket communication, obtains robot DI status, robot DO status settings, and obtains robot status information. Thread data interaction, the data obtained by the main thread through the auxiliary thread is used to control the judgment of the robot’s motion logic, the screenshot of the user program example:
Figure 9.13-1 Thread program example
9.13.2. Function command
Click the “Function” icon to enter the Function command editing interface.
This command is to call the function interface function, provide the robot interface function to the customer to choose, and remind the customer of the parameters required by the function, which is convenient for the customer to write script commands, and more functions are being added one after another.
Figure 9.13-2 Function command interface
9.13.3. PT-Mode command
Click the “PT-Mode” icon to enter the PT-Mode command editing interface.
This command is mainly used for mode switching between system mode and point table mode. Teaching points in different point tables can be applied by switching point tables.For details, see Chapter 11 - Points.
Figure 9.13-3 PT-Mode command interface
9.14. Teaching program is not saved for verification
On the program teaching page, after opening/creating a new program, if the teaching program is modified, the program is not saved.
If you click “Open”, “New”, “Export”, “Rename” and other related file operations, the “Do you want to save this program” pop-up box will be triggered, prompting “The current program has changed. Do you want to save the changes to this program?” ,As shown below.
Figure 9.14-1 The current page program does not save verification
Step1:Click the “Not Save” button, and the program will restore the unmodified data and continue to perform previous related file operations.
Step2:Click the “Save” button, the unsaved Lua program is saved successfully, and the previous related file operations continue to be performed.
If you leave the program teaching page and switch to other pages, the prompt “Do you want to save this program” will also be triggered, and you will still stay on the current teaching program page, as shown below.
Figure 9.14-2 Switch page program does not save verification
Step1:Click the “Not Save” button to jump to the previously selected page.
Step2:Click the “Save” button, and the unsaved Lua program is saved successfully and jumps to the previously selected page.
9.15. Teaching program encryption
The teaching procedure is divided into a state of encryption and non-encryption. The encryption level is divided into first-level encryption and secondary encryption. Among them, the level of first-level encryption is the highest, and the secondary is second. All teaching programs are displayed and set in the form of program encryption information in “System Settings - Custom Information”. Encryption level descriptions are provided to the right of the table.
Figure 9.15-1 Demonstration of teaching procedures
When the program is a first-level encryption state, after opening the program: the corresponding “export”, “preservation”, “existing as”, “copy”, “cut”, “delete”, “delete”, “delete”, “delete”, “delete” The buttons such as “upward”, “downward” and “editing mode switching” will be grayed. Click the icon to be invalid and it will prompt that the current program is in an encrypted state. The program “renamed” icon will hide. Add instruction bars and program editing areas are invisible and prompts to be locked in first-level encryption.
Figure 9.15-2 Program first-level encryption interface
When the program is second-level encryption, after opening the program on the “Program Demonstration” page: the corresponding “savings”, “copy”, “shear”, “paste”, “delete”, “upper”, “upper” in the operating bar The buttons such as the “Move” will turn ashes. Click the icon to be invalid and it will prompt that the current program is encrypted. The program “renamed” icon will hide. The adding instruction bar is not visible and prompts to be locked in a secondary encryption. The program editing area can browse the reading program normally.
Figure 9.15-3 Program second-level encryption interface
Both first -level encryption and second -level encryption can use the “export” function. Verification operations will be performed when importing. If the program of the same name is an encrypted file, the import operation will be interrupted and indicated that the coverage of the encryption program cannot be introduced.
Figure 9.15-4 Program import
9.16. Local teaching point
The local teaching point is bound to the current teaching program. When adding a program command, it can only be applied to the current teaching program and cannot be used in other teaching programs.
Add: Click the “Add Local Teaching Point” icon on the far right of the program file name to add local teaching points. (For detailed records of local teaching points, please refer to the teaching point records in robot operation)
Figure 9.16-1 Add local teaching points
Delete: Click the serial number column of the table to select the local teaching point to be deleted, and then click the “Delete” icon in the upper right corner of the title of the local teaching point to delete the local teaching point.
Figure 9.16-2 Delete local teaching point
Run: Click the “Start Running” icon in the data operation bar of the local teaching point table to perform a single-point operation of the local teaching point and move the robot to the position of this point.
Figure 9.16-3 Run local teaching point
Details: Click the “Details” icon in the data operation bar of the local teaching point table to view the details of the local teaching point.
Figure 9.16-4 Local teaching point details
9.17. Current program backup
After the user modifies the teaching program and clicks save, the “backup” function of the current program is triggered (the backup time is 1 year), and the initial content of the current program is saved and displayed on the right side, which is convenient for the user to compare the modified content. Users can view the corresponding program backup content by selecting a date, and click the “Delete” icon in the upper right corner to delete the current program backup content. The content of the current program backup can only be viewed, not modified.
Figure 9.17 Current program backup
9.18. Modbus TCP Communication
ModbusTCP is a commonly used communication protocol in industrial production. Faao collaborative robots provide two ways to communicate with your device: ModbusTCP master and ModbusTCP slave.
The collaborative robot supports up to 8 ModbusTCP masters to communicate with external devices at the same time, and each master supports up to 128 registers; the collaborative robot ModbusTCP slave has 128 coils, 128 discrete inputs, 64 holding registers and 64 input registers (holding registers and input register data types include unsigned, signed and floating point types). At the same time, some ModbusTCP slave input register addresses of collaborative robots are dedicated to feedback information such as the current robot’s joint position and movement speed, and some coil register addresses are dedicated to controlling the robot to start the program, stop the program, set the control box DO and other functions.
The robot ModbusTCP slave only supports establishing a connection with one master station. The robot can communicate with different devices as a master and a slave at the same time. The following is a detailed usage method.
9.18.1. ModbusTCP master
Before using the cooperative robot as the ModbusTCP master station to communicate with your equipment, please check the network connection between your equipment and the robot, and confirm that the network interfaces are in the same network segment.
There are several steps to use the robot ModbusTCP master station:
Add the master station;
Add registers;
Communication test;
Writing user programs;
Run user programs.
9.18.1.1. Add ModbusTCP master
Open the WebApp, click “Teaching” and “Program Teaching” in turn to create a new user program “testModbusMaster.lua”.
Figure 9.18-1 Create ModbusTCP master station user program
Click “ModbusTCP Settings” button to open the ModbusTCP function configuration page.
Figure 9.18-2 Open ModbusTCP Settings
Click “Master settings” and “Add Modbus master station” in turn to finish adding a ModbusTCP master station.
Figure 9.18-3 Add “ModbusTCP Master Station
According to your equipment, enter the name, slave ip, port number, slave number, communication cycle, and timeout in turn. The specific meanings of the above parameters are as follows:
Name:ModbusTCP master station name. Robots can create up to 8 master stations to connect with corresponding slave stations. Different master stations can be distinguished by unique names, such as PLC, camera, data acquisition card and FRRobot1;
Slave IP:the slave IP address to which the ModbusTCP master station of the robot is connected;
Note
The robot and slave equipment must be connected through the network cable first, and the IP addresses of the robot and slave equipment must be in the same network segment.
Port number:The port number of ModbusTCP slave station to be connected;
Slave station number:ModbusTCP slave station number to be connected;
Communication period: The period (ms) when the robot ModbusTCP master station inquires about the slave station status, which only affects the update speed of the slave station register data on the ModbusTCP Settings page, but does not affect the speed of reading or writing the ModbusTCP slave station register value in the lua program of the user.
Timeout Period: When using the ModbusTCP read/write interface for operations, if the system fails to establish a connection after exceeding the timeout period, it will report a Modbus not connected error. Unit: ms, valid range: 100-60000.
Figure 9.18-4 Setting ModbusTCP master station parameters
After the above parameters are correctly input, the ModbusTCP master station of the robot automatically establishes a connection with the configured slave station. After the connection is successful, the “Connection status” indicator on the page lights up.
Note
If you have confirmed that the relevant parameters of ModbusTCP master station are correctly configured, but the robot is not successfully connected with your equipment, please check the following configurations:
①The physical network connection between the robot and the slave equipment;
②The IP addresses of the two network physical ports of the robot teaching device and the control box are different, please confirm whether they are connected to the correct network port;
③Please confirm whether the network port of the robot and the network port of the slave station equipment are in the same network segment. If the IP address of the robot is 192.168.58.2, the IP address of the slave station equipment must be 192.168.58.0~192.168.58.255, and it cannot be the same as the IP address of the robot;
④Check whether the port number of the slave equipment is the same as the set port number. (If the connection status indicator is flashing, it means that the register address in the master station is wrong. Please check whether the register type and address are correct)
Figure 9.18-5 Connection status of Modbus TCP master station
At this point, we have completed the creation of a ModbusTCP master station for the robot. If you click “Add Modbus Master Station” again, you can create a new ModbusTCP master station (Figure 7). The robot can support up to 8 master stations to communicate with external devices at the same time. Double-click the “Delete” button in the upper right corner of the Modbus master station to delete the Modbus master station.
Figure 9.18-6 Add ModbusTCP master station again
9.18.1.2. ModbusTCP master add register
Click the “Add master register” button to add a register for this master station.
Figure 9.18-7 Add ModbusTCP master station register
Select the modbus register type, input address number and name of the master station in turn, and the meanings of each parameter are as follows:
Type:Register type, DI:discrete input; DO:coil; AI-unsigned:unsigned input register (0-65535); AI-signed:signed input register (-32768-32767); AI-float:float type input register (the data length of float type register is 32 bits, occupying two signed or unsigned registers); AO-unsigned:unsigned holding register (0-65535); AI-signed:signed holding register (-32768-32767); AI-float:float type holding register (the data length of float type register is 32 bits, occupying two signed or unsigned registers), among which the floating-point type registers in AI and AO are big-end display.
Address number:The address of ModbusTCP slave register to be read or written;
Name: The alias of the register. The ModbusTCP master station of the robot can set up at most 128 different registers, and each register can be distinguished by different names according to the actual meaning, such as “Start”, “Servo in Place” and “Liquid Level”.
Figure 9.18-8 Setting ModbusTCP master station register parameters
Click the “Add Master Register” button again to add another master register, and double-click the “Delete” button on the right side of the register to delete it, a register is added for each type.
Note
If the master station connection status indicator flashes after adding the master station register, it means that the master station register address cannot be read. Please check whether the register type and address are correct.
Figure 9.18-9 Adding Multiple Master Station Registers
9.18.1.3. ModbusTCP master communication test
Before the communication test, please check whether the “Cnnection status” indicator of ModbusTCP master station is always on. If the indicator is always on, it means that the current connection has been successful.
The robot Modbus master station register has an “address value” value box for displaying the current register value, in which the registers of DI (discrete input) and AI (input register) are read-only and the corresponding address values are gray non-editable value boxes.
When the value of the corresponding address of the slave station changes, the robot master station displays the current value synchronously corresponding to the register address value. DO (coil) and AO (holding register) are readable and writable registers, so their addresses are white editable value boxes, which can be used to read the values of the corresponding registers of ModbusTCP slave stations or modify the values of the registers on the Modbus master station setting page of the robot.
Figure 9.18-10 Modbus master station address value
Numerical monitoring of DI and AI type registers of master
On the external ModbusTCP slave device, set the address value of No.255 of DI (discrete input) register to 1, change the address value of No.257 of AI (input register) to No.123, change the address value of No.258 to -123, and change the address value of No.259 to 123.3. At this time, the address value of the corresponding register on the robot Modbus master station setting page will be displayed accordingly.
Note
Because the register with address 259 is a floating-point register, it actually occupies two 16-bit registers 259 and 260 to store a floating-point number, so you can’t set a separate register to operate the No.260 register of AI, otherwise a numerical error will occur.
Figure 9.18-11 Modbus master station displays the values of DI and AI registers
Numerical writing of DO and AO type registers in the master
In the Modbus master station setting page of the robot, enter 1 in the No.255 address value input box of the DO (coil) type register named ‘Start’, and enter 65535,-32767 and 128.78 input boxes of the AO (holding register) named ‘Target position A’, ‘Target position B’ and ‘Target position C’ respectively.
Figure 9.18-12 Modbus master station writes DO and AO registers
3. Numerical monitoring of DO and AO type registers of master If you change the values of DO (coil) and AO (holding register) in ModbusTCP slave station, the register address value of ModbusTCP master station setting page will not be updated immediately. You need to click the “Refresh” button in the upper right corner of master station configuration, and then the register address values of DO and AO on the page will be updated.
Figure 9.18-13 Refresh the DO and AO address values of ModbusTCP master station.
9.18.2. Write ModbusTCP master program
Click “Program” and “Communication command” in turn to open the communication command adding page.
Figure 9.18-14 Open the communication command add page
Click “Modbus”.
Figure 9.18-15 Select Modbus
Click “Modbus_TCP”.
Figure 9.18-16 Select Modbus_TCP
Select “Master station (client)” to open the ModbusTCP master station command addition page.
Figure 9.18-17 Selecting Master Station (Client)
Write a single digital output DO (coil)
Select “Modbus master name” as the master station ‘PLC’ added on the Modbus master station setting page before, with DO name as ‘Start’, register number as 1 and register value as 1, and click the “Write digital output” button. Finally, scroll to the bottom of the page and click the “Apply” button (Figure 21).
Figure 9.18-18 Adding Write Single Digital Output
At this time, the robot program “testModbusMaster.lua” has added an command for the Modbus master station of the robot to write a single digital output. Switch the robot to the automatic mode, click the start button, and the robot will write the address value of the coil register ‘Start’ corresponding to the master station “PLC” as 1.
Figure 9.18-19 Writing a single coil lua program
Write multiple digital outputs DO (coils)
Open the ModbusTCP master station command adding page, select Modbus master name as the master station ‘PLC’ added in the Modbus master station setting page before, the name of DO is ‘Start’, the number of registers is 5, and the register values are 1,0,1,0,1. the number of register values should correspond to the set number of registers, and multiple register values should be separated by English commas, and click the ‘Write digital output’ button. Finally, scroll to the bottom of the page and click the “Apply” button.
Figure 9.18-20 Configures writing multiple digital outputs
At this time, the robot program “testModbusMaster.lua” has added an command that the robot Modbus master station writes multiple digital outputs, so as to switch the robot to the automatic mode, click the start button, and the robot will write the values of the coil register ‘Start’ corresponding to the master station ‘PLC’ and the following four coils as 1, 0, 1, 0 and 1 respectively.
Figure 9.18-21 Programming multiple coils lua
Read a single digital output DO (coil)
Open the ModbusTCP master station command addition page, select “Modbus master name” as the master station “PLC” added in the Modbus master station setting page before, the DO name is “Start”, the number of registers is 1, and the register value does not need to be filled in, and click “Read digital output”. Finally, scroll to the bottom of the page and click the “Apply” button.
Figure 9.18-22 Configuring Reading a Single Digital Output
At this time, the robot program “testModbusMaster.lua” has added an command for the robot Modbus master station to read a single digital output.
Figure 9.18-23 Program for reading a single coil
Usually, after reading the Modbus register, the read value is stored in a variable, so it is necessary to define a variable to store the read value. As shown in figure 29, click the “switch mode” Button to switch the robot lua program to an editable state, and write the variable “startValue” with added return value before the “ModbusMasterReadDO” command, and the value read after executing the program will be stored in “startValue”.
Figure 9.18-24 Reading a single digital output into a variable
The register value of coil type is only 0 and 1, so different operations can be carried out by judging the different register values in robot programs. As shown in Figure 30, click the “Switch Mode” button to switch the robot teaching program to the non-editable mode, and add two joint motion commands to move to two different points “P1” and “P2” respectively.
Figure 9.18-25 Add motion commands of different points
The program is switched to the editable mode again, and the judgment condition of the coil value “startValue” is written. When the value of “startValue” is 1, the robot moves to the point “P1”, otherwise the robot moves to the point “P2”.
Figure 9.18-26 Move to different points according to different coil values
Finally, switch the robot program to non-editable mode, switch the robot to automatic mode, and start the running program on the premise of confirming safety. The first two lines of the program set the DO value of the coil named “Start” to 1, so the robot will move to the “P1” point after executing the program.
Figure 9.18-27 Read the register value of a single coil and move it
Read multiple digital DO (coils)
Open the ModbusTCP master station command adding page, select “Modbus master name” as the master station “PLC” added in the Modbus master station setting page, the name of DO is “Start”, the number of registers is 6, and the register value does not need to be filled in, and click “Read digital output”. Finally, scroll to the bottom of the page and click the “Apply” button (Figure 34).
Figure 9.18-28 Configuring Reading Multiple Digital Outputs
At this time, the robot program “testModbusMaster.lua” has added an command that the robot Modbus master station reads multiple digital outputs.
Figure 9.18-29 Reading multiple digital output programs
Click the “switch mode” button “” to switch the robot lua program to the editable state. Since the number of readings is six, it is necessary to write and add six return value variables “value1,value2,Value3,Value4, Value5,value6” before the “ModbusMasterReadDO” command, and the six register values read after the program execution will have the above six variables respectively.
Figure 9.18-30 Reading Multiple Digital Outputs and Storing Variables
Read DIgital input DI (discrete input)
Open the ModbusTCP master station command addition page, select “Modbus master name” as the master station “PLC” previously added in the Modbus master station setting page, the DI name is “Servo arrive”, the number of registers is 2, and click “Read digital input”. Finally, scroll to the bottom of the page and click the “Apply” button (Figure 38).
Figure 9.18-31 Configuring Read Digital Input
At this time, the robot program “testModbusMaster.lua” has added an command for the Modbus master station to read digital input.
Figure 9.18-32 Reading digital input program commands
Click the “Switch Mode” button “” to switch the robot lua program to an editable state, and write the return value variables “state1,state2” before the “ModbusMasterReadDO” command. The two digital input values read after executing the program will be stored in the variables “state1” and “state2” respectively, and you can control the robot to do different operations by judging the variable values.
Figure 9.18-33 Reading digital input and storing variables
6. Read and write analog input AI (input register) and analog output AO (holding register) The reading and writing operations of analog input AI (input register) and analog output AO (holding register) are basically the same as those of digital input DI (discrete input) and digital output DO (coil), but the difference is that the data range of the latter is only 0 or 1, while the data range of the former is larger, so the specific operations can refer to the programming of digital input and digital output, and only the reading input AI (Figure 41) and writing analog output AO are shown here.
Figure 9.18-34 Reading analog input AI
Figure 9.18-35 Read and write analog output AO
Waiting for digital input
Open the ModbusTCP master station command addition page, find the “Wait for digital input to be set”, that is, wait for DI discrete input setting, select the “servo in place” register with DI name as the configuration, the waiting status is “True” and the timeout time is 5000 ms. Click “Add” button, and finally click “Apply” button.
Figure 9.18-36 Add the command of waiting for DI input
At this time, the robot program “testModbusMaster.lua” has added an command that the robot Modbus master station waits for DIgital input DI. After starting the program, the robot will wait for the value of the “Servo arrive” register of the “PLC” master station to become true, that is, the value 1. Since the set timeout is 5s, when the “Servo arrive” signal is still 0 after the robot waits 5s, the robot program will report a timeout error and the program will stop.
Figure 9.18-37 Waiting for Digital Input DI Program
Waiting for analog Input
Open the ModbusTCP master station command addition page, find “Waiting for analog input setting”, that is, waiting for the setting of AI input register, select the configured “liquid level” register with AI name, waiting status of “>”, register value of 255 and timeout time of 5000 ms.. Click “Add” button, and finally click “Apply” button.
Figure 9.18-38 Add Waiting for Analog Input
At this time, the robot program “testModbusMaster.lua” has added an command that the robot Modbus master station waits for the AI input register value. After starting the program, the robot will wait for the “Liquid level” register value of the “PLC” master station to be greater than 255. Since the set timeout is 5s, when the “Liquid level” signal is still less than 255 after the robot waits for 5s, the robot program will report a timeout error and the program will automatically stop running.
Figure 9.18-39 Waiting for AI Input Register Program
Open the ModbusTCP Master command addition page, find the “Wait for Analog Input Setting” (i.e., wait for AI input register setting). Select the AI name as the configured “Liquid Level” register, set the wait condition to “=”, the register value to 255, and the timeout to 5000ms. Click the “Add” button, and finally click the “Apply” button.
Figure 9.18-39-2 Add Wait for Analog Input
At this point, a Modbus Master command to wait for the AI input register value has been added to the robot program “test.lua”. After starting the program, the robot will continuously wait for the “Liquid Level” register value from the “PLC” master to equal 255. Since the timeout is set to 5s, if the “Liquid Level” signal still does not equal 255 after the robot waits for 5 seconds, the robot program will report a timeout error and automatically stop running.
9.18.3. ModbusTCP slave
Robot ModbusTCP slave station provides four types of registers: Digital input (coil), Digital output (discrete input), Analog input (holding register) and Analog output (input register). The digital input and analog input are mainly used for the robot to read the data of the external ModbusTCP master station to control the robot operation, while the digital output and analog output are mainly used for the robot to send data signals to the external ModbusTCP master station equipment, and the external master station equipment reads the relevant register values to control the equipment operation. In addition to the above-mentioned general input and output, the robot also provides some “Functional digital input (coils)” for the external master station equipment to control the robot’s start-up program and stop-up program, and provides some input registers to display the current robot’s state information, including the robot’s current Cartesian position, the robot’s current running state, etc. (please refer to Annex 1: ModbusTCP slave address mapping table). The use process of robot ModbusTCP slave station mainly includes: ①parameter configuration; ②Communication test; ③Programming.
9.18.3.1. ModbusTCP slave communication parameter configuration
Open the WebApp, click “Teaching” and “Program Teaching” in turn to create a new user program “testModbusSlave.lua”.
Figure 9.18-40 Create ModbusTCP slave station user program
Click “ModbusTCP Settings” button to open the ModbusTCP function configuration page.
Figure 9.18-41 Open ModbusTCP Settings
Click “Slave Settings” in turn, and enter the IP, Port number and Slave station number of the robot slave station, where “IP” is the IP address of the robot slave station, FAIRINO cooperative robot has two network ports, the teaching device and the control box and the IP addresses of the two ports are different. Enter the correct IP address according to the network port where the external device is connected to the robot slave station (it is recommended that you use the network port on the control box).You have to restart robot after change the IP address, port number or slave station number of the robot ModbusTCP slave station,otherwise it won’t take effect.
Figure 9.18-42 ModbusTCP slave settings
After the parameters of ModbusTCP slave station are set and the robot is restarted, the external master station equipment can establish a connection with the robot slave station through the set parameters. After the connection is successful, the “Connection status” indicator light on the robot slave station setting page will light up.
Figure 9.18-43 slave station connection status indicator light
9.18.3.2. ModbusTCP slave communication test
Digital input (coil)
The robot ModbusTCP slave station provides 128 coil registers, and their register addresses are 100~127.
Note
Please refer to Annex I: ModbusTCP slave station address mapping table.
Aliases can be set for the general registers of robot ModbusTCP slave stations as shown in Figure 52. Modify the name of the robot slave station coil register DI0 to be “A in place” and the name of DI1 to be “B in place”. According to the address mapping table, the Modbus coil addresses of “A in place” and “B in place” are 100 and 101, respectively. Set the robot slave station coil register addresses 100 and 101 to 1 on the external ModbusTCP master station equipment, At this time, two register indicators on the monitoring page of the robot ModbusTCP slave station light up .
Figure 9.18-44 ModbusTCP slave station coil state monitoring
Digital output (discrete input)
The robot ModbusTCP slave station provides 128 discrete input registers, and their register addresses are 100~127.
Note
Please refer to Annex 1: ModbusTCP slave station address mapping table for specific definitions.
Similarly, the robot ModbusTCP slave’s discrete input register can also be set with aliases, as shown in Figure 53. Click “Digital Output (Discrete Input)” to modify the name of the robot slave’s discrete input register DO0 as “A Start” and DO1 as “B Start”. According to the address mapping table, the Modbus discrete input addresses of “A Start” and “B Start” are 100 and 101 respectively. Click “A Start” to correspond to the discrete input indicator light, which lights up, and the value of the corresponding register address 100 becomes 1, which can be read from the external ModbusTCP master station equipment.
Figure 9.18-45 ModbusTCP slave discrete input control
Analog input (holding register)
The robot provides 64 holding registers of unsigned, signed and float types, with the addresses of AI0~AI63 ranging from 100 to 195.
Note
text Please refer to Annex 1: ModbusTCP slave address mapping table for specific definitions, in which the data range of unsigned register is 0~65535, the data range of signed register is -32768~32767, and the float register is displayed at the big end.
As shown in Figure 53, the names of AI0 and AI1 are changed to “voltage” and “current” respectively, and the addresses of the two registers are found to be 100 and 101 respectively from the ModbusTCP slave address mapping table. Therefore, when the connected master station equipment modifies the register address values of the holding registers 100 and 101, the register address values of “voltage” and “current” on the ModbusTCP slave station monitoring page of the robot are updated and displayed synchronously, and the robot’s analog input is mainly used for reading the external master station equipment values.
Figure 9.18-46 ModbusTCP slave analog input monitoring
Analog output (input register)
The robot provides 64 input registers of unsigned, signed and floating-point types, with the addresses of AO0~AO63 ranging from 100 to 195.
Note
text please refer to Annex 1: ModbusTCP slave address mapping table, in which the data range of unsigned register is 0~65535, the data range of signed register is -32768~32767, and the floating-point register is displayed at the big end.
As shown in figure 55, the names of AO0 and AO1 are changed to “position A” and “position B” respectively, and the values of the input registers are 2000 and 1500 respectively. The addresses of the two registers are 100 and 101 respectively from the station address mapping table of ModbusTCP. Therefore, when the connected master station equipment reads the address values of the input registers 100 and 101, the set values can be obtained, and the simulated output of the robot slave station is mainly used for the robot to transfer to the external master station equipment.
Figure 9.18-47 Modbus slave station modifies analog input