A
Hi,
Can anybody help me with functions from VB to communicate with the PLC? Specifically, I need to use the I/O interface (the card comes with 2 ports for Input and Output). Can anybody explain how those commands such as IOPORT1.PortData and IOPORT1.PortAddress?
Example1 :
Global Const COVER = &H20
If MAINSCR.IOPORT1.PortData And COVER Then
'do something
Example2 :
Global KICK As Integer
Global Const PORT_A = &H304
Global Const X = &H4
KICK = KICK Or X
MAINSCR.IOPORT1.PortAddress = PORT_A
MAINSCR.IOPORT1.PortData = KICK
Question #1: Where normally we get the value for COVER, PORT_A and X?
Question #2: KICK = KICK Or X, What does it mean? Is it in Binary?
I really appreciate if anybody can help me solve this problem. Thank you.
Regards,
Anuar Mansor
Systems Analyst
MIS Department
TPC (Malaysia) Sdn. Bhd.
Can anybody help me with functions from VB to communicate with the PLC? Specifically, I need to use the I/O interface (the card comes with 2 ports for Input and Output). Can anybody explain how those commands such as IOPORT1.PortData and IOPORT1.PortAddress?
Example1 :
Global Const COVER = &H20
If MAINSCR.IOPORT1.PortData And COVER Then
'do something
Example2 :
Global KICK As Integer
Global Const PORT_A = &H304
Global Const X = &H4
KICK = KICK Or X
MAINSCR.IOPORT1.PortAddress = PORT_A
MAINSCR.IOPORT1.PortData = KICK
Question #1: Where normally we get the value for COVER, PORT_A and X?
Question #2: KICK = KICK Or X, What does it mean? Is it in Binary?
I really appreciate if anybody can help me solve this problem. Thank you.
Regards,
Anuar Mansor
Systems Analyst
MIS Department
TPC (Malaysia) Sdn. Bhd.