RobotStudio event

Creating Rapiddata in a Routine

Hello,
I tried to create Rapiddata e.g. welddata in a Routine but somehow it doesnA't work with the FlexPendant SDK 5.13.02. Is this even possible using the FlexPendant SDK ?.

This is what i want to get:

Module myModule

Proc myRoutine()
 LOCAL VAR welddata myWelddata[[10,[0,0,0,0,0,0],[0,0,0,0,0,0]];
Endproc

Endmodule

I can create Rapiddata on module level using the following code (Creates welddata in the selected module with selected Scope (task,local,global) and selected Type (Pers,Var,const)

   private void CreateRapidData()
        {
            Task[] allTasks = _controller.Rapid.GetTasks();
            Task firstTask = allTasks[0];
            Module mod = firstTask.GetModule(this._cbModule.SelectedItem.ToString());
           
            try
            {
                mod.CreateRapidData(this._tbName.Text, "welddata" ,_SelectedScope, _SelectedType);
            }

            catch (System.NullReferenceException ee)
            {
                GTPUMessageBox.Show(this, null, ee.Message);
            }
            catch (Exception ee)
            {
                GTPUMessageBox.Show(this, null, ee.Message);
            }


...but i want to create the data in a selected Routine. Has someone done this before ?