System module - Save

MathewMathew Australia
I need to know how can I save the system module file which consists of Persistent data in an matrix array. Is there any procedure to save the file and how often we can save the file as the data in the matrix will change. We need this function as the data will be lost if there is any power failure. Can anybody advise?


Tagged:

Comments

  • lemster68lemster68 United States ✭✭
    Because it is PERS data the last values will be preserved on boot up after powering down (or failure).  That is, unless it cannot reboot because of some more serious failure.  Nevertheless, you can write it into your program to save the module every cycle.  But, it will take a moment, and thus, cycle time.
  • MathewMathew Australia
    Thanks for the info.

    I can use the following instructions - Save Instruction - in a program

    Load "HOME:/USER.SYS";

    Save "USER" \FilePath:="HOME:" \File:="DIR\USER.SYS"; with certain conditions.. 

    My data will change every 15 secs..The problem is if I use every 15 secs to save the module..it's going to affect my cycle time..

    Is there any other ways of saving the module without affecting the cycle time..

    Thanks
  • lemster68lemster68 United States ✭✭
    No need to load the module. As a matter of fact, you risk overwriting the current value with outdated values.  Remember, the values will be retained under normal restart/power failure conditions.  The likely hood that you lose the data is more of an exception than the rule.  Anyway, if you have a background task running, or can add one, you could have that task do it perhaps use IPers to save when your data has changed.
  • MathewMathew Australia

    You are right . It's a Persistent data of array in a matrix. The property of a persistent matrix is that its gets updated at every cycle .

    I have to check whether I can add a task(Background task) - it is possible only if there is a 623-1 multitasking option?.

    If I still want to include the Save Instruction, Your suggestion is not to use Load instruction. Am I right?

    Thanks

  • lemster68lemster68 United States ✭✭
    Yes, you must have the multitasking option and yes again, do not load first.  Without multitasking all I can suggest now is the IPers with a trap to save module, probably will still cost you some cycle time.
  • Does it have to be saved in a module? If not, you can just save it as a .txt file and only retrieve it when needed since PERS variables are retained and the chance of failing this is very small as pointed by lemster68.

    You can use Open, Write, Close instructions for txt file if you want.
  • MathewMathew Australia
    Not necessary to be saved in a module. The data's are very important. As suggested, I can save this as a .txt file and can use the instructions.

    Another question : Instead of saving this file in Local "Home" Folder , if connected to a network/dedicated PC through LAN , Can we write a program to save this file in Hard drive of PC or the server?

    Thanks lemster68 and ko414du4 for your comments.

  • Mathew said:

    Another question : Instead of saving this file in Local "Home" Folder , if connected to a network/dedicated PC through LAN , Can we write a program to save this file in Hard drive of PC or the server?

    I believe you can by using FTP. Saying that, I have not done it. Looks like I'm going to do it in the next project. Anyway, to do this I believe you need PC-interface option included in the robot so the controller can be seen on the network.
  • MathewMathew Australia
    Hello,

    By the way can we do the save directly on a USB drive sticked to the usb port through calling a routine by save instruction..I want to save a sys module through.
  • soupsoup Oregon, USA ✭✭✭
    Saving to a USB drive is as easy as changing the path. Search "Open" in the RAPID manual.

    Every 15 seconds is pretty often -- at first glance, I'd consider 2 background tasks -- one which saves just the important data locally as text to a large USB drive (creating a new file for the data hourly), then the second task can save the text file to a network drive every hour to gain easier access while lessening network traffic to once an hour.
  • MathewMathew Australia

    Thanks for the comments.

    If I understood correctly, I will try open the USB disk(removable disk) by using Open instruction.

    But I don't want to save the data as a txt file.I want to save the complete sys module file as it is using Save Instruction.

    So I will use the following instruction:

    Save "user" \FilePath:= "usbdisk:/user.sys";

    So by using this save instruction can I get the user.sys file saved in my memory stick(USB drive).

     Hope you understood my requirement.

  • soupsoup Oregon, USA ✭✭✭
    Yes, that should work. But, you're saving over the previous file. Save is good, but search "Open" in the Rapid Manual to see a better explanation of file paths to USB drives.
Sign In or Register to comment.