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. KUKA 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

CWRITE File handling on mounted drive - access denied?

  • magyaricsn
  • October 2, 2024 at 4:37 PM
  • Thread is Unresolved
  • magyaricsn
    Trophies
    2
    Posts
    10
    • October 2, 2024 at 4:37 PM
    • #1

    Hi,

    I have a little problem.

    I have made a sub file that, when certain events occur, writes a few lines to a txt file. It works great.

    Now, I want to make the robot to do it so I can access it remotely, or even better, write the file to a remote PC.

    The access it remotely version: Just share the C:\KRC\Roboter\UserFiles folder on the network and remote PCs will see it if usedwith the KukaUser credentials. It works great.


    The other version, however, is not.

    So, all of our cells have a SCADA PC connected to them, and that'd be great to have these txt files to just spawn instantly there.

    The method in theory is this:
    Using CWRITE I make a mount, file handling from opening to closing, then unmount.

    If I use the Administrator credentials in the KRL_mount command, and FOPEN in method "a", it works like charm.

    However, if I use any other credentials that are not Administrators but still have read/write privileges to the folder I want to use, my access is denied with error number -2. If I use method "r", the read part of the function works, but neither the remove nor the writing will not in "a" method. The reason to not use Admin user is becasue by company policy, every user that has Admin rights have to change their password monthly, and we have over 100 Kuka robots to change these khash password on.


    So this must be a privilege issue. What makes it more complicated is that if I minimize HMI on SmartPad and use Windows Explorer to write and delete files in the SCADA PCs shared folder, it also works as expected. So only the KRL_FOPEN does not work.


    Robot is running KSS 8.6.6.296; KR50 R2100.


    Here's part of my test code:

    Code
         ;FOLD Mount test
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_fclose_all", -1)
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL_FCLOSE_ALL succeeded", "Close")
          ELSE         
             MsgNotify("KRL_FCLOSE_ALL error %1", "Close",_OPSTATE.MSG_NO)
          ENDIF
          
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_mount", "/Log", "//[scada_pc_ip]/disk_d", "Administrator", "[khashPW]")
          ON_ERROR_PROCEED
          ;CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_mount", "/Log", "//[scada_pc_ip]/disk_d", "User1", "[khashPW]")
          ON_ERROR_PROCEED
          ;CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_mount", "/Log", "//[scada_pc_ip]/disk_d", "User2", "[khashPW]")
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL Mount succeeded", "Mount")
          ELSE         
             MsgNotify("KRL_Mount error %1", "Mount",_OPSTATE.MSG_NO)
          ENDIF     
          
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_fopen", "/Log/Log/Test.txt", "a", counter)
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL_Opem succeeded", "Open")
          ELSE         
             MsgNotify("KRL_Open error %1", "Open",_OPSTATE.MSG_NO)
          ENDIF
          
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_fwriteln", counter, "testtartalom")
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL_Write succeeded", "Write")
          ELSE         
             MsgNotify("KRL_Write error %1", "Write",_OPSTATE.MSG_NO)
          ENDIF
          
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_fclose", counter)
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL Close succeeded", "Fclose")
          ELSE         
             MsgNotify("KRL CLose error %1", "Close",_OPSTATE.MSG_NO)
          ENDIF
          
          ON_ERROR_PROCEED
          ;CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_remove", "/Log/Log/Test.txt")
          ;MsgNotify("KRL_REMOVE error %1", "Open",_OPSTATE.MSG_NO)
          
          ON_ERROR_PROCEED
          CWRITE($FCT_CALL, _OPSTATE, _MODE, "krl_unmount", "/Log")
          IF _OPSTATE.MSG_NO == 0 THEN 
             MsgNotify("KRL_unmount succeeded", "Mount")
          ELSE         
             MsgNotify("KRL_unmount error %1", "Mount",_OPSTATE.MSG_NO)
          ENDIF
       ;ENDFOLD
    Display More

    Edited once, last by magyaricsn (October 2, 2024 at 4:43 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
  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