NAT KHAOKUM

MrPLC Member
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About NAT KHAOKUM

  • Rank
    Hi, I am New!

Profile Information

  • Country Thailand
  1. ASCII/Serial Communications with KV PLC with VB6

    Hi! I'd some experience for you. 1.using mscomm32.ocx for communication between VB or Delphi to PLC. 2. Form_load() mscomm1.settings = "9600,e,8,1" // setting the same instruction manual mscomm1.comport = 1 // com port #1 mscomm1.portopen = true 3. send the signal from PC->PLC mscomm1.output = chr(67)+chr(82)+chr(13) // sending "C""R" and carrie return for connect to PLC mscomm1.output = "ST 0501" + chr(13) // set output 501 to "ON" 4. recieve signal from PLC mscomm1_oncomm event msgbox mscomm1.input // display message box for input signal remark : before writing with VB,you should test communication between PC & PLC by software "Hyper Terminal" that's include with MS Windows all version in communication menu. Wish you success. Note : If sometimes you can not communicate with PLC,you must create the loop program to send the "C""R" and carrie return from PC to PLC until it'd not show "E1" and show "CC" for success commnucating. Wish you success.