Click here to learn the biblical way to get to heaven! (The most important page on this site)
You can have your very own virtual server though VPSLink! Using REFERRAL code MJDCDJ you will receive a 10% discount on
your new account, and I will get a service credit on my account. My personal preference is the Link 2 package running XEN for starting out (You can upgrade any time). You can choose from a variety of Linux distributions such as CENTOS, Fedora, Debian, and Ubuntu. This is a great package for learning Linux,
and setting up your own web page, or email server.
Using DDE with Visual Basic 6
This tutorial assumes you already have a Topic set up in a professional version of RSLinx. If you have not yet configured the topic, see the section titled 'Connecting to a Spreadsheet using DDE'. (I'm also assuming VB6 is installed on your computer) For this example, we will create a simple program that can view a memory location, and write to a memory location in the controller.
Acquiring Data from the processor
Open Microsoft Visual Basic 6.

Choose to create a standard executable file (standard exe)

Click the texbox object from the general toolbox, and draw a textbox onto your form.

On the Lower left side of your IDE, you will see a properties window. (If it is not there, turn it on from the view menu. We will be setting the LinkTopic, LinkItem, and LinkMode as shown for this example. RSLinx is the application we are going through to acquire the data, MyTopic is the topic we created within RSLinx to point to the processor, and the LinkItem is the memory location you wish to acquire data from for display in the textbox object. By putting the LinkMode in automatic, the textbox will update at the intervals we specified under the data collection tab in RSLinx.

You will see your textbox is now updating in real time.

To build this project as an executable, click File | Make Project1.exe. You can then store the executable on your desktop or any convenient location.

Sending data to the processor
In the last exercise, we acquired data from the processor. Occasionally, you may want to send data to the processor. We will be using the same application, RSLinx, and the same topic within that application for this exercise (MyTopic). We will change the preset of a timer such as T4:0.PRE. Since the operator will be entering a value, we don't want to get that value automatically. (We don't know if the operator has finished entering a value or not). We will want the operator to hit a button that sends the value he entered to the processor.
Open VB6 as before.

This will be a standard executable

Using the general toolbox, grab the textbox object, and draw the object on your form.

On the Lower left side of your IDE, you will see a properties window. (If it is not there, turn it on from the view menu. We will be setting the LinkTopic, LinkItem, and LinkMode as shown for this example. RSLinx is the application we are going through to acquire the data, MyTopic is the topic we created within RSLinx to point to the processor, and the LinkItem is the memory location you wish to acquire data from for display in the textbox object. By putting the LinkMode in manual this time, an event will be required to trigger the linkpoke command such as a command_click event. (Be sure you are looking at the properties of the textbox)

Next, grab a command button from the general toolbox. Draw the command button onto the form.

Double click on the command button to get to the code window. In the command1_click event (subroutine), type the following text:
Text1.LinkPoke
Text1 is the name of the textbox. When you press the period, the intellisense will appear giving you a list of options available for Text1. We chose the LinkPoke method because we want to send whatever value is in text 1. When the command button is pressed, the code for the command1_click event will execute, and the Text1.LinkPoke method will be executed. You can test run your project to verify it's operation.

When finished, you can close the form you started, and build your project as we did before.
