faroc


Namefaroc JSON
Version 0.7.5 PyPI version JSON
download
home_page
SummaryFaRoC (Fanuc Robot Control): a Python package for FANUC industrial robots
upload_time2023-04-03 13:23:05
maintainer
docs_urlNone
author
requires_python>=3.6
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords fanuc robot development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FaRoC (Fanuc Robot Control)

[![PyPI - Version](https://img.shields.io/pypi/v/faroc)](https://pypi.org/project/faroc/)
[![PyPI - Status](https://img.shields.io/pypi/status/faroc)](https://pypi.org/project/faroc/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/faroc.svg?label=PyPI%20downloads)](https://pypi.org/project/faroc/)
[![PyPI - License](https://img.shields.io/pypi/l/faroc)](https://choosealicense.com/licenses/apache-2.0/)
[![Language - KAREL](https://img.shields.io/badge/language-KAREL-yellow)](https://www.onerobotics.com/posts/2013/introduction-to-karel-programming/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/faroc)](https://pypi.org/project/faroc/)
[![PyPI - Format](https://img.shields.io/pypi/format/faroc)](https://pypi.org/project/faroc/)
[![no github badge](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page/)
[![Codeberg badge](https://custom-icon-badges.demolab.com/badge/hosted%20on-codeberg-4793CC.svg?logo=codeberg&logoColor=white)](https://codeberg.org/hojak/faroc/)


A Python library for communication with Fanuc robots. 
It can read data from the controller, write data to the controller, execute TP and Karel program, and move the robot.


## Functionality and features 
FaRoC is based on two works: 

  - fanucpy: Python package for FANUC industrial robots (https://github.com/torayeff/fanucpy)
  - Fanuc DPM Mouse Demo (https://github.com/gavanderhoorn/fanuc_dpm_mouse_demo)


Fanucpy uses ASCII data transfer, whereas FaRoC uses BINARY data transfer for these reasons:


Quote from KAREL Reference Manual: 

"Binary I/O is preferred to text I/O when creating files that are to be read only by KAREL programs for the following reasons:

  - Positional, VECTOR, and PATH variables cannot be read directly from text input.
  - Some formats and data combinations are not read in the same manner as they were written in text files or they become invalid if read with the same format.
  - Binary data is generally more compact, reducing both the file size and the I/O time.
  - There is some inevitable loss of precision when converting from REAL data to its ASCII
representation and back.

Generally, no format specifiers need to be used with binary I/O. If this rule is followed, all input data can
be read exactly as it was before it was written."

Fanucpy has these functionalities so far:

  | Attribute | Funktion |
  |---|---|
  | Current joint values (JOINTPOS)   | GET |
  | Current pose (XYZWPR, without config)         | GET |
  | TP Program  <br />- uses `CALL_PROG`    | START  |
  | Move Robot to a given JOINTPOS <br />- uses `CALL_PROG` | START
  | Move Robot to a given XYZWPR <br />- uses `CALL_PROG` | START
  | I/O -> Robot OUT (RO)             | GET, SET |
  | Instantaneous power consumption   | GET |
  
When the robot is moved using the standard move method by specifying the XYZWPR position, the configuration cannot be specified explicitly. 
Instead, the current configuration of the robot is used by the controller to uniquely determine the pose.

Due to Fanucpy's ASCII data transfer, the data must be converted to strings before transfer. Fanucpy rounds the data to the third decimal place, which may not be sufficient for some applications. 

Furthermore, the `CALL_PROG` method included in Karel is used when external TP programs are executed or when the robot is moved, but this interrupts the running program. 
The calling program, e.g. mapdk_server.kl, is not resumed until the program started by `CALL_PROG` or the robot movement is finished.
During the interruption no communication between client and server is possible.


FaRoC provides the functionalities described in fanucpy and extends them by further functions:

  | Attribute | Funktion |
  |---|---|
  | Current joint values (JOINTPOS)   | GET |
  | Current pose (XYZWPR and config)         | GET |
  | External Program (KAREL or TP) <br />- uses `RUN_TASK` or `CALL_PROG`  | START, ABORT,<br /> GET TYPE, CHECK STATUS, GET TASK INFO |
  | Move Robot to a given JOINTPOS <br />- uses `RUN_TASK` or `CALL_PROG`  <br />- change one or more joint values | START, ABORT
  | Move Robot to a given XYZWPR <br />- uses `RUN_TASK` or `CALL_PROG` <br />- change one or more pose values | START, ABORT
  | I/O -> Robot OUT (RO)             | GET, SET |
  | I/O -> SIUMLATED Robot IN (RI)    | GET |
  | System variables <br />- supported types: REAL, INTEGER, BOOLEAN, BYTE, SHORT and STRING  | GET, SET, GET TYPE |
  | Program variables <br />- supported types: REAL, INTEGER, BOOLEAN, BYTE, SHORT and STRING | GET, SET, GET TYPE |
  | Robot USER or TOOL frame                              | GET, SET |
  | number of the used USER or TOOL frame     | GET, SET |
  | KAREL internal USER or TOOL frame              | GET, SET |
  | I/O -> Flag                       | GET, SET |
  | DATA Regsiter ( R )               | GET, SET |
  | Comment for DATA Regsiter         | GET, SET |
  | DATA String Regsiter (SR)         | GET, SET |
  | Comment for DATA String Regsiter  | GET, SET |
  | Position Regsiter (PR)            | GET, SET, GET TYPE |
  | Pose (XYZWPR)                     | IS REACHABLE, CONVERT TO JOINTPOS |
  | Joint values (JOINTPOS)           | IS REACHABLE, CONVERT TO XYZWPR |
  | RSI                               | ENABLE, DISABLE, IS ENABLE |
  | Robot Time                        | GET, SET |
  | Fanuc alarm code / KAREL status  | Provide error details |
  
With FaRoC both of the methods `CALL_PROG` and `RUN_TASK` included in KAREL can be used to execute external TP or KAREL programs or to move the robot. 
Unlike `CALL_PROG`, the program called by `RUN_TASK` runs in parallel with the calling program. 
So the communication with the client is not interrupted and the server can still answer requests.

To provide Fanuc alarm code / KAREL status details, data has been extracted from the FANUC manual: 
OPERATOR'S MANUAL (Alarm Code List) | R-30+B CONTROLLER | B-83284EN-1/02.


## Software contents
The package consists of two parts: 

1. Robot interface code written in Python programming language
2. FANUC robot controller driver written in KAREL and FANUC teach pendant languages


## Requirements

The following is needed for FaRoC software to work:
 - Roboguide or physical robot
 - R-30iB controller (`V8.xx` and up), with:
   - `R632` - KAREL
   - `R648` - User Socket Msg
 - Python `>= 3.6`

To develop and test this software, a [Fanuc M-900iB/700 ](https://www.fanuc.eu/de/de/roboter/roboterfilter-seite/m-900-serie/m-900ib-700) 
robot with an R-30iB controller (`V8.30`) was used. [Roboguide](https://www.fanuc.eu/uk/en/robots/accessories/roboguide) version 9 (Rev.Z) was also used.
 

## Python package installation
```bash
pip install faroc
```

## Driver Building
You can use the command line OR Roboguide to build the *.kl files contained in `src\fanuc-driver\`.

### Command line

If `ktrans.exe` is not installed in the default location (ie:`C:\Program Files (x86)\Fanuc\WinOLPC\bin`), 
open `build.cmd` from `src` -> `fanuc-driver` and update the `KTRANS_BIN` variable. 
If `ktrans.exe` is on the Windows `PATH`, simply setting it to `ktrans.exe` should also work.

If you need to build for a runtime software version other than `V8.30`, change `CORE_VERSION` as well.

Tip: You can use `REM` to comment a line.

Now run `build.cmd` in a command shell.

```cmd
.\build
```
Six p-code files should be created.


### Roboguide
Open `build.cmd` from `src` -> `fanuc-driver`.
Add all Karel programs listed in `build.cmd` and the three TP programs (`*.ls` files) to your Roboguide
workcell and build them.


## Driver Installation

Roboguide should have automatically uploaded the Karel programs to the virtual controller. 
Loading the TP program should copy it as well.

If `build.cmd` was used, add the `.pc` and `.ls` files to the project and
load them onto the (virtual) controller. Alternatively an FTP client could be
used.



## Configuration

### Host Comm (SERVER)

Setup two *Server Tags*, Nr. 7 & 8, to use the `SM` protocol and make sure to set
`Startup State` to `START`. Use the `[ACTION]` menu to start the Tag
immediately, or restart the controller. The SETUP Server config can be found in MENU -> SETUP -> Host Comm. -> SHOW -> Servers.


### FaRoC_SERVER
Open the *KAREL Vars* on the controller for `FaRoC_SERVER` (after selecting it, i.e. SELECT -> FaRoC_Server -> ENTER -> MENU -> DATA -> KAREL Vars), switch to the `cfg_` field, open the
structure and enter the following values:

```
S_TCP_PORT   : 24087
S_TAG_NR     : 7
UM_CLEAR     : TRUE
```


### Configure the rest automatically

Now you can start the TP program `FAROC`. On the computer initialize an object of class `FaRoC_Writer` and connect it to the server. 
The rest of the configuration can be done with the script `demo_FaRoC_setup.py`. 

Finally, you will have to restart the controller to apply the changes. 


Otherwise you can do it manually as follows:


### Configure the rest manually


#### FaRoC_MOVER
Open the *KAREL Vars* for `FaRoC_MOVER`, switch to the `cfg_` field, open the
structure and enter the following values:

```
S_TCP_PORT   : 24088
S_TAG_NR     : 8
UM_CLEAR     : FALSE
UFRAM_NUM    : 1
UTOOL_NUM    : 1
```

#### Host Comm (CLIENT)

In order to use `FaRoC_dclnt1` set up a *Client Tags*, e.g. No. 1 to use the `SM` protocol and 
make sure the `Startup State` is set to `START`. 
Set `Server IP/Hostname` to the ip adress of the pc you want to use for socket messaging, e.g. `127.0.0.1` in case of Roboguide.
Use the `[ACTION]` menu to start the Tag immediately, or restart the controller. 

We use binary data transfare, so we need to set the system variable`$HOSTC_CFG[1].$USE_UDP` to `TRUE` 


A *cleint tag* is configured for each data client. You can configure up to 8 data clients if required.
 Each client can send up to 32 variables. 
If more data is needed simultaneously, new Data Clients (Karel programme) can simply be copied (the programme name must be changed in the file) and new 'client tags' can be configured as above.


## Disclaimer

The author of this software is not affiliated with FANUC Corporation in any way.
All trademarks and registered trademarks are property of their respective owners, and company, product and service names mentioned in this readme or appearing in source code or other artefacts in this repository are used for identification purposes only.
Use of these names does not imply endorsement by FANUC Corporation.


## References

Below is a list of resources that have been used as reference and inspiration for the development of FaRoc.

- [fanucpy](https://github.com/torayeff/fanucpy): Python package for FANUC industrial robots
- [Fanuc DPM Mouse Demo](https://github.com/gavanderhoorn/fanuc_dpm_mouse_demo)
- OPERATOR'S MANUAL (Alarm Code List) | R-30+B CONTROLLER | B-83284EN-1/02

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "faroc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "fanuc,robot,development",
    "author": "",
    "author_email": "Wael Hojak <w.hojak@tutamail.com>",
    "download_url": "",
    "platform": null,
    "description": "# FaRoC (Fanuc Robot Control)\n\n[![PyPI - Version](https://img.shields.io/pypi/v/faroc)](https://pypi.org/project/faroc/)\n[![PyPI - Status](https://img.shields.io/pypi/status/faroc)](https://pypi.org/project/faroc/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/faroc.svg?label=PyPI%20downloads)](https://pypi.org/project/faroc/)\n[![PyPI - License](https://img.shields.io/pypi/l/faroc)](https://choosealicense.com/licenses/apache-2.0/)\n[![Language - KAREL](https://img.shields.io/badge/language-KAREL-yellow)](https://www.onerobotics.com/posts/2013/introduction-to-karel-programming/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/faroc)](https://pypi.org/project/faroc/)\n[![PyPI - Format](https://img.shields.io/pypi/format/faroc)](https://pypi.org/project/faroc/)\n[![no github badge](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page/)\n[![Codeberg badge](https://custom-icon-badges.demolab.com/badge/hosted%20on-codeberg-4793CC.svg?logo=codeberg&logoColor=white)](https://codeberg.org/hojak/faroc/)\n\n\nA Python library for communication with Fanuc robots. \nIt can read data from the controller, write data to the controller, execute TP and Karel program, and move the robot.\n\n\n## Functionality and features \nFaRoC is based on two works: \n\n  - fanucpy: Python package for FANUC industrial robots (https://github.com/torayeff/fanucpy)\n  - Fanuc DPM Mouse Demo (https://github.com/gavanderhoorn/fanuc_dpm_mouse_demo)\n\n\nFanucpy uses ASCII data transfer, whereas FaRoC uses BINARY data transfer for these reasons:\n\n\nQuote from KAREL Reference Manual: \n\n\"Binary I/O is preferred to text I/O when creating files that are to be read only by KAREL programs for the following reasons:\n\n  - Positional, VECTOR, and PATH variables cannot be read directly from text input.\n  - Some formats and data combinations are not read in the same manner as they were written in text files or they become invalid if read with the same format.\n  - Binary data is generally more compact, reducing both the file size and the I/O time.\n  - There is some inevitable loss of precision when converting from REAL data to its ASCII\nrepresentation and back.\n\nGenerally, no format specifiers need to be used with binary I/O. If this rule is followed, all input data can\nbe read exactly as it was before it was written.\"\n\nFanucpy has these functionalities so far:\n\n  | Attribute | Funktion |\n  |---|---|\n  | Current joint values (JOINTPOS)   | GET |\n  | Current pose (XYZWPR, without config)         | GET |\n  | TP Program  <br />- uses `CALL_PROG`    | START  |\n  | Move Robot to a given JOINTPOS <br />- uses `CALL_PROG` | START\n  | Move Robot to a given XYZWPR <br />- uses `CALL_PROG` | START\n  | I/O -> Robot OUT (RO)             | GET, SET |\n  | Instantaneous power consumption   | GET |\n  \nWhen the robot is moved using the standard move method by specifying the XYZWPR position, the configuration cannot be specified explicitly. \nInstead, the current configuration of the robot is used by the controller to uniquely determine the pose.\n\nDue to Fanucpy's ASCII data transfer, the data must be converted to strings before transfer. Fanucpy rounds the data to the third decimal place, which may not be sufficient for some applications. \n\nFurthermore, the `CALL_PROG` method included in Karel is used when external TP programs are executed or when the robot is moved, but this interrupts the running program. \nThe calling program, e.g. mapdk_server.kl, is not resumed until the program started by `CALL_PROG` or the robot movement is finished.\nDuring the interruption no communication between client and server is possible.\n\n\nFaRoC provides the functionalities described in fanucpy and extends them by further functions:\n\n  | Attribute | Funktion |\n  |---|---|\n  | Current joint values (JOINTPOS)   | GET |\n  | Current pose (XYZWPR and config)         | GET |\n  | External Program (KAREL or TP) <br />- uses `RUN_TASK` or `CALL_PROG`  | START, ABORT,<br /> GET TYPE, CHECK STATUS, GET TASK INFO |\n  | Move Robot to a given JOINTPOS <br />- uses `RUN_TASK` or `CALL_PROG`  <br />- change one or more joint values | START, ABORT\n  | Move Robot to a given XYZWPR <br />- uses `RUN_TASK` or `CALL_PROG` <br />- change one or more pose values | START, ABORT\n  | I/O -> Robot OUT (RO)             | GET, SET |\n  | I/O -> SIUMLATED Robot IN (RI)    | GET |\n  | System variables <br />- supported types: REAL, INTEGER, BOOLEAN, BYTE, SHORT and STRING  | GET, SET, GET TYPE |\n  | Program variables <br />- supported types: REAL, INTEGER, BOOLEAN, BYTE, SHORT and STRING | GET, SET, GET TYPE |\n  | Robot USER or TOOL frame                              | GET, SET |\n  | number of the used USER or TOOL frame     | GET, SET |\n  | KAREL internal USER or TOOL frame              | GET, SET |\n  | I/O -> Flag                       | GET, SET |\n  | DATA Regsiter ( R )               | GET, SET |\n  | Comment for DATA Regsiter         | GET, SET |\n  | DATA String Regsiter (SR)         | GET, SET |\n  | Comment for DATA String Regsiter  | GET, SET |\n  | Position Regsiter (PR)            | GET, SET, GET TYPE |\n  | Pose (XYZWPR)                     | IS REACHABLE, CONVERT TO JOINTPOS |\n  | Joint values (JOINTPOS)           | IS REACHABLE, CONVERT TO XYZWPR |\n  | RSI                               | ENABLE, DISABLE, IS ENABLE |\n  | Robot Time                        | GET, SET |\n  | Fanuc alarm code / KAREL status  | Provide error details |\n  \nWith FaRoC both of the methods `CALL_PROG` and `RUN_TASK` included in KAREL can be used to execute external TP or KAREL programs or to move the robot. \nUnlike `CALL_PROG`, the program called by `RUN_TASK` runs in parallel with the calling program. \nSo the communication with the client is not interrupted and the server can still answer requests.\n\nTo provide Fanuc alarm code / KAREL status details, data has been extracted from the FANUC manual: \nOPERATOR'S MANUAL (Alarm Code List) | R-30+B CONTROLLER | B-83284EN-1/02.\n\n\n## Software contents\nThe package consists of two parts: \n\n1. Robot interface code written in Python programming language\n2. FANUC robot controller driver written in KAREL and FANUC teach pendant languages\n\n\n## Requirements\n\nThe following is needed for FaRoC software to work:\n - Roboguide or physical robot\n - R-30iB controller (`V8.xx` and up), with:\n   - `R632` - KAREL\n   - `R648` - User Socket Msg\n - Python `>= 3.6`\n\nTo develop and test this software, a [Fanuc M-900iB/700 ](https://www.fanuc.eu/de/de/roboter/roboterfilter-seite/m-900-serie/m-900ib-700) \nrobot with an R-30iB controller (`V8.30`) was used. [Roboguide](https://www.fanuc.eu/uk/en/robots/accessories/roboguide) version 9 (Rev.Z) was also used.\n \n\n## Python package installation\n```bash\npip install faroc\n```\n\n## Driver Building\nYou can use the command line OR Roboguide to build the *.kl files contained in `src\\fanuc-driver\\`.\n\n### Command line\n\nIf `ktrans.exe` is not installed in the default location (ie:`C:\\Program Files (x86)\\Fanuc\\WinOLPC\\bin`), \nopen `build.cmd` from `src` -> `fanuc-driver` and update the `KTRANS_BIN` variable. \nIf `ktrans.exe` is on the Windows `PATH`, simply setting it to `ktrans.exe` should also work.\n\nIf you need to build for a runtime software version other than `V8.30`, change `CORE_VERSION` as well.\n\nTip: You can use `REM` to comment a line.\n\nNow run `build.cmd` in a command shell.\n\n```cmd\n.\\build\n```\nSix p-code files should be created.\n\n\n### Roboguide\nOpen `build.cmd` from `src` -> `fanuc-driver`.\nAdd all Karel programs listed in `build.cmd` and the three TP programs (`*.ls` files) to your Roboguide\nworkcell and build them.\n\n\n## Driver Installation\n\nRoboguide should have automatically uploaded the Karel programs to the virtual controller. \nLoading the TP program should copy it as well.\n\nIf `build.cmd` was used, add the `.pc` and `.ls` files to the project and\nload them onto the (virtual) controller. Alternatively an FTP client could be\nused.\n\n\n\n## Configuration\n\n### Host Comm (SERVER)\n\nSetup two *Server Tags*, Nr. 7 & 8, to use the `SM` protocol and make sure to set\n`Startup State` to `START`. Use the `[ACTION]` menu to start the Tag\nimmediately, or restart the controller. The SETUP Server config can be found in MENU -> SETUP -> Host Comm. -> SHOW -> Servers.\n\n\n### FaRoC_SERVER\nOpen the *KAREL Vars* on the controller for `FaRoC_SERVER` (after selecting it, i.e. SELECT -> FaRoC_Server -> ENTER -> MENU -> DATA -> KAREL Vars), switch to the `cfg_` field, open the\nstructure and enter the following values:\n\n```\nS_TCP_PORT   : 24087\nS_TAG_NR     : 7\nUM_CLEAR     : TRUE\n```\n\n\n### Configure the rest automatically\n\nNow you can start the TP program `FAROC`. On the computer initialize an object of class `FaRoC_Writer` and connect it to the server. \nThe rest of the configuration can be done with the script `demo_FaRoC_setup.py`. \n\nFinally, you will have to restart the controller to apply the changes. \n\n\nOtherwise you can do it manually as follows:\n\n\n### Configure the rest manually\n\n\n#### FaRoC_MOVER\nOpen the *KAREL Vars* for `FaRoC_MOVER`, switch to the `cfg_` field, open the\nstructure and enter the following values:\n\n```\nS_TCP_PORT   : 24088\nS_TAG_NR     : 8\nUM_CLEAR     : FALSE\nUFRAM_NUM    : 1\nUTOOL_NUM    : 1\n```\n\n#### Host Comm (CLIENT)\n\nIn order to use `FaRoC_dclnt1` set up a *Client Tags*, e.g. No. 1 to use the `SM` protocol and \nmake sure the `Startup State` is set to `START`. \nSet `Server IP/Hostname` to the ip adress of the pc you want to use for socket messaging, e.g. `127.0.0.1` in case of Roboguide.\nUse the `[ACTION]` menu to start the Tag immediately, or restart the controller. \n\nWe use binary data transfare, so we need to set the system variable`$HOSTC_CFG[1].$USE_UDP` to `TRUE` \n\n\nA *cleint tag* is configured for each data client. You can configure up to 8 data clients if required.\n Each client can send up to 32 variables. \nIf more data is needed simultaneously, new Data Clients (Karel programme) can simply be copied (the programme name must be changed in the file) and new 'client tags' can be configured as above.\n\n\n## Disclaimer\n\nThe author of this software is not affiliated with FANUC Corporation in any way.\nAll trademarks and registered trademarks are property of their respective owners, and company, product and service names mentioned in this readme or appearing in source code or other artefacts in this repository are used for identification purposes only.\nUse of these names does not imply endorsement by FANUC Corporation.\n\n\n## References\n\nBelow is a list of resources that have been used as reference and inspiration for the development of FaRoc.\n\n- [fanucpy](https://github.com/torayeff/fanucpy): Python package for FANUC industrial robots\n- [Fanuc DPM Mouse Demo](https://github.com/gavanderhoorn/fanuc_dpm_mouse_demo)\n- OPERATOR'S MANUAL (Alarm Code List) | R-30+B CONTROLLER | B-83284EN-1/02\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright [yyyy] [name of copyright owner]  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "FaRoC (Fanuc Robot Control): a Python package for FANUC industrial robots",
    "version": "0.7.5",
    "split_keywords": [
        "fanuc",
        "robot",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6695cb1b7bf0780188229ee248f6f90c66606ac471d542a1e8b180aa9e63be7e",
                "md5": "970fb1afb3f55cff62fde6f12320699a",
                "sha256": "f7390634047bf8969ddf76cddf42a329c3e37a734fab34e1d879f0e790f9c752"
            },
            "downloads": -1,
            "filename": "faroc-0.7.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "970fb1afb3f55cff62fde6f12320699a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 929957,
            "upload_time": "2023-04-03T13:23:05",
            "upload_time_iso_8601": "2023-04-03T13:23:05.095667Z",
            "url": "https://files.pythonhosted.org/packages/66/95/cb1b7bf0780188229ee248f6f90c66606ac471d542a1e8b180aa9e63be7e/faroc-0.7.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-03 13:23:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "faroc"
}
        
Elapsed time: 0.10623s