RobotStudio event

Need to get the value of a lot of RAPID variables every 1-2s

I have implemented a program in C#, Windows Forms, where I use a timer to get the value of the Rapid Data variables. The issue is that this timer has 700 code lines, that every interval time reads/writes from/to the controller, if I try to set the interval of the timer less than 2s, the program works extremely slow, and it end up finishing the execution. So if I increase this interval to for example 5s, it works better, but my programe needs to recieve/send data in real time, so moreless with 1-2s of delay is not that bad in comparision with the 5s.

I have tried to use the timers of the System.Threading, but its delegate request an static method to work properly, and if I try to get the values from my controller with a static method its not working due to there is a mistake.

I have been looking for a solution, but I could not solve it.


  • Tompanhuhu
    You should really consider doing such datatransfers with a backgroundworker or a backgroundthread. 
    Not the UIthread. And if there is any changes to present to the ui invoke the UI and publish the changes. 

    You could also use the subscription events in the robotcontroller to only be notified when robotdata has changed, and not poll the robot every 2ms. 
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile: