Jäger ADwin-Gold-USB Manual page 46

Hide thumbs Also See for ADwin-Gold-USB:
Table of Contents

Advertisement

CAN add-on
RS485
42
In this example the RS485 interface is a passive participant, which reads data
coming from the input. If a specified value (55) is received, the interface starts
to send. It sends continuously the value 44.
REM Interface 2 reads all data coming from the bus
REM until it receives the value 55. Now the interface
REM becomes active and sends the value 44.
#INCLUDE
adwgcan.inc
DIM
ret_val,
val
AS LONG
INIT:
RS_RESET()
REM Initialization of the interfaces:
REM 38400 Baud, no parity bit, 8 data bits,
REM 1 stop bit, RS485 software handshake
RS_INIT(1,38400,0,8,0,3)
RS_INIT(2,38400,0,8,0,3)
RS485_SEND(1,1)
RS485_SEND(2,0)
EVENT:
val
= READ_FIFO(2)
IF
(val
= 55)
THEN
RS485_SEND(2,1)
ret_val
= WRITE_FIFO(2,44)
ENDIF
'Send interface 1
'Receive interface 2
'Read data from interface 2
'Send interface 2
'Write data
ADwin-Gold USB / ENET, manual version 3.8, October 2005
ADwin

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adwin-gold-enet

Table of Contents