adccommunitymod (AutomationDirect) asked a question.

writing to Kepdirect with Excel

Created Date: May 10,2007

Created By: bidauto

**** 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 have been using the Kepdirect DDE server for a while for capturing data in Excel. Now I wanted to try writing values to the PLC by using a DDEPoke command in a pushbutton script. I 've been fooling around with it for a while, but I can seem to get it to work. Below is my pushbutton script. Any feedback would be apprieciated. I can read this value just fine. But I can't write to it. Private Sub CommandButton1_Click() 'open DDE channel ddechannel = DDEInitiate(app:= "kepdirectdde ", topic:= "_ddedata ") 'send data via DDE DDEPoke channel:=ddechannel, Item:= "Channel1.Device1.Y000 ", data:= "1 " 'close DDE channel DDETerminate channel:=ddechannel End Sub


  • adccommunitymod (AutomationDirect)

    Created Date: May 14,2007

    Created by: Steven

    In my workings with DDEPoke, I was only ever get it to work correctly by trying to send the contents of a cell to a PLC. I was never able to get it to send harcoded or dynamic data, like "data:= "1 " " as you have it.

    So what I do is have some cells on a hidden sheet reserved for sending data, and use something like:

    DDEPoke DDEchannel, Item:= "Channel1.Device1.Y000 ", data:=Range( "A1 ")

    I am unfamiliar with KEP Direct's syntax, so also make sure that "Channel1.Device1.Y000 " is formatted correctly etc.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: May 25,2007

    Created by: dnguyen

    Hi, I don't want to side track, but this thread is relatively close to what I'm trying to do.

    I have a Analog current output terminator, and the item ID is Channel1.Device1.SLOT_01.S1.DWO00_DWORD

    It is currently at 4045056, I would like to change that to something else. Excel Doesn't like my formatting it seems:

    DDEPoke DDEchannel, Item:= "Channel1.Device1.SLOT_01.S1.DWO00_DWORD ", data:=Range( "A1 ")

    A value of 4000 is stored into 'A1 '

    Please help, I would like to figure this out today so I can have a nice weekend and not have this on my mind =)

    Thanks so much.

    David

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: May 10,2007

    Created by: bidauto

    I have been using the Kepdirect DDE server for a while for capturing data in Excel. Now I wanted to try writing values to the PLC by using a DDEPoke command in a pushbutton script. I 've been fooling around with it for a while, but I can seem to get it to work. Below is my pushbutton script. Any feedback would be apprieciated.

    I can read this value just fine. But I can't write to it.

    Private Sub CommandButton1_Click()

    'open DDE channel

    ddechannel = DDEInitiate(app:= "kepdirectdde ", topic:= "_ddedata ")

    'send data via DDE

    DDEPoke channel:=ddechannel, Item:= "Channel1.Device1.Y000 ", data:= "1 "

    'close DDE channel

    DDETerminate channel:=ddechannel

    End Sub

    Expand Post