RobotStudio event

PCSDK loading .modx to omnicore robot

Hi I'm not able to load a module with the extension .modx to a omnicore robotcontroller.

The PCSDK returns an error it must be a .sys or .mod file, but when I upload the module as .mod the encoding is a mess. Any workarounds? 
Systemintegrator - Web / C# / Rapid / Robotstudio

If I helped, please press Vote Up  :smile:

☑️2024 - RobotStudio® User Group

Comments

  • I attach a screenshot of the exception dialog. 


    Omnicore has implemented a new module extension for UTF-16 encoding? 
    .modx
    When I upload a module with .mod extension the encoding is messed up.
    When i then unload that module from the robotcontroller it's saved as a .modx? 

    @NilsOlofsson
    You seem engaged in issues can you give any feedback if this issue is being investigated? 
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • Have you tried this in the new PC SDK 2021.1.1 that became available today? at:
    https://developercenter.robotstudio.com/ 


    Nils Olofsson
    PC Software Support Engineer

  • Have you tried this in the new PC SDK 2021.1.1 that became available today? at:
    https://developercenter.robotstudio.com/ 

    I just tried and get a new type of error.
    Can you help me with how to path to the file that's stored in the robot HOME catalog should be pointed out?


    This is my code
    
    string home = controller.GetEnvironmentVariable("HOME");
    controller.Rapid.GetTask("T_ROB1").LoadModuleFromFile(home + $"/m_asd.modx", ABB.Robotics.Controllers.RapidDomain.RapidLoadMode.Replace);

    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • Maxim Riabichev
    edited April 2021
    Hello there,

    This is a bug in RS2021.1 that affects loading modules both via RobotStudio and PC SDK.

    I will post an update when R&D provides a target release for a fix.
    Post edited by Maxim Riabichev on

    Maxim Riabichev
    PC Software Support Engineer
  • Hello there,

    This is a bug in RS2021.1 that affects loading modules both via RobotStudio and PC SDK.

    I will post an update when R&D provides a target release for a fix.
    Thank you for the feedback.
    Please ping me at the forum when a fix is available, i would appreciate it. 
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • @Tompanhuhu can you try making the full path look like this "HOME/m_asd.modx" and see if you get an exception?

    Maxim Riabichev
    PC Software Support Engineer
  • @Tompanhuhu can you try making the full path look like this "HOME/m_asd.modx" and see if you get an exception?
    Hi I just tried and it worked loaded the module to the robotcontroller.
    But I still have encoding issues. When the file is encoded as ANSI:
    The original module:
    MODULE m_ads
        !Detta är en modul
        !1234567890
        !ÅÄÖ
        !== ?? "" !!
    ENDMODULE
    Module loaded to the robotcontroller
    MODULE m_ads
        !Detta �r en modul
        !1234567890
        !���
        !== ?? "" !!
    ENDMODULE

    When the file is encoded in UTF-8 it's not possible to upload it to the robotcontroller.
    I get this error msg:

    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • Okay, thanks for checking.

    I will look into the encoding issue tomorrow.

    Maxim Riabichev
    PC Software Support Engineer
  • @Tompanhuhu what RW are you running on the controller?

    Maxim Riabichev
    PC Software Support Engineer
  • @Tompanhuhu what RW are you running on the controller?
    RW 7.2
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • Maxim Riabichev
    edited April 2021
    @Tompanhuhu
    I just tried to reproduce the issue you're experiencing but was unable to do so.

    I created a testModule.modx in Notepad++ with Encoding set to UTF-8.

    Then, based on my PC SDK Sample app available here https://bitbucket.org/mawkes/pcsdk/src/PCSDK_2021.1.1/ I modified MainWindow.xaml.cs to look like this:

    private void ComboBox_Tasks_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                Application.Current.MainWindow.Width = 750;
                StackPanel_TaskControl.Visibility = Visibility.Visible;
                ComboBox_Modules.Visibility = Visibility.Visible;
                var comboBoxTasks = sender as ComboBox;
                AppControllerData.SelectedTask = comboBoxTasks.SelectedItem as Task;
                AppControllerData.Modules?.Clear();
                AppControllerData.RapidVariables?.Clear();

                if (AppControllerData.SelectedTask != null)
                {
                    string fullPath = "HOME/";
                    using (Mastership master = Mastership.Request(AppControllerData.SelectedController))
                    {
                        try
                        {
                            AppControllerData.SelectedTask.LoadModuleFromFile(fullPath + "testModule.modx", RapidLoadMode.Replace);

                            master.Release();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Unexpected error occurred: " + ex.Message);
                        }
                    }
                }
                else
                {
                    return;
                }
                AppControllerData.Modules = AppControllerData.SelectedTask.GetModules().ToList();
            }


    Running a 7.2RW VC, I placed the file in the HOME directory of the controller.

    I then started my little PC SDK app example in VS, selected the task T_ROB1 and the file got transferred to the task under name m_ads with the content looking UTF-8 encoded:




    Post edited by Maxim Riabichev on

    Maxim Riabichev
    PC Software Support Engineer
  • @Maxim Riabichev
    Hi I just tried to save a module directly from the robotcontroller as .modx and then reupload it back to the controller with PCSDK and the encoding seems to be correct.

    Thank you for handling this issue so quickly. 
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group