Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Resolution changes when connecting RoboDK with C#

#1
Hey, it's Miguel!

I'm working on a C# Forms App where I have the RoboDK process opened and attached to a panel in my Form, and in the same Form, I have one button for changing the simulation speed of the RoboDK. 
The problem is that I have stablished a resolution for my Form but when clicking the button and connecting to RoboDK, this resolution changes and my form minimizes. The simulation speed changes correctly and in my Form is stablished to always be maximized and with a specified resolution, so there's not the problem, the problem is that this resolution changes when clicking the button and connecting to RoboDK.

The code I am using to change de simulation speed when clicking the button is below.

Any help would be appreciated. 

Thank you all and have a nice day!


Attached Files Image(s)
   
#2
You should not call the Connect method every time. Instead, you should use Connected method to check the connection status.

You can simply do this:
Code:
RoboDK roboDK = new RoboDK();
if (!roboDK.Connected()){
// something went wrong
}
roboDK.SetSimulationSpeed(100);

However, this check may be redundant. RoboDK will throw exception if you try to do something when the connection got broken.
  




Users browsing this thread:
1 Guest(s)