HuntWhenever

MrPLC Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About HuntWhenever

  • Rank
    Hi, I am New!

Profile Information

  • Gender
  • Location SW Ohio
  • Country United States
  • Interests Hunting, Mt. Biking, Hiking, Motorcycling
  1. DDE Topic won't terminate from VBA

    Interesting work around. I'll give that a try here in a few days. Thanks!
  2. DDE Topic won't terminate from VBA

    DDEPoke works. I've stepped through the program a few times using a break point before and after the DDETerminate just to make sure it was executing that line. I looked through references, but the DDE functions are part of the Excell.Application as far as I know. I looked in the VBA object library.  DDETerminate was listed in the Excell.Application class, but DDETerminateALL was not listed (image attached).  
  3. DDE Topic won't terminate from VBA

    When I try DDETerminateAll, I get a "Sub or Function not defined" compile error.
  4. I have recently installed RSLinx Single Node and I'm writing an Excel macro to read some recipe data from some PLCs.  The macro is pretty straight forward with one exception:  I can't seem to get the DDE topic to terminate so I can read a different PLC (RSLinx Single Node only allows one topic at a time). Here's my macro in a nutshell... Private Function OpenRSLinx(Topic As String) As Long On Error Resume Next     OpenRSLinx = DDEInitiate("RSLINX", Topic)     If Err.Number <> 0 Then         MsgBox "Error Connecting to Topic", vbExclamation         OpenRSLinx = 0     End If End Function   Sub ReadClick()     Dim UsedTopic As String     UsedTopic = Cells(1, 1)     rslinx = OpenRSLinx(UsedTopic)     'Reading code goes here     DDETerminate rslinx End Sub   This works for one PLC.  When I change to a different PLC (different topic), I get an error because RSLinx Single Node cannot run more than one topic.  When I look at the Active DDE/OPC Topic List in RSLinx, the first topic I ran is listed as Active.  Also, when I bring up the DDE/OPC Topic Configuration menu in RSLinx, in the Topic List on the left hand side shows the topic I just ran with a lock symbol beside it.  The only way I can run another topic is to shut down RSLinx, then run my macro again with the different topic name.   Am I missing something here?  All the research I've done indicates that DDETerminate is all that should be needed.   Additional info:  - Windows 10 Pro  - Office Excel 365 version 2005  - RSLinx Classic Single-Node Revision 4.12.00 CPR 9 SR 11.0