Gene

MrPLC Member
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Gene

  • Rank
    Hi, I am New!

Profile Information

  • Country United States
  1. Basically you can create internal tags that represent your outputs and then map them to the physical outputs. By doing this you can leave the core code alone and only change where the output logic is mapped to which can be done with a simple move instruction for example. This is how I create logic as a practice just because it makes the logic more modular and can be used no matter what the physical output is. Gene
  2. After looking at your code I dont think that the DDE connection is the problem. The problem is how your VB code is written. Your index reference was in the wrong position. You also only need to get the data from the array of REALS. Your For loop should look like this: For i = 0 To 1 'First the array of REALs 'Get the value form the DDE link realdata = DDERequest(rslinx, "CURRENT_PART.CELL_B_SHUTTLE_POINTS[" & i & "].Position,L1,C1") 'If there is an error, display a message box If TypeName(data) = "Error" Then If MsgBox("Error reading tag CURRENT_PART.CELL_B_SHUTTLE_POINTS[" & i & "].POSITION" & _ "Continue with Read?", vbYesNo + vbExclamation, _ "Error") = vbNo Then Exit For Else 'No error, place data in cell Cells(2 + i, 4) = realdata End If Next i The rest of the code should be the same and this should give you the correct data. Gene