=================================================================
               FiveCo's Code sample RS485 README file         
                 	      01-SEPTEMBER-2016

*****************************************************************
*            CHECK THE FIVECO WEB SITE FOR THE LATEST           *
*               INFORMATION ABOUT FIVECO PRODUCTS               *
*                     http://www.fiveco.com/                    *
*****************************************************************

CONTENTS

1. Introduction
2. Code sample use
3. Revision history
4. Copyright Notice

=================================================================
1. Introduction

The code sample RS485 help a developper to communicate with the 
FiveCo's RS485 products.
It only manages the creation of the buffer of data to send to the 
card and it also shows an example of the analysis fo the received 
answers.

This file describe the use of the code sample RS485 : 
"FiveCo_CodeSample_RS485.c" 

=================================================================
2. Code sample use

For a good use of the code sample, please follow the next steps:

To send data: 

	1) Memory allocation for the data buffer.
	   The size of the buffer must be big enough to contain all 
	   the data to send included the header and the checksum.
	   
	2) Call function "initPacket(....) to add the header (Source 
	   address, destination address, length of parameters, and
	   the transaction ID) in the buffer.
	   The length of parameters is initialized at '0'. The right 
	   length will be written when the packet is closed.
	
	3) Call "addReadRegister(....)" for each register you want to
	   read.
	
	4) Call "addWriteRegister(....)" for each register you want 
	   to write. 
	   
	5) Call "addCallFunction(....) for each function you want to 
	   call (register with null size).
	   
	5) Call "closePacket(....)" to add the checksum in the buffer
	   and to write the correct size in the header.
	   The buffer is now ready to be sent.

When you receive data, the function "readPacket(....)" shows an 
example of the analysis of the FiveCo's RS485 Packet. The analysis 
of each register depends of the product type, please refer to the
product user manual for more details.

=================================================================
3. Revision history 

REV 1.00
--------
- Linked to "FiveCo_CodeSample_RS485.c" version v1.0
- First release

=================================================================
4. Copyright Notice

Software, documentation and related materials:
Copyright (c) 2002-2016 FiveCo
All rights reserved.