.

Controller.Connect

Attempts to connect to a physical controller or load a memory dump file created by a physical controller.

Overload 1 will perform initialization after a connection is established. If the SynqNet network is not in Synq mode, the Connect will attempt to perform SynqNet network initialization.

Overload 2 allows an application to specify whether or not initialization will take place after a connection is established with a controller. If the initialize argument is True, Connect will perform the same initialization that takes place in Overload 1. If the initialize argument is False, no initialization is made. This is useful for applications that only want to observe the current state of a controller and not affect how another application works.

Version History

Introduced in MPX 2.0.

Result

Void

Arguments

Overload 1

None

Overload 2

 
Argument Type Description
initialize
Boolean
Specifies whether or not initialization will take place after a connection is established to a controller.

Common Exceptions

 
Error Occurs when...
ControllerAlreadyConnected The controller object is already connected to a physical controller.
PacketCommunication A TCP/IP connection cannot be made to the remote controller.

 

Visual Basic

Syntax

Sub Connect()

Sample Code

 
Mpx.Controller controller = new Mpx.Controller();

With controller
    .Type = Mpx.ControllerType.Remote;
    .Port = 3310;
    .Location = "192.168.1.74";
    .Connect(); 
End With
 


Sample Application

 

C#

Syntax

void Connect();

Sample Code

 
Mpx.Controller controller = new Mpx.Controller();

controller.Type = Mpx.ControllerType.Remote;
controller.Port = 3310;
controller.Location = "192.168.1.74";
controller.Connect(); 
 

 

 

See Also

Disconnect
IsConnected

Overviews
Overview Controller Initialization
Overview of SynqNet Network Initialization

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering