+ Reply to Thread
Results 1 to 3 of 3

DDEPoke a value through RSLinx OEM to an address in my PLC using VBA

Hybrid View

Rusty_The_Kid DDEPoke a value through... 03-09-2013, 10:17 PM
Leith Ross Re: DDEPoke a value through... 03-10-2013, 02:48 AM
Rusty_The_Kid Re: DDEPoke a value through... 03-10-2013, 04:12 AM
  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Honolulu, Hawaii
    MS-Off Ver
    Excel 2010
    Posts
    8

    DDEPoke a value through RSLinx OEM to an address in my PLC using VBA

    I am running the VBA code:

    RSIchan = DDEInitiate("RSLinx", "Topic_Name")
    DDEPoke RSIchan, "Program:MainProgram.REC_Unlatch", Range("K3")
    DDETerminate (RSIchan)
    This code is taking the value in cell K3 (value of 1) and sending it to a relay contact in my PLC using the address "REC_Unlatch". It works fine. I would like to just send a 1 to my PLC, without having to reference a cell in Excel. Can this be done, and if so, how would I format the instruction?

    Thanks in advance!
    Last edited by Rusty_The_Kid; 03-11-2013 at 11:07 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: DDEPoke a value through RSLinx OEM to an address in my PLC using VBA

    Hello Rusty_The_Kid,

    DDE (Dynamic Data Exchange) relies on shared memory objects. The 'conversation" between the client and server is conducted by Windows messages that describe the application, topic, and item. Since neither constants nor literal values are objects, no conversation can occur.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Honolulu, Hawaii
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: DDEPoke a value through RSLinx OEM to an address in my PLC using VBA

    Hi Leith, sounds like I need to always reference cell contents in such communications. Since my VBA code sends me into a new active workbook during my data-recorder loop when I want to send this "1" or "0" data back to the PLC, I suppose I can write a "0" and a "1" into a worksheet in the newly created workbook, then use those cells as objects to send back to the PLC as desired. Thanks for your help, I will work on that tomorrow.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1