Serial Port Tool focuses on COM Port communication software for RS232 related works.
How to Use Visual C# 2005 for ProXR

Microsoft Visual C# 2005 is a programming language designed for building a wide range of applications that run on the .NET Framework. C# is simple, powerful, type-safe, and object-oriented. With its many innovations, C# enables rapid application development while retaining the expressiveness and elegance of C-style languages.The Visual C# 2005 Express Edtion is free download from Microsoft. If you are a programmer of C and C++, it is easy to switch to Visual C# 2005.

The following guide will teach ANYONE how to operate ProXR using Visual C# 2005 Express Edition. The example provided on this page is developed for Visual C# 2005 Express Edition. These directions are about 99% compatible with other VS2005 edition. Following these simple steps, you will be on your way to controlling ANYTHING from your desktop computer in 30 minutes or less.

If you have questions, please contact us.

 

Step 1: Create a New Project
  • From the Windows Start menu, choose Microsoft Visual C# 2005 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.

Step 2: Add Serialport Control to the Project
  • Open Toolbox window. (The Toolbox is on the left side of Visual C# 2005. 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.
  • Select the BauRate property of the SerialPort1 in the Properties window . 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 button1 and replace it with Turn On Relay1of ProXR .
  • Do same to button2, replace button2 with Turn Off Relay1 of ProXR .
  • Resize buttons to display all text.

 

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

    serialPort1.Open();

 

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

    Byte[] data = new byte[3];

    data[0] = 254;

    data[1] = 108;

    data[2] = 1;

    serialPort1.Write(data, 0, 3);

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

    Byte[] data = new byte[3];

    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 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 C# 2005, 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 Relay1of ProXR , the first relay will be turned on.
  • Click button Turn Off Relay1of ProXR , the first relay will be turned off.

 

Above are all basic steps that is needed to control our products from Visual C# 2005.

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

 

Download VC# 2005 ProXR Test Program