Dnet1chconv revision 0 Single-Channel DeviceNet rs-232 Serial Gateway User’s Manual sst, a division of Woodhead Canada Limited



Download 0.71 Mb.
Page8/9
Date05.05.2018
Size0.71 Mb.
#48036
1   2   3   4   5   6   7   8   9

Setting Up the Serial Link

  1. Reception Overview


The DNET1CHCONV receives a number of characters from the DeviceNet Master to your serial device via I/O Messaging or Explicit Messaging. Please note that the two forms of messaging are not designed to be used at the same time for communication; erroneous operation will occur when both IO and explicit messaging are used at the same time to control serial receptions.

The DNET1CHCONV receives characters into its internal character queue. The DNET1CHCONV then takes the first character out of the queue and places it into the back receive buffer. If the character that was placed into the back buffer is the Receive End Delimiter or the back buffer contains the Max Receive Length of characters, The DNET1CHCONV will copy the back buffer into the Receive Buffer and change the Receive Transaction Identifier (RXID) to notify the PLC that new data is ready.

Section 5.4.2 describes the Receive Swap settings

Section 5.3.4 describes the Receive End delimiter Settings

Appendix A describes the receive formatting object in more detail.

It is important to note that the IO assembly object does not process the content of the data given it. It only disassembles the received data and assembles the outgoing data to/from other logical sources in the device. Due to the nature of DeviceNet messaging, a field changed by an explicit message that is also set by an IO message will change momentarily to the explicit value and then immediately change back to the IO data. This will cause erroneous operation of the device. In short, if you wish to use explicit messaging for I/O, do not allocate an I/O connection.


      1. Transmission Overview


The DNET1CHCONV transmits a number of characters from the DeviceNet Master to your serial device via I/O Messaging or Explicit Messaging. Please note that the two forms of messaging are not designed to be used at the same time for communication; erroneous operation will occur when both IO and explicit messaging are used at the same time to control serial transmissions.

The DNET1CHCONV will transmit the current data in the Transmit Buffer whenever the Transmit Transaction Identifier (TXID) is changed. These fields may be changed explicitly and are also available in the IO messages. The information that is stored in the Transmit Buffer is first parsed by the DNET1CHCONV, which changes the order of data based on the setting of the Transmit Byte Swap and the amount of data sent based on the setting of the Transmit End Delimiter. The Transmit Byte swap option is used to align the data to your PLC’s data table. The maximum amount of information that will be received at one time is determined by the Transmit Character Buffer Length (in the device net set up).

Section 5.4.2 describes the Transmit Swap settings

Section 5.3.5 describes the Transmit End delimiter Settings

Appendix A describes the transmit formatting object in more detail.

It is important to note that the IO assembly object does not process the content of the data given it. It only disassembles the received data and assembles the outgoing data to/from other logical sources in the device. Due to the nature of DeviceNet messaging, a field changed by an explicit message that is also set by an IO message will change momentarily to the explicit value and then immediately change back to the IO data. This will cause erroneous operation of the device. In short, if you wish to use explicit messaging, do not allocate an IO connection.



Note:

If you set the Tx Buffer Length to 0 and the DNET1CHCONV receives more than the number of bytes defined in Max TX Buffer Length in a consumed DeviceNet message from the Master, the DNET1CHCONV will drop the I/O connection or return an error of “too much data”.


      1. Physical Layer Properties


The Physical Layer properties such as the framing, stop bits, data bits, parity options and baud rate may be set at parameters 1 and 2 of the DNET1CHCONV.
      1. Hardware Handshaking


You may select to activate the hardware handshaking option between the DNET1CHCONV and your serial device if your serial device supports RTS/CTS handshaking operation. The RTS and CTS lines (pins 7 and 8, respectively, on the D-sub connector) interface with the corresponding CTS and RTS lines on your serial device.
      1. The Receive Delimiter


When receiving data strings from your serial device, the DNET1CHCONV can take advantage of a Stop (End) delimiter. The End Delimiter is the end-of-string indicator. This allows you control over exactly which characters are sent to the Master. The DNET1CHCONV is always storing a string into its internal buffer. All characters are stored until either the End Delimiter is received or the Max Receive Char Length is reached (This is the end event). Once either of these end events occurs, the data string is captured and sent to the master. The delimiter, if received, is included in the received string.

Note:

Please note that the Receive Delimiter operation is always active, unlike the Transmit Delimiter operation (described below), which can be enabled or disabled. If you want to receive a constant string equal to the Max Receive Length, and do not want the delimiter operation to initiate a partial produce on DeviceNet, then make sure your serial device does not send the designated Rx Delimiter Character.


      1. The Transmit Delimiter


The transmit delimiter is an optional feature which can be used by the DNET1CHCONV to determine how many bytes to transmit over the serial link.

The Transmit Delimiter operation is keyed off the Transmit Buffer Length byte in the DeviceNet data that the DNET1CHCONV consumes from the Master. This Transmit Buffer Length byte is the second byte in the consume assembly. See Table 6 -13.

The Transmit Delimiter will be used if the Transmit Buffer Length equals 0. If the Tx Buffer Length is a non-zero value, the DNET1CHCONV will ignore the transmit delimiter and transmit the specified number of bytes.

The transmit delimiter can be set to any valid I/O character that can be received over the link. Be very careful not to set the delimiter to a value outside of the valid range for your data bits (Note: A data bit size setting of 7 will only allow you a delimiter range of 0-127 dec., 00-7Fhex). If you do not have the specified delimiter in the string you send to the DNET1CHCONV and the TX Length is not 0, the DNET1CHCONV will transmit the entire received message. If your PLC or PC Master device does not support variable length IO messages, this will have the effect of putting garbage characters at the end of your string.


      1. Status Byte Description


The Serial Status byte is an OR’d bit field of a number of status and exceptions. Bits 5-7 are undefined.

Table 5‑12 Serial Status Byte



Bit

Exception

0

TX Buffer Overflow

1

RX Buffer Overflow

2

RX Parity Error

3

Tx Buffer Has Data

4

Rx Buffer Has Data



  • TX Buffer Overflow

The transmit queue has overflowed resulting in a loss of data. The transmit I/O is full of data waiting to be transmitted. Some of the data added has been lost. When space becomes available in the TX Buffer, this bit will be reset.

  • Rx Buffer Overflow

The receive queue has overflowed resulting in a loss of data. The receive buffer is full of data waiting to be processed. The data has been lost. When space becomes available in the RX buffer, this bit will be reset.

  • Receive error

The receive error detection circuit has detected an invalid byte on the serial port. This character has been ignored. The Parity error bit will be reset when the message that contained the error is released.

  • Data in Tx Buffer

The Transmit Serial Data Buffer has new message data that it has sent out the serial link.

  • Data in Rx Buffer

The Receive Serial Data Buffer has new message data that it has not produced onto the DeviceNet link.
  1. Assembly Object Formats


The individual serial channels are read and written one channel per message.

The produce (receive) and consume (transmit) assembly object formats vary according to 2 specific parameter options: the Data Type and the Handshaking / Immediate Mode operation.

In this discussion “consume” and “produce” refer to data received from and sent out to the DeviceNet network by the DNET1CHCONV.

For this mode to work correctly in many PLCs with a scanner, the outgoing poll message must be constructed in a buffer, and when complete, should then be copied whole to the scanner’s file.


    1. Assemblies


Table 6‑13 Consume Assembly

Reserved

Reserved

TXID

Transmit Buffer Length

String byte #1

String byte #2

String byte #3

String byte N

Table 6‑14 Produce Assembly

Reserved

RXID

Status

Received Buffer Length

String byte #1

String byte #2

String byte #3

String byte N



  1. Theory of Operation

    1. The Transmit Record Algorithm

      1. Basic Theory of operation




Serial

Port
Object



Serial Data

t Data


Transaction ID

Data Switch

Record Enabled?

Parser


The Transmit record object addresses several issues of utilizing a DeviceNet network device in the process of communicating via a serial data stream. The device takes a block of data passed by the I/O and transmits this data out over the DeviceNet link. A Transaction ID, providing control of data sent from the DNET1CHCONV, can protect this data.

The data flow and algorithm are shown below for reference.

Figure A‑5 Transmit Record Algorithm Functional Flowchart

As diagramed above, the serial data is set and then parsed if the serial data length is set to zero. The parser then sets the length on the serial data. If Record Protection is disabled, the data is immediately added to the serial port’s transmit queue. Also, whenever the Transaction Id is changed, the serial transmit data is sent to the serial port object.

The parser determines the length of the string by searching the string for a delimiter character. The algorithm can be configured to ignore, include or exclude the character.

    1. The Receive Record Algorithm


The receive record algorithm was developed in order to enable the receipt of data from a remote serial device and the subsequent transmission of data over a DeviceNet I/O connection. The Receive Record Algorithm controls when data is acquired and when that acquired data is presented to the connection. This section will help you understand the algorithm in order to efficiently utilize all of the capabilities of the DNET1CHCONV.
      1. Basic Theory of operation


The Basic function of the DNET1CHCONV is to address the problem of receiving and transmitting serial data over DeviceNet. Serial data is a data stream, in which data is presented to a device one byte at a time and does not have a beginning or an end. DeviceNet however, is not stream oriented; data is presented in chunks of defined sizes and bounds. The Receive Record algorithm formats the streaming data into a data block. It uses user-defined events on the receive serial link to determine where this data block starts and ends. It then uses a status byte to notify the controlling DNET1CHCONV when new data is available. The DNET1CHCONV then increments the record number and the new data are presented.

The Receive Record Algorithm creates a DeviceNet object and presents the data in an ordered fashion to the DeviceNet I/O connection. The Receive Record object may be reached over DeviceNet at Class 0x72. If you are going to be using explicit messaging to communicate with the device, we recommend that you access the data from this point, and not the parameter object, because the parameter object obeys slightly different rules in order to ease the interface with today’s most common configuration tools.







Figure A‑6 Receive Record Algorithm Functional Flowchart

The Receive Record Algorithm is diagramed above. The serial stream originates from the serial port object (0x70). It is looked at a byte at a time by the event detection system. If the event detection system detects a beginning event (the beginning delimiter is received or disabled), it closes the first data switch, allowing the serial data to accumulate in the back buffer. Once an end event is received (the End delimiter is received, or the back buffer is full) the event detection system will close the data switch and set a new data status. When the new data status is set, if the device is set up in auto increment mode, the object will automatically increment the record number and clear the new data bit. In this configuration, the user will not be allowed to set the Receive Record Number.

The SHORT_STRING data type is the DeviceNet data type used in the DNET1CHCONV. This data type has a 1-byte length.

The DNET1CHCONV is supported by a variety of DeviceNet. Short poll responses save bandwidth on the DeviceNet network, but many scanners do not support this functionality and will not allow communication with a device that responds in this manner. The DNET1CHCONV supports this non-compliant behavior through pad mode. This is a function where a character is appended to the end of the serial data in order to fill out the poll response. The default for pad mode is OFF, and the default for the pad character is 0 (NULL).

Note: Turn pad mode ON if you receive errors indicating that the I/O data response is too short.

The DNET1CHCONV also supports byte-reordering to support multi-byte PLC files. The DeviceNet network data-ordering scheme is little ending, meaning that the low byte of a multi-byte messages transmitted first. This means that if you are using a data file that is using a 16 bit or larger word size and you map the connection’s data directly into this space, your data bytes will show up swapped. The DNET1CHCONV implements byte reordering (swapping) in order to accommodate these PLCs. The swapping mechanism re-orders the I/O data so that is appears in a human readable form in a file with a little ending byte order. To enable byte swapping, determine the number of bytes in your data size. Subtract 1 from this number, and set the Receive Record object’s byte swapping attribute to this value (also available through the parameter object). Now, you must set the length of your message size to a multiple of 1+this value, or the DNET1CHCONV will not be able to swap the bytes correctly. The data will now be ordered properly in your DNET1CHCONV.




  1. Download 0.71 Mb.

    Share with your friends:
1   2   3   4   5   6   7   8   9




The database is protected by copyright ©ininet.org 2024
send message

    Main page