1/9/2018

Freebasic Serial Port Programming

Windows Serial Port Programming

Visual Basic for Applications Serial Port Software Example Visual Basic is used for many control applications, from simple communications, to elaborate test equipment with user control or automated. Globoflexia Paso A Paso Pdf. But many people don't realize that Visual Basic for Applications which is built into many MS software programs such as Word, Excel, Publisher, Access, and even the Front Page editor I'm using right now, can be used for control applications.

If you need to control our relay boards, but do not have any programming experience you now have an option. Our relay boards can now be controlled directly from a desktop shortcut using our. This eliminates having to deal with the mscomm32.ocx driver! For example, you can be in Access or Excel, start a macro that would power up an external data acquisition unit and receive data into the software utilizing VBA, serial control, and one of our. You could control room lighting, or any other device that you would like to turn ON or OFF from within a application, just think of the many possibilities.

Visual Basic for Applications has many of Visual Basic's commands and controls, that can be utilized for control applications. We will show you how to use this powerful application to control our. Note: this example is tailored to the first time Visual Basic for Applications user, but the information is useful for the advanced user that is unfamiliar with serial port control. If you're familiar with VBA and want to jump directly to the code segment. Let's get started: For this demonstration we will use Excel's VBA editor, but any of the software that has built in VBA support will work.

Start Excel and select >>Tools >>Macro >>Visual Basic Editor, from the pull down menus as shown in the picture below, or use Alt+F11 shortcut. Depending on which version of Excel you are using, this and the following screen may look different. The Visual Basic Editor will appear as shown below. Firefox Downloadhelper Converter. After VBA is loaded Right Click in the project window, Select >>I nsert >>Userform and a blank form will be loaded, with a control tool box as shown below. Now we are going to add serial port control to the control box so that we may use it in our application.

For this demonstration we are going to use the mscomm32.ocx communication driver, depending on what other MS applications you have loaded on your system, this driver may or may not be available on your system. Right click in the controls box and select >>Additional Controls Scroll down to you see Microsoft Communications Control, and click on the check box on the left, as shown below. If you don't see this driver available in the additional controls window you can do a file search using windows Start >>Find >>File or Folder to search for mscomm32.ocx.

Nov 04, 2010 Serial Port Monitor/Logger. Does anyone know where some serial port Freebasic code might be. Php?id=773 It actually uses a PIC and will require programming as.

If this file is found you need to copy this file into the c: windows system directory so the VBA can find it. If this driver is not found to continue. Click OK to continue. The control box will now have an icon of a telephone sitting on a modem displayed in the controls window as shown below. Select this control and place your cursor on the user form, click the left button and the control will be placed on the screen. If you see a warning like shown in the picture below you either have a unlicensed copy of the control or the control is not licensed properly.

If you downloaded the mscomm32.ocx driver from the internet and you don't have Visual Basic, Visual Fox, or one of the other programs that it is supplied with, you don't have a registered copy and will not be able to use this driver. Don't worry, there are two other ways to accomplish serial communications that don't require this driver, for the other two options.

Click on the command button icon in the tool box (rectangular box) and place two buttons on the user form. Click on CommandButton1 and the options will appear in the properties window. Click to the right of the Caption in the properties window and change commandButton1 to 'All Relays ON'. Click on the commandButton2 or select this name from the pull down at the top of the properties window, and change this to read 'All Relays OFF' as shown in the picture below.

Click on the MScomm icon or use the properties pull down menu to view the properties for this control as shown below. Click on the property labeled RThreshold, change this value from a '0' to a '1'. Do the same for the SThreshold property.