Sample Programs
#include dos.h #include stdio.h #include ªMCROCOMM.Cº
Sample Basic Program
Appendix RTU Protocol
Introduction
Message Types
Transmission Sequence
Query
Broadcast
Error Check Field
Message Fields
Station Address
Function Code
Message Termination
Timeout Usage
Character Format
Cyclic Redundancy Check CRC
Generating Polynomial
Hardware Implementation of CRC-16
Software Calculation of CRC±16
Example CRC±16 Calculation
Address Function CRC±16
RTU Message Length
Function Code And Name
Query or Broadcast Message Length Less CRC Code
Response Message Length Less CRC Code
Response
Message Descriptions
Message 01 Read Output Table Format
Message 02 Read Input Table Format
Message 03 Read Registers Format
Message 04 Read Analog Inputs Format
Message 05 Force Single Output Format
Message 06 Preset Single Register Format
Message 07 Read Exception Status Format
Message 16 Preset Multiple Registers Format
Message 17 Report Device Type Format
Communication Errors
Invalid Function Code Error Response
Invalid Address Error Response
Invalid Query Message
Invalid Data Value Error Response
Query Processing Failure Error Response
Serial Link Timeout
Invalid Transactions
Appendix Communications Using Windows DDE
Limits of the Demonstration Software
Features of the Micro PLC DDE Driver Software
Simple Demonstration using Microsoft Word
Demonstration using Microsoft Excel
Viewing PLC Data in Windows
Ordering Information
Viewing PLC Data in another DDE-compliant Application
Writing Values to the PLC from another Application
Features
Using the Display Software with Micro PLC Net
Overview
Appendix E Data Acquisition, Logging, and Display Program
Equipment Required
Startup
Invoking Display
Display Software Menus
Auto Polling Operation
Changing the Screen Colors
Editing Summary
Manual Mode
Data Format
Reading Multiple Bytes of Input, Output, or Register Data
Entering Manual Mode
Reading One Word of Input, Output, or Register Data
Creating a Bank of Registers for Downloading Data
Writing Data to the Registers
15,T,1
Specifying an Existing File to Edit
Creating or Editing Autopolling Screens
Naming an Auto-polling Screen File
Creating an Auto-polling Screen
Text for Auto-polling Screens
Setup for Data Logging During Auto-Polling
Formatting Strings for Auto-polling Screens
Example
Data Display String Format ± &XYYYYYZN
Format
Data Limits Format ± &L,X,YYYYY,LowLimit,Hilimit
Hilimit
Colors/logtime setup format ± &#,SC,BC,LT
#,SC,BC,LT
System Messages
Creating or Editing System Messages
Specifying the Device to Control System Message Display
Auto-Polling During System Operation
Executing an Auto-polling Screen
Changing the Display
Printing the Screen
Writing a Value to a Register
Forcing an Output
Data Logging
How Data Logging Works
.LOG File
Renaming the .LOG File to Prevent Overwriting Data
Format of Logged Data
Time Stamp Year, Month, Day, Hour, Minutes, Seconds
Data Type Table, Reference, Data Value
Target ID