adccommunitymod (AutomationDirect) asked a question.

DDE/Dsdata Initialization

Created Date: May 15,2001

Created By: Ron Wilson

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I am writing a program to monitor pump stations. I am writing the program using Visual Basic. When I start the program up I am monitoring 3 pumps run positions (On, Off, Auto) and have used "if " statements to tell what position the pumps are in. Example: If (pump1 =1) Then pump1.backcolor = &h0 & pump1.forecolor = &H0 & Very simple code. . .(pump1 = 1) tells whether the bit is true or false in the variable location for "pump1 ". . . Now my question. . .sometimes this works and sometimes it doesn't. When I start the program up the lights work about 50% of the time but once I change the pumps position with the program up and running it works 100% of the time. I am wondering if there is an initialization for Visual Basic like there is for Excel using the Dsdata Server. I saw in the Dsdata Server book it used an example with Excel: Channel = DDEInitiate(cell, row). . . . Can I do that with Visual Basic or what is going on. . .I am running a DL-250 and can connect with either port. . .r2-232 modem jack or the db15 rs-232, 422. Thanks for your help!!!!


  • adccommunitymod (AutomationDirect)

    Created Date: May 15,2001

    Created by: Ron Wilson

    I am writing a program to monitor pump stations. I am writing the program using Visual Basic. When I start the program up I am monitoring 3 pumps run positions (On, Off, Auto) and have used "if " statements to tell what position the pumps are in.

    Example:

    If (pump1 =1) Then

    pump1.backcolor = &h0&

    pump1.forecolor = &H0&

    Very simple code. . .(pump1 = 1) tells whether the bit is true or false in the variable location for "pump1 ". . .

    Now my question. . .sometimes this works and sometimes it doesn't. When I start the program up the lights work about 50% of the time but once I change the pumps position with the program up and running it works 100% of the time. I am wondering if there is an initialization for Visual Basic like there is for Excel using the Dsdata Server.

    I saw in the Dsdata Server book it used an example with Excel:

    Channel = DDEInitiate(cell, row). . . .

    Can I do that with Visual Basic or what is going on. . .I am running a DL-250 and can connect with either port. . .r2-232 modem jack or the db15 rs-232, 422. Thanks for your help!!!!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: May 16,2001

    Created by: Ron Wilson

    Actually I figured it out. . .Yes I am starting the DDE server before the code runs. . .

    What was happening was my program was not initializing the values to my label variables unless something changed, so I wrote a method that I called in "form_load " that would make it retrieve the variables on start up of the app. . .

    If anyone has problems then you can email me with and I will send you the code. . .

    email: wronald@clemson.edu

    Thanks for your help!!! Your code is very useful also to me for some later parts of my program. . .is it ok if I use some of it???

    -Ron

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: May 24,2001

    Created by: tweedy

    Go for it. One of our guys got it from somewhere so I can't don't take credit for it. Glad you 're up and running.

    Thanks for your help!!! Your code is very useful also to me for some later parts of my program. . .is it ok if I use some of it???

    -Ron