Author Topic: Visual Basic Modbus i/o query  (Read 5403 times)

autobatch

  • Guest
Visual Basic Modbus i/o query
« on: March 31, 2009, 09:30:23 PM »
Hi Guys,
I am writing a VB6 program to test a plc connected to the Ethernet.  I can read memory words with this query.  What do I change if I want to read inputs or outputs on the PLC?  What do I change if I  want to read system bits on the PLC?
Thanks for your  time,
Johnny

StartLow = Val(StartRegDisplay.Text) Mod 256
StartHigh = Val(StartRegDisplay.Text) \\ 256
LengthLow = Val(LengthDisplay.Text) Mod 256
LengthHigh = Val(LengthDisplay.Text) \\ 256
MbusQuery(0) = 0
MbusQuery(1) = 0
MbusQuery(2) = 0
MbusQuery(3) = 0
MbusQuery(4) = 0
MbusQuery(5) = 6
MbusQuery(6) = 1
MbusQuery(7) = 3
MbusQuery(8) = StartHigh
MbusQuery(9) = StartLow
MbusQuery(10) = LengthHigh
MbusQuery(11) = LengthLow
MbusRead = True
MbusWrite = False
Winsock1.SendData MbusQuery

sean_wang

  • Guest
Visual Basic Modbus i/o query
« Reply #1 on: May 04, 2009, 03:43:21 PM »
Sorry!
   DO you tell me about which kind plc type of you use?

autobatch

  • Guest
Visual Basic Modbus i/o query
« Reply #2 on: May 13, 2009, 12:25:37 AM »
ť Sorry!
ť    DO you tell me about which kind plc type of you use?

I am using the Schneider PLC\'s such as the Zelio, Twido and Modicon M340.  They all communicate via Ethernet Modbus TCP/IP.  
Regards,
Johnny