1
Technical support / Re:Urgently need your help to solve Auto485 problem
« on: December 13, 2005, 06:45:59 PM »
DAER SIR, BELOW IS PORTION OF H-COMMUNICATION MANUAL TOGETHER WITH H-SERIES PLC. CAN I HAVE THE SAMPLE C PROGRAM MENTIONED IN THE MANUAL??
Host Communication Program Examples
Two sample programs, one written in Microsoft GWBASIC (HOSTCOMM.bas) and the other written in Borland International's Turbo C (HOSTCOMM.C), are provided in the TRiLOGI distribution diskette to help programmers get started. Both programs essentially perform the same functions, as follows:
(a) Prompt user to enter the desired command block via the PC's keyboard.
(b) Initiate a communication session (for point-to-point protocol only) and send the command string to the controller.
(c) Wait to receive the response block from PLC and display the response block on the PC's screen.
These two programs incorporate all the codes needed to communicate successfully with the T20/28/44H in either BASIC or C language using the point-to-point protocol. Programmers can therefore build their applications using either of the programs as building blocks.
For those who wish to experiment with the RS485 network, A program "Host485.C" in Turbo C language has also been included. This program assumes that an RS232-to-RS485 adapter is used such that the direction of communication of the RS485 bus is controlled by the state of /RTS line of the RS232C. This program accepts both point-to-point and multipoint commands from the keyboard and automatically initiates the correct communication protocol with the control. If your RS485 adapter works differently then you must modify the functions "transmit485()" and "receive485()" to control the direction of the half-duplex RS485 bus. Please refer to the technical manual of your RS485 adapter for details.
Although written for RS485 bus, you can also experiment with this program using PLC's RS232 interface, you would however not be able to link more than one H-series PLC to the host PC in this case.
Host Communication Program Examples
Two sample programs, one written in Microsoft GWBASIC (HOSTCOMM.bas) and the other written in Borland International's Turbo C (HOSTCOMM.C), are provided in the TRiLOGI distribution diskette to help programmers get started. Both programs essentially perform the same functions, as follows:
(a) Prompt user to enter the desired command block via the PC's keyboard.
(b) Initiate a communication session (for point-to-point protocol only) and send the command string to the controller.
(c) Wait to receive the response block from PLC and display the response block on the PC's screen.
These two programs incorporate all the codes needed to communicate successfully with the T20/28/44H in either BASIC or C language using the point-to-point protocol. Programmers can therefore build their applications using either of the programs as building blocks.
For those who wish to experiment with the RS485 network, A program "Host485.C" in Turbo C language has also been included. This program assumes that an RS232-to-RS485 adapter is used such that the direction of communication of the RS485 bus is controlled by the state of /RTS line of the RS232C. This program accepts both point-to-point and multipoint commands from the keyboard and automatically initiates the correct communication protocol with the control. If your RS485 adapter works differently then you must modify the functions "transmit485()" and "receive485()" to control the direction of the half-duplex RS485 bus. Please refer to the technical manual of your RS485 adapter for details.
Although written for RS485 bus, you can also experiment with this program using PLC's RS232 interface, you would however not be able to link more than one H-series PLC to the host PC in this case.