RobotStudio event

Rapiddata write and read problem

hi iam using rab 5.12 and visual studio 2008 .net basic so
iam writing and reading IO signal but i want to change some of rapid data

for example task name T_ROB1 , module name test, and data name counter

counter has got onyl number

please help me how can i read and write this value .net basic

 

2 textbox and 2 button

one button read rapiddata and write textbox

other button write textbox value to rapiddata

 

thank for your help

Comments

  • please help me

  • Hi,
     

    use the class RapidData and its property Value to read and write RAPID data values.

    I suggest that you take a look in the RAB User's Guide in the chapter "Working with RAPID data".

     

    In order to get a RapidData object you can for example use the metod Rapid.GetRapidData()

     

    Here is an example from the FlexPendant SDK documentation;

    [code]

    private RapidData GetMessageID()
    {
        RapidData rData = null;
        Task tRob1 = null;
        try
        {
            // Create temporary controller object to get task
            using (Controller c = new Controller())
            {
                tRob1 = c.Rapid.GetTask("T_ROB1");

                if (tRob1 != null)
                {
                    // Only send one parameter to get shared data
                    rData = tRob1.GetRapidData("nMessageID");
                }
                else
                {
                    // No task to search from
                }
            }
        }
        catch (GeneralException ge)
        {
            // TODO: Add error handling
        }
        catch (System.Exception se)
        {
            // TODO: Add error handling
        }
        finally
        {
            // Release temporary resources
            if (tRob1 != null)
            {
                tRob1.Dispose();
                tRob1 = null;
            }
        }
        return rData;
    }

    [/code]

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • i  cant do this :( i do everything but i dont read or write an any rapid data value i need only one simple application
  • Hi blackcoder!

     

    Are you new to .NET programming or only to PC SDK?

     

    What have you done so far? Do you have an application (MyApplication.exe) where you have written code to connect to the controller, and now wants to do something more? Or do you simply want to have a sample application that shows how to connect to a controller using PC SDK? 

     

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • no i am a new for flexpendant sdk 
    i want to write an application to flexpendant not a pc so in this application for example i want to change num1 value one text box one button and when i push to button iwant to set num1 value to text1.text
  • OK I see.
    I recommend that you start prototyping using ScreenMaker (in RobotStudio) which lets you create a FlexPendant application without coding.

     

    If you want you can export the ScreenMaker project as a Visual Studio project. Its a good way to get started since the essential code is generated for you, and you can continue coding from there.

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog