APIs, concepts, guides, and more

◆ StartTheNetwork()

static void StartTheNetwork ( MotionController controller)
static
Parameters
controllerPointer to the MotionController to start the network on.
Exceptions
ExceptionThrown if the network does not reach the OPERATIONAL state.
Code Snippet
public static void StartTheNetwork(MotionController controller)
{
// check if network is started already
if (controller.NetworkStateGet() != RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Starting Network..");
// if not started, initialize the network
controller.NetworkStart();
}
// check if network is started again
if (controller.NetworkStateGet() != RSINetworkState.RSINetworkStateOPERATIONAL)
{
// read network log messages
int messagesToRead = controller.NetworkLogMessageCountGet();
// print all the messages to help figure out the problem
for (int i = 0; i < messagesToRead; i++)
Console.WriteLine(controller.NetworkLogMessageGet(i));
throw new SystemException("Expected OPERATIONAL state but the network did not get there.");
}
else
{
Console.WriteLine("Network Started");
}
}
See also
CheckErrors

Definition at line 47 of file _helpers.cs.