Hi,
I have listed below some of the things you need
unfortunately I have deleted my test program & do not have GXDeveloper re-installed as of yet however below is a program shown in statement list.
Flags for Data Transmission
M8121 Data Transmission Delayed
M8122 Data Transmission Flag (send Data)
M8123 Data Received (finished receiving data)
M8124 Carrier Detection
M8125
M8126 Global Flag (Dedicated Protocol)
M8127 On Demand Handshake Flag (dedicated protocol)
M8128 On Demand Error Flag (dedicated protocol)
M8129 On Demand byte/word flag (Dedicated protocol)
M8161 Selection of 8 bit instructions (asc,rs,asci, hex, ccd)
Data Registers
D8120 Communications format
D8121 Local station number
D8122 Amount of data to transmit
D8123 Amount of data already received
D8124 Data Header (default STX (02H)
D8125 Data Terminator (Default ETX (03H)
D8126
D8127 On Demand Head device register
D8128 On Demand Data Length register
D8129 Data Network timeout value
D8120 Comms format
bit 0 = 7 bit off 8 bit on (databits)
bit 1,2 = parity 00 = none, 01 = odd, 11= even
bit 3 = stop bit 0 =1 1, = 2
bit 4,5,6,7 = speed (baud rate)
0011 = 300, 0100 = 600, 0101 = 1200, 0110 = 2400, 0111 = 4800, 1000 = 9600, 1001 = 19200
Bit 8 header char 0= none 1= whats in D8124
Bit 9 Terminator char 0=none 1= whats in D8125
Bit 10 Reserved
Bit 11 DTR Check 0=send/receive 1=receive only
Bit 12 control line 0= none 1= hardware
Bit 13 Checksum 0 = not added 1= added
Bit 14 protocol 0 = no protocol 1 = dedicated protocol
Bit 15 protocal format 0 = protocol 1, 1 = protocol 4
****Program****
LD m8000 (always on bit)
OUT m8161 (set 8 bit instruction) --| |-------------()
***Set up the Comms Parameters (set bits in D8120)****
LD M8002
MOV H0067, D8120 (set up comms parameters)
LD X0 (just for testing trigger X0)
RS D200,K11,D500,K10 ***do RS instruction [rs D200 K11 D500 K0] (data in D200 to d210 (11) is sent, any data RX'D in D500-510***
*****move data into D200-D210 & set send bit****
LD X1 ***send command bit***
PLS M0 ***create a pulse***
MOV H23 D200 (remember 16 bit words are sent as 2 bytes)
MOV H24 D201
etc........ (move values into d200-210)
SET M8122 ***send data***
***If data received bit on then store data*****
LD M8123 ***data rx'd***
BMOV D500 D512 K10 **move data from receive buffer to store.
RST M8123 reset rx'd flag.
end.