Setting & Connecting with RS 232 & RS 485
'If you're not connected, then connect
If (Not MSComm1(Index).PortOpen) Then
' Set the Comm Port number to the value in the Comm Port text box
MSComm1(Index).CommPort = Val(txtPort(Index).Text)
' Set Baud Rate and Parity
MSComm1.Settings = "9600,N,8,1" 'RS 485
MSComm1.Settings = "19200,N,8,1" 'RS 232
' Open the port
MSComm1(Index).PortOpen = True
MSComm1(Index).InputLen = 0
MSComm1(Index).RThreshold = 1
End If
Setting & Connecting with GPIB
' Set the timeout to the value in the timeout box (milliseconds)
TMWControl1.TimeOut = Trim(Str(Val(txtTimeout488.Text)))
' Set the address to the value in the address box final address will appear as: GPIB0::1::INSTR
TMWControl1.address = "GPIB" & Trim(Str(Val(txtPort(Index).Text))) & "::" &
Trim(Str(Val(txtAddress(Index).Text))) '& "::INSTR"
Setting & Connecting with TCP/IP
' If you're not connected, then connect
If tcpClient1.State <> sckConnected Then
' IP address "###.###.###.###" Set the address to the value in the address box
tcpClient1.RemoteHost = txtAddress(Index).Text
' Set the port to the value in the port box
tcpClient1.RemotePort = txtPort(Index).Text
' Close it first – just in case
While tcpClient1.State <> sckClosed
Wend
' Connect
tcpClient1.Connect
End If
Synergy Controller Technical Manual, Revision H
Visual Basic Code: Setting & Connecting
tcpClient1.Close
Page 282
Need help?
Do you have a question about the Synergy Series and is the answer not in the manual?
Questions and answers