• No results found

6 User-defined communication

6.3 Instructions for Cnet module .1 SND instruction

Available Device Flag

Instructions

 Sends ‘n’ bytes which begin with the device specified as [snd ] to the Cnet module that mounted on the slot ‘sl’. The name of frame is stored as ASCII format into 8 words which begin with the device [ Fnam ]. The link status is stored at the device specified as [ SS ].

 The maximum size of data block to be sent is 256 bytes.

2) Program example

 Program that send 10 bytesm (5 words) from D1234 and frame name (8 words from D0000) to the Cnet module at slot 3, channel 0 (RS232C). The link status is stored at K015 word.

SND sl Fnam snd n SS

Operand setting

Slot number of Cnet module is mounted & Type of channel (RS232C or RS422)

Fnam The name of frame (8 words) snd Start address of device that

stores source data to be sent sl

n Numbers of byte to be sent Device at which the link status is stored

SS Lower 8 bits (CD) : Slot No. of Cnet

module

Higher 8 bits (AB) : Type of channel h00 : RS232C h01 : RS422 AB CD

The configuration of ‘sl’

SND h0003 D0000 D1234 h0010 K015

6-21

6.3.2 RCV instruction

Available Device Flag

Instructions

 Receives data from the Cnet module mounted on the slot ‘sl’ with the frame of which name is stored as ASCII format into 8 words which begin with the device [ Fnam ], then stores the data from the device specified as [ rcv ], and the length of data is stored at [n]

The link status is stored at the device specified as [ SS ].

 The maximum size of data block to be sent is 256 bytes.

2) Program example

 Program that receive data from channel 1 (RS-422) of the Cnet module at slot 5, with the frame of which name is stored at 8 words from D0100, and stores received data to the block which begin with D0200. The number of received data (bytes) are stored at D1000, and the link status is stored at K016 word.

Operand setting

sl Slot number of Cnet module is mounted & Type of channel (RS232C or RS422)

Fnam The name of frame (8 words) rcv Start address of device that

stores source data to be sent Numbers of byte to be read Device at which the link status is stored

SS Lower 8 bits (CD) : Slot No. of Cnet

module

Higher 8 bits (AB) : Type of channel h00 : RS232C h01 : RS422 AB CD

The configuration of ‘sl’

RCV h0105 D0100 D0200 D1000 K016 RCV sl Fnam rcv n SS

n

6.3.3 READ instruction

Available Device Flag

Instructions

M P K L F T C S D #D Integer

Step

s (F110)Error (F111)Zero (F112)Carry

sl O

sl Slot number on which the Cnet

module is mounted St Station number of remote station and comm. channel. (4 words) D Start address of master station

at which read data is stored S Start address of remote station at which data to be read

n Numbers of word to be read SS Device at which the link status is stored

Configuration of ‘St’

Upper 2 words Lower 2 words

Station number Channel selection 0: RS-232C 1: RS-422

* Available only when do not use computer link module or data link module

1) Functions

 Reads ‘n’ words which begin with the address [ S ] of the remote station that has station number ‘St’ through the Cnet or Fnet module mounted at the slot ‘sl’, and store the read data to the block which begin with the address [ D ] of the master station. The link status is stored at the address ‘SS’ of the master station.

READ sl st D S n SS

6-23

 An instruction error occurs when the assress [ S+n ] or [ D+n ] is out of the range of specified device.

 Execution conditions

2) Program example

 Program that read 20 words which begin with D0200 of remote station (Station No. of FUEA module is stored at 4 words block begin with D0010) through the FUEA module of slot number 2, and store the read data to the block which begin with D0300. The link status is stored at the M020 word. Assume that the value of D0010 ~ D0013 is h0000 001D 0000 0000 (Station number : h1D, Channel : RS-232C)

Input condition

READ

Executed only once Executed only once

[ S ]

6.3.4 WRITE instruction

Available Device Flag

Instructions

M P K L F T C S D #D Integer

Step

s (F110)Error (F111)Zero (F112)Carry

sl O

sl Slot number on which the Cnet

module is mounted St Station number of remote station and comm. channel. (4 words) D Start address of master station

at which source data is stored S Start address of remote station at which data to be stored

n Numbers of word to be written SS Device at which the link status is stored

Configuration of ‘St’

Upper 2 words Lower 2 words

Station number Channel selection 0: RS-232C 1: RS-422

* Available only when do not use computer link module or data link module

1) Functions

 Transmits the data block (n words) begin with [D] of master station to the data block (n words) begin with [S] of remote station. Data transmission is performed via a Cnet (or Fnet) module mounted at the slot ‘sl’ of master station. The station number of remote station and communication channel is assigned by ‘St’ (4 words). After communication is completed, the status is stored at the [SS] of master station.

WRITE sl st D S n SS

6-25

 An instruction error occurs when the assress [ S+n ] or [ D+n ] is out of the range of specified device.

 Execution conditions

2) Program example

 Program that writes 20 words which begin with D0200 of remote station (Station No. of FUEA module is stored at 4 words block begin with D0010) through the FUEA module of slot number 2, and store the read data to the block which begin with D0300. The link status is stored at the M020 word. Assume that the value of D0010 ~ D0013 is h0000 001D 0000 0001 (Station number : h1D, Channel : RS-422)

Input condition

WRITE

Executed only once Executed only once

[ S ]