Control Characters used in DirectNET

Similar documents
DirectNET Host. Communications Programs. In This Chapter...

Host Master Example. In This Chapter...

D0 DCM Module Setup Direct

S-Series Sensor ASCII Protocol v8.1.0

Data Representation and Binary Arithmetic. Lecture 2

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

Setting the DCM Switches

SCADAPack E Koyo DirectNET PLC Interface Manual

Chapter 2 Number System

Fundamentals of Programming (C)

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

SCA Transport Protocol Driver

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

BULLETIN 1203-GD2, -GK2 & 1336-GM2 DF1 MESSAGING (FULL DUPLEX / POINT-TO-POINT)

EWBS Receiving Module Communication specifications

Fundamentals of Programming

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

Number Representations

Using the D2 DCM with MODBUS

11 Serial Communications

The RS-485 user manual for B800 series communication

RS485 INSTRUCTION MANUAL. DM4500 Series. Page 1 of 6

Description of CAT 17 scales communication

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Unit 3. Analog vs. Digital. Analog vs. Digital ANALOG VS. DIGITAL. Binary Representation

3.1. Unit 3. Binary Representation

DB-II Serial Communication Protocol Revision 0.2(English)

Connecting UniOP to Datalogic Barcode Readers

EXPERIMENT 8: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

EE 109 Unit 2. Binary Representation Systems

EE 109 Unit 3. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

EE 109 Unit 2. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

Number Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers

Mounting Dimensions / Viewing 2 Mounting Options 3. Wiring Configuration 4. Quick Set up Procedure 5. Changing Intensity 6.

EXPERIMENT 7: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

Number representations

The Binary Number System

MPU-32 AND FPU-32 TIA-485 NETWORK

$GDSWLYH0LFUR6\VWHPV

Binary Numbers. The Basics. Base 10 Number. What is a Number? = Binary Number Example. Binary Number Example

Chapter 3. Information Representation

Number System (Different Ways To Say How Many) Fall 2016

PayLink-IP/232 Configuration Guide 2005 Lava Computer MFG Inc.

It is the installer's responsibility to follow all instructions in this manual and to follow correct electrical practice.

A GUIDE TO RS-232 COMMUNICATION WITH FX PLCS

Serial I/O. 4: Serial I/O. CET360 Microprocessor Engineering. J. Sumey

EZ Protocol. Communication Protocol for EZPLC. For use of EZAutomation and AVG Customers with EZPLC Products. Copyright 2005 AVG

8.2 User Defined Protocol Communication

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

Modbus Remote Communication Protocol for REM 54_. Technical Description

Card Dispensing/Collecting Machine

Number Systems Base r

ph/orp CONTROLLER PH/ORP800 INSTRUCTION MANUAL

User Guide. Modbus Module. For Digistart soft starters. Part Number: Issue: 3.

FPU-16 A-B PROTOCOL/DATA LOGGER MANUAL

PureScan - ML1. Configuration Guide. Wireless Linear Imager Wireless Laser scanner - 1 -

ABB Modbus RTU Driver for JMobile

Single-Axis Counter BDD 611

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

Positional Number System

Under the Hood: Data Representation. Computer Science 104 Lecture 2

RS-422 Code-Operated Switches

Lecture (09) x86 programming 8

1. Introduction. 2. Installation MODBUS INTERFACE

Exercises Software Development I. 03 Data Representation. Data types, range of values, internal format, literals. October 22nd, 2014

Chapter 2 Bits, Data Types, and Operations

THERMO-CON. Model No. HECR002-A5. Keep available whenever necessary.

Modbus ASCII Serial Device Driver Help 2009 Kepware Technologies

Chapter 2 Bits, Data Types, and Operations

umber Systems bit nibble byte word binary decimal

THT-500-A/R (C5) 1. System Configuration COMMUNICATION INSTRUCTION MANUAL. No. THT5CE

Problem Max. Points Act. Points Grader

POWERLINC PROGRAMMING MANUAL v1.2a

Chapter 2 Bits, Data Types, and Operations

Oberon Data Types. Matteo Corti. December 5, 2001

Number Systems II MA1S1. Tristan McLoughlin. November 30, 2013

RS-232 Control of the Advantage EQ281/8, EQ282/8 and Advantage SMS200

Table of Contents Sleep Settings How to Configure the Scanner. 7 Chapter 2 System Setup

Leica LP C (Laser Printer for Cassettes) System Requirement & Specifications

Motors I Automation I Energy I Transmission & Distribution I Coatings. Modbus RTU CFW701. User s Manual

SPBUS PROTOCOL SPECIFICATION

Card Issuing Station For Magnetic, Contact & IC Card

RS-232 Control of the Advantage DRI

Bits and Bytes. Data Representation. A binary digit or bit has a value of either 0 or 1; these are the values we can store in hardware devices.

Compact Card Dispenser

Table of Contents. VM201 Protocol

Terminal Command VA Instruction Manual. Ver.1.02

InfoTag KE28xx Communications for 186 CPU Firmware Version 4

CDN Series Displays with Profibus-DP ELEN UNI-TXT (ND) protocol PARAMETRIZATION OF PROFIBUS-DP COMMUNICATION INTERFACE

UNIT 7A Data Representation: Numbers and Text. Digital Data

SERIAL INTERFACE. Series SSW-05

2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme

General Remote Interface Description. en General Remote Interface Description

GE MDS, LLC. NETio Series. Protocol Communications Supplement. March 2013 Part No A01, Rev. C

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.

Do not start the test until instructed to do so!

D730. Remote Display Installation Manual

Wireless Modem Exchange (WMX) Protocol Description

Chemistry Hour Exam 2

Transcription:

Control Characters used in DirectNET ENQ (0x05) Enquiry to start communications ACK (0x06) Acknowledge (data received and no errors NAK (0x15) Negative Acknowledge (data received but there were errors) SOH (0x01) Start of Header ETB (0x17) End of Transmission Block (intermediate block) STX (0x02) Start of Text (beginning of data block) ETX (0x03) End of Text (end of last data block) EOT (0x04) End of Transmission (transaction complete) NOTE: All control characters are in Hex format

Enquiry Header Data Packet Ack (Acknowledge) EOT (End of Transmission)

Enquiry: Static Value. Never Changes. Always use 0x4E for this field. 4E 21 05 Static Value. Never Changes. Always use 0x05 for this field. Point to Remember: Enquiry is always the same regardless of Hex or ASCII mode Address Field with 0x20 offset. Simple Conversion: Take the decimal slave value. (NOTE: DCM address already in hex format). Convert to Hex, add 0x20 and put that number in the field. Example: Decimal 60= Hex 0x3C. Add 20 and Slave field should be 0x5C.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 SOH (Start of Header): Never Changes. Always use 0x01 for this field.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3931 3031 17 30 38 Address Field without offset. Simple Conversion: Take the decimal slave value. Convert to Hex. (NOTE: DCM address already in hex format) Example: Decimal 04= Hex 0x04. Look at ASCII Table: 0=30 4=34. Enter 3034 into the slave address field. Another example: Decimal 60= Hex 0x3C. 3=33 C=43. Enter 3343 into slave address field.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Read or Write Request Field: Enter 30 if Read or 38 if write.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Data Type Field: Refer to Appendixes D-F for the appropriate PLC mapping. Example: DL205 V-memory is 31.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3931 3031 17 30 38 Starting Address Fields: Refer to Appendixes D-F for the appropriate 4 digit PLC Reference address to start read or writing at. The value that is entered into these fields is a octal to hex conversion plus an offset of 1. For example: V40400=octal 40400 -> 0x4100 + 1 = 4101 Reference address. You then convert this value with the ASCII table: 4=34 1=31 0=30 1=31 to get 3431 3031.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Number of Complete Data Blocks: Anytime you need more than 256 bytes of data, you would use this field. If you place a value of 1 into this field, you will get 256 bytes of data. If you place a value of 2 into this field, you will get 512 bytes of data (2 Data Blocks). Everytime you increment this value, you get 256 more bytes of data. Once you determine how many complete data blocks you want, you convert the number to hex and then use the ASCII Table to convert to the value to enter into the field.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Partial Data Blocks: You use this field anytime you want less than a complete block of data (<256 bytes). You do the same conversion as before. For example, if you want 72 V memory locations (144 bytes), you convert decimal 144= Hex 0x90. Then do the ASCII table look up. 9=39 0=30. You enter 3930 into the partial data block field.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Master ID: This field holds the value of the Master ID number. This will almost always be either 3030 for 0 or 3031 for 1. If you wanted a different value, you do the same conversions as before.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 End of Transmission: This field always holds the value of 0x17 since there is only one header for any given transaction in DirectNET.

Header: Byte: 1 2+3 4 5 6+7 8+9 10+11 12+13 14+15 16 17 (+18) 08 01 3034 30 31 3431 3031 3031 3930 3031 17 30 38 Point to remember: The header checksum is the first place that the format actually changes between Hex and ASCII mode LRC Calculator LRC Checksum: This field holds the checksum. The value in the upper field is the DirectNET Hex representation and the value in the lower field is the DirectNET ASCII representation. Reference the DirectNET manual for details on calculating the LRC. Also, here is an application that does this as well. Remember that only bytes 2 15 are calculated in the LRC (represented in red here).

Data Packet: Byte: 1 2 to 256 bytes n n + 1 Hex LRC 02 Lsb Msb Lsb Msb 17 03 ASCII LRC Start of Text (STX): Static Value. Never Changes. Always use 0x02 for this field.

Data Packet: Byte: 1 2 to 256 bytes n n + 1 Hex LRC 02 Lsb Msb Lsb Msb 17 03 ASCII LRC Data Field: This field holds the actual data that is being written or read. Notice that the byte order is backwards from what how you would view it in data view (hex mode). This is another field that would differ in format between Hex and ASCII mode. Example (Hex Mode): If you had placed a value of 1234 into a V memory location in Data view using the standard BCD/Hex format, you would see 34 12 in the data field. Example (ASCII Mode): Same value as above entered into Data View in BCD/Hex format would show as 33 34 31 32 in the data field. NOTE: It takes twice as many bytes in ASCII Mode as opposed to Hex Mode. So Remember that you need to request twice as many bytes for the same amount of data if using ASCII Mode.

Data Packet: Byte: 1 2 to 256 bytes n n + 1 Hex LRC 02 Lsb Msb Lsb Msb 17 03 ASCII LRC End of Text/End of Block: If you are reading or writing multiple blocks of data, this field should contain a 0x17(ETB) for all data blocks except for the last data block. The last data block should contain a 0x03(ETX).

Data Packet: Byte: 1 2 to 256 bytes n n + 1 Hex LRC 02 Lsb Msb Lsb Msb 17 03 ASCII LRC LRC Checksum: This field contains the data packet LRC. Same calculation rules apply here. Only the data bytes are calculated in the LRC for the Data Packet (illustrated in Red).

Acknowledge: 06 Acknowledge: This is simply an hex 0x06. This is used to acknowledge different components of the transaction. This will be explained later in the sequence of events description.

End of Transmission: 04 Point to remember: An EOT given from either the master or slave will terminate the present communications transaction and the master will have to begin anew with the Enquiry. End of Transmission: This is simply an hex 0x04. This signifies the end of transmission on that transaction from the sending device.

Sequence of Events: Read: - Master sends Enquiry - Targeted Slave sends ACK - Master sends Header - Targeted Slave sends requested Data packet - Master sends ACK - If Multiple Data packets were requested, slave sends next data packet. If not, Slave sends EOT. - Master sends EOT

Sequence of Events: Write: - Master sends Enquiry - Targeted Slave sends ACK - Master sends Header - Targeted Slave sends ACK - Master sends Data Packet - Slave Responds with ACK - Once the Master has sent all Data Packets, it sends an EOT

Comparison of a 2 byte read in both Hex and ASCII mode Hex Mode ASCII Mode Master Slave Master Slave Note the carriage return LRC is now 2 bytes instead of 1 Even though we are only asking for 2 bytes of actual data, we have to load the data block size with 4 bytes. The data doubled in size and the format is different Note the carriage return

Comparison of a 2 byte write in both Hex and ASCII mode Master Hex Mode Slave Master ASCII Mode Slave Note the carriage return LRC is now 2 bytes instead of 1 Even though we are only writing 2 bytes of actual data, we have to load the data block size with 4 bytes. The data doubled in size and the format is different Note the carriage return

Example of how this would look on a comm analyzer Master Hex Mode Slave

Example of how this would look on a comm analyzer Master ASCII Mode Slave

General Questions: Why use ASCII Mode? No reason to use anymore. When DirectNET was originally created, the editors that you used to write code did not have the support and commands that are used today to detect the beginnings and ends of data packets as well as the conversion commands. Why use Hex Mode? If reading or writing a small amount of data, there is no real advantage to using Hex Mode. If you are reading or writing a large amount of data, Hex Mode transfers half as many bytes for the same amount of data so Hex Mode will have better throughput. Why is there an offset of 20 in the Enquiry? So that the address does not get interpreted as a control character. An offset of 20 brings the data above the control character range.

General Questions: Why am I getting an 04(EOT) from the slave before my communications are complete? This is an indication of a Timeout. The Slave did not receive the expected data in the time allowed for this transaction so it sent an EOT to terminate this communications transaction. Why am I getting an 15(NAK) from the slave? The data command sent to the PLC was formatted incorrectly or the LRC was incorrect.