1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

unable to set DOs

  • zahid990170
  • July 27, 2022 at 6:24 PM
  • Thread is Unresolved
  • zahid990170
    Trophies
    2
    Posts
    41
    • July 27, 2022 at 6:24 PM
    • #1

    Hi,

    I am using SNPX option (HMI communication) with fanuc. The settings on the system variables are as follows:

    $SNPX_PARAM. $MODBUS_ADR = 1

    $SNPX_PARAM.$NUM_MODBUS = 2 (someone on the forum pointed out ,that this value should be above '0')

    Using SNPX_ASG parameter, I tried to map 15 digital outputs, DO[5] - DO[20] and 20 data registers, R[1] - R[20].

    For data registers,

    $SNPX_ASG.$ADDRESS = 51

    $SNPX_ASG.$SIZE = 40

    $SNPX_ASG.$VAR_NAME = R[1]

    $SNPX_ASG.$MULTIPLY = 1000


    For digital outputs,

    $SNPX_ASG.$ADDRESS = 91

    $SNPX_ASG.$SIZE = 15

    $SNPX_ASG.$VAR_NAME = DO[5]

    $SNPX_ASG.$MULTIPLY = 1

    I am using pymodbus to read/write the above. I can write to data registers, using the following:

    client.write_registers(start_address, payload, skip_encode=True, unit=1)

    I use the following to write a DO.

    coil_response = client.write_coil(address=93, value=True, unit=1)

    But, on TP screen, when I MENU -> I/O -> Digital

    DOs are always appearing OFF on TP.

    When I read the status for the DO that was just written,

    coil_response = client.read_coils(address=93, count=1, unit=DEVICE_ID)

    it shows me that it has been 'set'

    Why can't I see the changed status of DOs on TP, or are they really changed.


    thanks,

    Zahid

  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • July 27, 2022 at 8:17 PM
    • #2

    I don't use SNPX, but did you properly configure the Digital Outputs robot side? Rack/Slot Numbers properly setup?

  • HawkME
    Reactions Received
    567
    Trophies
    10
    Posts
    3,268
    • July 28, 2022 at 2:59 AM
    • #3

    Shouldn't you be writing to DIs, not DOs? The robot should be the only thing that can turn on a DO not an external source.

  • Erik Olsen
    Reactions Received
    46
    Trophies
    4
    Posts
    169
    • July 28, 2022 at 7:27 PM
    • #4
    Quote from HawkME

    Shouldn't you be writing to DIs, not DOs? The robot should be the only thing that can turn on a DO not an external source.

    I think HawkME is correct here. The status of your robot DO's arent changing on the teach pendant because they probably aren't changing at all. I'm not 100% sure that something like SNPX or PCDK cant change robot outputs externally but I wouldn't be surprised if they couldn't.

    If you wanted, you could map to some robot DI's and then use the IO-> INTERCONNECT feature on the robot to map those DI's directly to some Digital Outputs. A little bit of extra work on the robot side but this should pass your HMI signals through.

  • zahid990170
    Trophies
    2
    Posts
    41
    • July 29, 2022 at 11:35 AM
    • #5

    thanks all for inputs. I read at a link

    Modbus with pymodbus - HackMD
    # Modbus with pymodbus Hence I can not understand well the usage from the [official document](http
    hackmd.io

    For 'single bit' you have DI, and DOs.

    And, when using modbus, DIs are 'read_only' whereas DOs are the ones that can be 'read and write'. Similarly, input registers are 'read_only' and holding registers can be 'read and write'.

    It was the reason to write to DOs using pymodbus library function.

    Further, modbus addresses in FANUC are one based, but in the library that we use pymodbus they are zero based.

    I noticed though, while

    $SNPX_ASG.$ADDRESS = 91

    $SNPX_ASG.$VAR_NAME = DO[5] (start point is DO[5], at address 90)


    I found out that in fact when I issued the following

    DEVICE_ID = 1

    ADDRESS_START = 90 # actual corresponds to DO[91] on Roboguide

    coil_response = client.write_coil(address=ADDRESS_START, value=True, unit=DEVICE_ID)

    I was able to TURN ON DO[91]. It should have been DO[5]?

    For current purpose, that is ok because I can use DO[91].

    thanks,

    Zahid

    Edited 2 times, last by zahid990170 (July 29, 2022 at 12:05 PM).

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • roboguide
  • SNPX
  • modbus tcp/ip
  • pymodbus
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download