Author Topic: Excel VB macro to communicate with PLC  (Read 7052 times)

Doug

  • Guest
Excel VB macro to communicate with PLC
« on: December 09, 2005, 08:30:09 AM »
I have a visual basic macro in Excel  which I use to communicate with other devices.  I am trying to use this to pull data from the PLC but I am having problems initiating the "Ctrl-E"  handshaking protocol.

I can open the port for communication but when I output Chr(5) to the PLC I get no response

I have looked at the VB sample communication program on the website and have used it to communicate with the PLC so I know the connection and PLC com works.

Does anyone have a simple VB macro in Excel that can poll the PLC, or some idea what I am doing wrong?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Excel VB macro to communicate with PLC
« Reply #1 on: December 09, 2005, 04:44:22 PM »
It may be easier if you send the multipoint command instead of point to point since you don't have to do the CTRL-E handshake. E.g. send "@01WO00AA00*" to the PLC and if you can turn on the outputs 2,3,6,8 (assuming they are not controlled by your ladder program) then you know that your macro has successfully sent a correct host link command to the PLC. You then need to check if you receive the response string properly and most likely you will be able to figure out what caused your comm problem.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS