RobotStudio event

Reading out module name

Options

I'm loading the specific product module with "Load". To erase the old product module I use "EraseModule". As long as the filename is the same as the module name it is fine. But if not I cannot erase the module.

Is there a function to read the module name from the module actually loaded in the ram?

Thanks
Stefan

Comments

  • RussD
    Options

    Is there a reason why you don't use Unload instead of EraseModule?

    Are you asking if it is possible to determine the filename that contains the declaration of a RAPID module?

    Russell Drown
  • Hello Russ

    The reason see below. But I'm not sure "EraseModule" really works as described.


    EraseModule
    is used to remove a module from the program memory during execution. There are no restrictions on how the module was loaded. It could have been loaded manually, from the configuration or with a combination of the instructions Load, StartLoad and WaitLoad.
    UnLoad
    is used to unload a program module from the program memory during execution. The program module must previously have been loaded into the program memory using the instructions Load or StartLoad - WaitLoad.
    Yes, I like to determine the filename that contains the declaration of the loaded RAPID module. As with "Load" the filename of the file is used and with "UnLoad" or "EraseModule" the module name is used they don't have to be the same.
    Thanks,
    Stefan
    stefan z2007-12-16 13:15:33
  • j_proulx
    Options

    Hello:

    This Rapid function is available since RW 5.09

    New RAPID function ModExist <?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    New RAPID function to check if a given module exists or not in the program task:

    FUNC bool ModExist (

       string ModuleName )

    New error recovery constant ERR_MOD_NOT_LOADED for the function ModTime, if the module doesn't exist in the program task.

    BR

    Jim Proulx