How to use khash.exe?

  • change the ip address for the Office.Lite? Doesn't necessarily explain why it won't mount the shared folder on my laptop, no?

  • On a "real" KRC, you don't want to do anything using the forbidden subnets. That strictly reserved for the virtual network connection between the Windows and VxWorks halves of the robot's brain. Instead, you would set the KLI IP to an address that's not in one of the Forbidden Subnets, and do your connections that way.


    OfficeLite... makes things more complicated. But modern OL runs in a virtual machine, so I would expect the FBs to remain the same. What I'm not certain of is how to map the OL KLI to a virtual NIC provided by the VM host.

  • Well, I can go to the lab next door and jump on the quantec with 8.3.X.. but I never even got a mount there. Very curious.


    As for the hash question, if its a shared folder on my laptop, I hash the password for the local user on my laptop win10, not the KukaUser password that you hash to mount locally.

  • Yes, the hash needs to be the login credentials for the computer sharing the folder. Hashing the robot login credentials would be pointless.


    I don't have any specific advice, but I can say that the KRC uses the same means of accessing shares as any Windows or Linux computer (in fact, while the KRL Mount and Open commands are executing in KSS, KSS is running inside VxWorks which is really just a modified Unix/Linux). It should be standard SMB or CIFS.


    So, if you go to the Windows command line inside the robot, and use the NET USE commands to mount/dismount remote shares, it should work the same as if you were using a regular Windows computer. And if it doesn't work, you should get some more detailed feedback as to what went wrong.

  • Maybe I am missing something:


    # connect to directory

    krl_mount()


    # file handling

    krl_fopen()

    krl_fwriteln()

    krl_fclose()


    # disconnect from directory

    krl_unmount


    The given ip address is for shared memory (SMEM) only (you can not connect to from a different pc). In this case you need the windows ip address for LAN

  • Thanks for the responses, guys. Since it seems Office.Lite and/or VMware could be causing some networking issue I've moved to a controller running KSS 8.3.28. KUKA recommended adding a function call to krl_fclose_all prior to attempting any mount.


    I have connected my laptop to the controller.

    Minimised the HMI and navigated to the folder (\\172.31.1.149\Share) to ensure its there.

    Logged in with user "kuka" & pw "kuka" and sure enough I can access the shared folder from the windows side on the controller.

    Double checked the khash for the password.

    Updated the KRL as follows:



    and yet no luck with the directory mounting. kuka just have me going in circles constantly checking the shared folder permissions.. I don't know where else to look.

  • Two more things to say:



    You only may mount it one at the time

    If you are trying to mount an already mounted directory you get the error as you mentioned above (in krl)


    According to your post #46 you are not following my suggestion from post #45


    Why do you want to close files when no directory is mounted. Are you trying to send the files to nirwana?

  • You've lost me. I am attempting to mount a directory on my laptop via //172.31.1.149/ (I stopped trying office.lite in case that was the problem), the controller is 172.31.1.147. I can see the folder on the controller, its accessible and writable.


    What other IP would be used for LAN?

  • SkyeFire:


    On the controller:

    NET USE is the command-line tool for mounting and dismounting remote SMB/CIFS shares. The KRL_MOUNT command works more like this than browsing to the share using the file explorer. You'll want to research the command switches.


    If you can browse to the share, NET USE should work, but it's worth double-checking. If NET USE can mount the remote share, and KRL_MOUNT can't, using the same IP, share name, and credentials, then I'm a bit stumped.


    My only other suggestion would be to use WireShark on the laptop and examine the packet traffic between the laptop and KRC when a successful NET USE mount is executed, and when an unsuccessful KRL_MOUNT is performed.

  • My results so far:


    Using OL the networks are seperated:

    192.168.0.1 windowsside from shared memory (can be uses only within OL - no access from outside)

    172.31.1.147 windowsside from LAN (can be used only from outside)


  • Did you have any success, Mom? My OL would mount the drive, but always fail at creating the file.

    On the KSS 8.3.28 controller I can't even successfully mount, let alone read/write.

  • If you check my post #51 - it is possible!


    If you want to use a directory called by your krl code

    then the directory must exist (in your case it is c:\KRC\ROBOTER\UserFiles\test\)



    from external pc you can access directory, if



    external pc

  • If you want to use a directory called by your krl code

    then the directory must exist (in your case it is c:\KRC\ROBOTER\UserFiles\test\)

    Is that not for local read/write on the controller itself. not on a mounted drive like I'm attempting? take this code:

    Code
    cwrite($FCT_CALL, state, mode1, "krl_mount", "/test", "//172.31.1.149/Share", "kuka", "0B0D0E42DBF83DB8F740013D3E2E694CD3")

    You're saying it should create c:\KRC\ROBOTER\UserFiles\test\, but the documentation states if the folder doesn't exist, cwrite creates it.


    I'm not entirely clear on what you're showing me in those images? Is the computer management the controller or my laptop?

  • You're saying it should create c:\KRC\ROBOTER\UserFiles\test\, but the documentation states if the folder doesn't exist, cwrite creates it.

    I read this as an enabled net network drive does exists (it will not be created)

    krl_fopen can create a file in this directory using the "a" option

    192.168.0.1 windowsside from shared memory (can be uses only within OL - no access from outside)

    KRL (vxworks) can only access the harddrive thru shared memory (using this 192.168.0.1 ip address)


    I'm not entirely clear on what you're showing me in those images? Is the computer management the controller or my laptop?

    The directory you want to access is located on OL and therefore the "Computer Management screen" ist the one in OL (otherwise it does not make sense)

  • the red lines in post #51 are actually debug information and telling that everything went well running the commands in the krl code (commands are dark blue)


    I also think that those commands are synch commands. The execution will continue after the command is executed and therefore no delay (like wait sec) is needed.


    khash.exe is the programme only needed to create the encrypted password needed by the krl_mount command.


    Accessing the shared directory by the same or different PC the user name and the real password is needed


    This only works if simple file sharing is disabled, otherwise vxworks is not able to access the hard drive.

  • I am no longer working with OL. I am on KR C with my laptop connected via KLI. The directory exists on my laptop and is accessible via windows on the controller: \\147.31.1.149\Share


    krl_mount refuses to connect, with error -2.


    check my post #46

Advertising from our partners