December 17, 2018, 12:29:55 PM
Robotforum | Industrial Robots Community

 Auto Load Files From External Storage


Author Topic:  Auto Load Files From External Storage  (Read 2055 times)

0 Members and 1 Guest are viewing this topic.

May 03, 2017, 01:20:16 PM
Read 2055 times
Offline

fazza85


Hello all,

I have previous experience machining using KUKA robots. Loading files from a USB stick on to the robot was straightforward - highlight multiple files from usb stick then copy and paste.

The memory of the robot allowed a reasonable amount of lines of code before the files had to be deleted and new ones copied on on.

We now have a customer asking for a Kawasaki BX200L for machining. We have completed a few trials and have come to the conclusion that the maximum number of lines of code the robot can store at once is approximately 60,000. This isn't a great deal when machining, and means that we have to stop the robot, delete the old file and copy a new one in every few minutes.

Is there a way to have the robot automatically delete old files then load new ones from a USB stick or over a network? So for example:

Load 2 files on to the robot.
When program 1 has finished and it has moved on to program 2, automatically delete 1 and load number 3 on, then when it moves on to 3 delete 2 and load 4 on etc.

Would really appreciate any advice as to whether or not this is possible!

Cheers

Linkback: https://www.robot-forum.com/robotforum/index.php?topic=23109.0

Today at 12:29:55 PM
Reply #1

Advertisement

Guest

May 03, 2017, 07:04:17 PM
Reply #1
Offline

kwakisaki

Global Moderator
You could use a PC Program to monitor for which program is in use and handle the delete/load....that would be my direction to take.
- TASK or WHICHTASK should be used to monitor the status of the stepper (motion program in use).
- You can use DELETE directly in the motion program or a derivative of this MC DELETE in a PC Program.
- NLOAD command will automatically load files from the USB (E Controller) or PCMCIA (C/D Controller) into the Robot Memory.....reals, locations, programs etc.

Have a read of those........I know the NLOAD command works as I have used it before.
Hope this helps.............

May 04, 2017, 07:33:10 AM
Reply #2
Offline

Kawaguy


Please take a look at this short example:

Code: [Select]
.PROGRAM main
   FOR pgnumber = 1 to maxpg
      wait existreal("pgexist"+$encode(/k3,pgnumber))
      twait 0.5
      scall "machining"+ $encode(/k3,pgnumber)
   END
.END
.PROGRAM pc
  while true
     chkpg = pgnumber-1
     if chkpg>0
       if existpgm("machining"+$encode(/k3,chkpg))
          call delprog(chkpg)
       end
     end
     chkpg = pgnumber+1
     if chkpg>0 and chkpg<=maxpg then
       if not existpgm("machining"+$encode(/k3,chkpg))
          sload 2 = "file"+ $encode(/k3,chkpg)+".as", ret
          if ret<0 then ; when loading with error, do something else
             twait 5 ; 
          end
       end
     end
  end
.END
.program delprog(.nr)
; unfortunalty can't delete a program defined by a string (as far as I know)
  case .nr of
    value 1
      delete machining001
    value 2
      delete machining002
    value 3
      delete machining003
    value 4
      delete machining004
....
....
  end
.end

Your file file001.as should contaiin the pgexistxxx = 1 at the last line. To make sure the program will be executed when loading has finished.

.program machining001()
   pgexist001 = 1 
... machinecode...
.end
.joints
.... your joints 
.end
.reals
... your reals
   pgexists001 = 1
.end


May 04, 2017, 08:35:57 AM
Reply #3
Offline

kwakisaki

Global Moderator

September 10, 2018, 06:02:57 AM
Reply #4
Offline

griphand


Hello,

Nice idea. But, where can I place the file to load? Where is the 'external storage'?

Thank you.


Today at 12:29:55 PM
Reply #5

Advertisement

Guest

September 11, 2018, 07:14:05 AM
Reply #5
Offline

kwakisaki

Global Moderator
'External Storage' is memory external to the Controller.
- E Controller has USB connections for external use such as file/data saves or screen dumps.
- C/D Controller only have PCMCIA Slot for external use for file/data saves only.

By use of NLOAD/SLOAD commands, data can then be loaded from external storage to controller via program instructions.

September 14, 2018, 01:52:50 PM
Reply #6
Offline

griphand


Hello,

It does not work.

We have an F controller.
I wrote a little test program like this:
  NLOAD 1=lt1.as, result
  PRINT "file loaded, result is: ", result

I put 'lt1.as' file on PC (connected on ethernet) and on USB drive too. The file is not loaded, neither. The 'result' variable was some negative number and an error message appeared.

Is there any software switch have to alter to enable this functionality (NLOAD, SLOAD instructions)?

Thank you!



September 14, 2018, 06:29:46 PM
Reply #7
Offline

kwakisaki

Global Moderator
Quote
'External Storage' is memory external to the Controller.
- E Controller has USB connections for external use such as file/data saves or screen dumps.
- C/D Controller only have PCMCIA Slot for external use for file/data saves only.

No mention of PC via Ethernet.................

Try and provide specific errors also, just saying 'the file is not loaded' could be down to many problems:
1. File to load in is incorrect.
2. Data on the file to load in is not correct.
3. Command to load in is not structured/formatted correctly.

Read the NLOAD and SLOAD commands in the AS Manual - I suspect you're written code is incorrectly formatted.
« Last Edit: September 14, 2018, 06:40:36 PM by kwakisaki »

September 20, 2018, 09:20:17 AM
Reply #8
Offline

griphand


Hello,

So, I put one program on the USB drive and one program on the PC. The program named as lt1.as both.
On the USB:
Code: [Select]
.PROGRAM lt1() #0
  PRINT "hello USB"
.END
On the PC:
Code: [Select]
.PROGRAM lt1() #0
  PRINT "hello PC"
.END

I wrote a little test to load the program:
Code: [Select]
.PROGRAM ltest()
  NLOAD 1= lt1,result
  PRINT "Program loaded, result is: ", result
.END


In monitor I type: 'load lt1', : the program loaded from the PC. I type: 'usb_load lt1', the program loaded from the USB drive without error.

Executing ltest: 'execute ltest' (motor power and run is on), the motors turns on, the program executed but the file is not loaded. The result variable  is -12016.


September 20, 2018, 06:47:27 PM
Reply #9
Offline

kwakisaki

Global Moderator
With the USB inserted into the Controller.
Execute your program as a PC Program, this will allow you to run it independently as a standalone program without cycling the robot.
PCEXECUTE 1: ltest

Try altering your program to:
.PROGRAM ltest()
NLOAD ltl,result
PRINT "Program loaded, result is: ", result
.END

Today at 12:29:55 PM
Reply #10

Advertisement

Guest

September 24, 2018, 12:25:38 PM
Reply #10
Offline

griphand


Hello,

I tried it. The result is the same -- program not loaded.

From teach pendant:
  $ usb_load lt1
  Loading... (lt1.as)
  Program lt1()
  File load completed (0 errors)

  $ pcexecute ltest
  $ Program loaded, result is: -12016
  PC program completed. No=1001

The program was not loaded of course.

Btw: I saw somewhere can save screenshot of the teach pendant. I can't find it how now.

Thank you.


September 24, 2018, 05:13:07 PM
Reply #11
Offline

Alexandru


You can save the screenshot from the teach pendat by pressing A+R. You need to have a usb plug in, in order to save the picture.

September 27, 2018, 09:44:14 PM
Reply #12
Offline

kwakisaki

Global Moderator
Hmmmmm, just noticed you are using F Controller.....with this having multiple USB, it is possible the specific USB port may require addressing in the code, but I cannot see any information for this in AS Manual.
I shall try myself when I get the opportunity and see if this is the case.

October 07, 2018, 01:16:43 PM
Reply #13
Offline

Nzhuhu


Dear Kwakisaki and everyone,

I know and im sorry that i did not keep my promise which is put the robot project to sleep....but i could not get it off my head with 1 problem and that is External Storage.

When we all saying External Storage meaning any kind of storage you can have with your robot like Personal Computer, USB, Floppy Disk ( for my vintage robot UX 150 ) or even PLC ? I do not clearly understand, are we meaning when we excute the Coding ( which make our robot moving according to our plan our draw or even our GCode ), the robot's controller will extracting or reading the Step or Line ( cnc ) DIRECTLY from our Storage which does not have to copy the Code to Controller's CMOS RAM ( Flash RAM ) which is very limited only 10mb max for new version and 1mb max for my vintage ?

If my theory above is correct then our first need is USB owner and Floppy Disk Owner ( me ) need to make sure our external storage is Formated as our Robot Required ! ( i need abit explain here from expert because my UX150 required me to but Floppy Disk in and excute Format from Controller ).

And somehow both my guess above are correct then we need to tell the Robot that the CODE is PC program.....

What about PLC ? Can it help ?

Anyway, all the best to everyone.

Trung

October 08, 2018, 01:39:35 PM
Reply #14
Offline

griphand


Hello,

Yes I have an F controller. And I have AS Language Reference Manual for the E controller only. Is this matter?

I tried "NLOAD lt1,result" in a motion program (without the "1=" pre) and the controller waits forever for something.

I see the handling of the USB drive is very lazy. I removed the USB drive and deleted some files and replugged it. The 'usb_fdir' command shows the deleted files in the list too. I made a screenshot with A+R, then the new 'usb_fdir' command shows the correct list.

Thank you

Today at 12:29:55 PM
Reply #15

Advertisement

Guest

October 08, 2018, 08:11:11 PM
Reply #15
Offline

kwakisaki

Global Moderator
When you create these programs 'offline', I assume you are using a text editor?
- Are you pressing 'enter' after the .END before saving the file prior to loading in, if not try this.

October 09, 2018, 01:05:34 AM
Reply #16
Offline

Nzhuhu



Please correct if i am wrong. PC Program is an commmand which telling robot to run the Code from external Storage or is it a funtion I have to manualy choose the list of command in it ? Could we make it more simple as making the robot run from External Storage and the CMOS Ram will act as the bridge which feeding step to CPU and planning next step ready for CPU ? Our only problem is Limited internal Storage, I really want to make the Internal Storage stop storing Code File. Are we call this action is " Online Movement " which the robot get feed directly from External Storage, no External no more run.

October 09, 2018, 05:14:54 PM
Reply #17
Offline

kwakisaki

Global Moderator
PC Program is a completely independent program that can be executed irrespective of whether the robot is executing motion instructions.
- It is referred to generally as 'asynchronous', and in simple terms it is like your antivirus on a PC (it operates in the background, independent to your main motion programs, but programmed to do a task).
- An basic example would be, constantly monitor for a button to be pressed and if that button is pressed - turn on a light on/off.
- This could be executed on power up of the Controller, even though the robot is not moving or even if it is under emergency stop.

If you 'drip feed' commands from an external source, you will always introduce latency during the process, so until Kawasaki increase the internal storage, this will always be a question I think.
- Most standard industrial processes, do not require substantial amounts of memory to achieve the result and I think the Kawasaki's are more engineered to this whereas in comparison to other Manufacturers (Kuka come to mind) have a more broad application base for what they produce.

Regarding this specific problem with the F Controller, I have tested it also and receiving the same results, on E Controller there is no problem.
I think you need to contact your distributor as it appears either:
- This is a software bug.
- Or there is a new command structure, which has not been included in the latest revision of AS Manual.


October 10, 2018, 06:42:58 AM
Reply #18
Offline

griphand


Hello,

Thank you for testing it.

I tried to use the drive name 'USB1\' in the file name, same result -- file not loaded.
Removed all other files from the drive, could not help.
I made a screenshot before load to activate the USB drive (I noticed the screenshot is made on USB1 always.) -- file not loaded.
It seems like an sw bug or the 'external storage' is something else.

October 10, 2018, 06:53:57 AM
Reply #19
Offline

Nzhuhu


Thank you Kwakisaki,

Now i know that Pc Program command will not help anything on large code file. Back to our problem, the code file is too large to be saved on internal storage and we can not drip communication ( online feed code machine like mach3 ), or DNC - MME box ( live feed data to vintage fanuc cnc system ).  We only have solution is divide large file to many small parts save on external storage such as usb or FDD and manual load-delete on  internal storage...is there an command at the end of part 1 to tell it auto delete part 1 and load part 2 and auto execute?

Today at 12:29:55 PM
Reply #20

Advertisement

Guest

October 12, 2018, 07:27:08 AM
Reply #20
Offline

kwakisaki

Global Moderator
If you have a look at the example Kawaguy kindly posted on page[1], that's exactly what the process is.
The issue you will likely encounter is due to the age/technology of your equipment only having 1Mb of SRAM available, would limit your no. of steps and the only way of downloading/replacing the data is the FDD (which will be very slow indeed).
Saying that though, if your process does not happen to use up all the SRAM, then it shouldn't be an issue.
- But when it comes to machining, then you are looking at many steps which need the storage.

You can still of course drip information, but this would need to be carefully managed and controlled to prevent 'pausing' during the main process.

October 14, 2018, 08:33:32 AM
Reply #21
Offline

Nzhuhu


Dear Kwakisaki,

I would love to learn and read Kawaguy's code but please accept my apology for lacking of knowledge. I am trying to dig in my AD manual to find out the way to Run the mother program which will tell the controller to copy Code part 1 to Sram - then execute the part 1 - delete part 1 in Sram when the code is done - copy part 2 - execute - delete part 2 - and so on. If i can figure it then we do not have to copy and paste it manually.

Easier to understand is we Double Click on Auto Run when install some thing on PC. Even MS-Dos can do that kind of funtion but I do not remember how.

Thank you Kwakisaki,
Trung

October 14, 2018, 07:53:02 PM
Reply #22
Offline

kwakisaki

Global Moderator
AD Controllers were more designed to enter programs using the Teach Pendant, this was due to the technology at the time.
You also have a terminal editor built into the Display by use of the removable keyboard to enter programs using AS Programming Language.
Remembering back, they also introduced a terminal editing software called KCMon (which I think could also be used when loaded on a PC to write AS programs on the Controller), I think it used Parallel Communication via the printer port, but cannot be 100% sure.
- I will try and locate further information on that and post if I can find any.

You can also opt to use a text editor in the PC, create the programs offline, transfer them to FD and then load them into the Controller that way.


Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

clip
How do I load files from archives?

Started by davenhunt on KUKA Robot Forum

1 Replies
1474 Views
Last post October 07, 2014, 05:15:51 PM
by panic mode
clip
Error when trying to load files

Started by canvis on Fanuc Robot Forum

6 Replies
2290 Views
Last post February 04, 2016, 03:25:52 PM
by canvis
xx
Load script files in UR simulator

Started by mvp on Universal Robots

5 Replies
3334 Views
Last post February 03, 2016, 05:55:47 PM
by claycamel
clip
Fanuc Karel Load .LS Files

Started by luijtena on Fanuc Robot Forum

5 Replies
2289 Views
Last post April 28, 2017, 08:23:58 AM
by lexx905