Serial Port Tool focuses on COM Port communication software for RS232 related works.
How to Use Visual Basic 2008 for ProXR

Visual Basic is our preferred language for communicating to the NCD product line. Visual Basic 2008 is an evolution of the Visual Basic language that is engineered for productively building type-safe and object-oriented applications.The Visual Basic 2008 Express Edtion is free download from Microsoft. If you are a programmer of VB6 or VB2005, it is easy to switch to Visual Basic 2008.

Visual Basic is our preferred language for communicating to the NCD product line. Visual Basic 2008 is an evolution of the Visual Basic language that is engineered for productively building type-safe and object-oriented applications.The Visual Basic 2008 Express Edtion is free download from Microsoft. If you are a programmer of VB6 or VB2005, it is easy to switch to Visual Basic 2008.

If you have questions, please contact us.

 

Step 1: Create a New Project
  • From the Windows Start menu, choose Microsoft Visual Basic 2008 Express Edition.
  • The following screen appears.

 

  • On the File menu, click NewProject.

  • The New Project dialog box opens as below.
  •  Select Windows Application .
  • Input project Name.

  • Click "OK" to get the project window.

Step 2: Add Serialport Control to the Project
  • Open Toolbox window. (The Toolbox is on the left side of Visual Basic 2008. You can keep it open by clicking the Auto Hide icon, which looks like a push pin.)
  • Find SerialPort control on the Components of Toolbox.
  • Drag SerialPort control into frame Form1 to add SerialPort1.
  • Right click SerialPort1 to show popup menu.

  • Click Properties to open SerialPort1 Properties window on the right side as below.
  • Select the BauRate property of the SerialPort1. In the right-hand column, delete 9600 and replace it with 38400.

 

Step 3: Add Button to the Project
  • Drag Button control into frame Form1 to add Button1 and Button2.

  • Select Button1, in the Properties window, select the Text property of the Button1. In the right-hand column, delete Button1and replace it with Turn On Relay 1of ProXR .
  • Do same to Button2, replace Button2 with Turn Off Relay 1 of ProXR .
  • Resize buttons to display all text.

 

Step 4: Type code to the program
  • In the Form1.vb[ Designer], double click anywhere on the frame Form1 to open the file Form1.vb.
  • Type the following code to open the serial port at where the cursor is.
    SerialPort1.Open()
     

 

  • Return to the Form1.vb[ Designer], double click button Turn OnRelay 1 of ProXR.
  • Type following code at where the cursor is.

    Dim data(3) As Byte

    data(0) = 254

    data(1) = 108

    data(2) = 1

    SerialPort1.Write(data, 0, 3)

  • Return to the Form1.vb[ Designer], double click button Turn Off Relay 1 of ProXR.
  • Type following code at where the cursor is.

    Dim data(3) As Byte

    data(0) = 254

    data(1) = 100

    data(2) = 1

    SerialPort1.Write(data, 0, 3)

  • You may hide Toolbox window and Properties window to get more room to show the code. You can do so by clicking the Auto Hide icon,which looks like a push pin.

 

Step 5: Run the project
  • On the Debug menu of the Visual Basic2008, click Start Debugging.( A shortcut to run the program is to press F5.)
  • The result of running the program is displayed as below.
  • Click button Turn On Relay 1of ProXR , the first relay will be turned on.
  • Click button Turn Off Relay 1of ProXR , the first relay will be turned off.

 

Above are all basic steps that is needed to control ProXR from VB 2008.

Based on those steps, more buttons can be added to control anything from your desktop computer.

 

Download VB2008 ProXR Test Program