ASCII Command Interface Programmer's Guide

ASCII Command Interface Programmer's Guide

Programmer’s Reference Command Interface for MCC ASCII Interface I2C Bus Adapters www.mcc-us.com Copyright© 2018 by Micro Computer Control Corporation. All rights are reserved. No part of this publication may be reproduced by any means without the prior written permission of Micro Computer Control Corporation, PO Box 275, Hopewell, New Jersey 08525 USA. DISCLAIMER: Micro Computer Control Corporation makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. Further, Micro Computer Control Corporation reserves the right to revise the product described in this publication and to make changes from time to time in the content hereof without the obligation to notify any person of such revisions or changes. WARNING - Life Support Applications: MCC products are not designed for use in life support appliances, devices, or systems where the malfunction of the product can reasonably be expected to result in a personal injury. WARNING - Radio Frequency Emissions: This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC rules, and the CE General Emissions Standard EN55032 and General Immunity Standard EN55035. These limits are designed to provide reasonable protection against interference when the equipment is operated in a commercial environment. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction manual, may cause interference to radio communications. Operation of this equipment in a residential area is likely to cause interference, in which case the user will be required to correct the interference at his own expense. WARNING - Electrostatic Discharge (ESD) Precautions: Any damage caused by Electrostatic Discharge (ESD) through inadequate earth grounding is NOT covered under the warranty of this product. See the “Electrostatic (ESD) Precautions” section of this guide for more information. Electronic Waste Notice - This product must NOT be thrown into general waste, but should be collected separately and properly recycled under local regulations. Created in the United States of America 12-OCT-2018 Table of Contents Introduction .......................................................1 MS.NET Class Library ............................................1 LabVIEW VI Library .............................................1 ASCII Command Interface .........................................1 Quick Start........................................................2 ASCII Command Interface ...........................................3 Synchronous Interface Events .....................................6 Adapter Reset .................................................6 Status Display.................................................6 Serial Communications Baud Rate.................................7 Close I2C Connection ...........................................7 Set Destination I2C Slave Address .................................7 Echo/Prompt Control ...........................................8 Serial Communications Flow Control...............................8 I2C General Call Control.........................................9 Hex Only Display Control........................................9 Set Adapters’s Own I2C Slave Address.............................10 I2C Bus Clock Rate Control .....................................10 Command Menu Display .......................................10 Interrupt Signal Control/Status...................................11 Open I2C Connection ..........................................12 Master Read Message..........................................12 Slave Transmit Message ........................................13 Master Transmit Message .......................................14 Set I2C Bus Time-oUt in msec ...................................15 Display Firmware Version ......................................16 eXtended Commands ..........................................16 Display Tx bYte Count .........................................18 Asynchronous Interface Events ....................................20 Slave Transmit Request .........................................20 Slave Receive Complete ........................................20 General Call Receive Complete ..................................20 Adapter Ready ...............................................21 Slave Not Acknowledging ......................................21 Adapter Busy.................................................21 I2C Bus Arbitration Loss........................................21 I2C Bus Error Detected.........................................21 I2C Bus Time-out Detected......................................22 Adapter Connection Closed .....................................22 Invalid Command Argument.....................................22 Slave Transmit Request Not Active ...............................22 Invalid Command.............................................22 Adapter Receive Buffer Overflow ................................23 Example Code ....................................................24 Adapter Reset ..................................................24 Adapter Initialization ............................................24 Master Transmit Message .........................................24 Master Receive Message .........................................24 Communication Event Processing...................................25 Revision Report ..................................................28 Additional Information ............................................28 Introduction Micro Computer Control Corporation provides three methods for creating custom application software for ASCII Interface I2C Bus Adapters: MS.NET Class Library (Recommended) The MS.NET Class Library provides a comprehensive set of tools for the creation of robust I2C Bus applications. Included are Constructors, Methods, Properties, Events, Enumerations, and SampleCode for Visual Basic.NET, Visual C#, Visual C++, Visual J#, and LabVIEW. For more information see: www.mcc-us.com/dotNET/ASCIIiPortDotNetClassLibrary.htm LabVIEW VI Library The LabVIEW VI Library provides a complete set of low-level, mid-level, and high-level Virtual Instruments (Vis) for the LabVIEW developer. Included are VIs for establishing a connection to the Adapter, performing I2C Bus Master and Slave operations, and Sample LabVIEW applications. For more information see: www.mcc-us.com/LabVIEW_Library/LabVIEW_Library.htm ASCII Command Interface The ASCII Command Interface provides a direct low-level ASCII command application program interface to the I2C Bus Adapter. ASCII commands can be accessed from a terminal emulation program running on the host computer, or from an application program using host computer operating system serial port functions. This Programmer’s Reference describes the ASCII Command Interface, and includes a Quick Start, ASCII Command Table, ASCII Command and Response descriptions, and Sample Code. 1 Programmer’s Quick Start Creating a custom Adapter program is easier if you know what to expect. Follow these steps to manually control the Adapter from your computer’s keyboard and screen using a terminal emulation program. 1. Install the Adapter as directed in the “Hardware Set-Up” section of the Adapter’s User’s Guide. 2. Use a terminal emulator program to start communicating with the I2C adapter. Remember to select the correct Com Port (i.e. see Windows Device Manager) and set the communication parameters to 19200 Baud, 8 Data Bits, No Parity, and 1 Stop Bit. 3. Enter //[CR] to get an Adapter Status Report. Note: All Adapter commands are terminated with a Carriage Return ([CR]) character. On most terminal emulators, press the Enter key. 4. Enter /F0[CR] (XON/XOFF) or /F1[CR] (RTS/CTS) to set Adapter’s communications Flow Control to match your terminal. 5. Enter /Ixx[CR] (xx = 02…FE even) to set Adapter’s Own I2C Slave Address. 6. Enter /O[CR] to Open the Adapter Connection. The Adapter does not need to be connected to an I2C Bus to open a connection. 7. Enter /Dxx[CR] (xx = 00…FE even) to select a Destination I2C Slave Address 8. Enter /Ttext[CR] (text = ASCII or Hex-Equivalent ~00…~FF) to Master Transmit a message to the current Destination I2C Slave device 9. Enter /Rn[CR] (n = 0…32767) to Master Read a message from the current Destination I2C Slave device. 2 ASCII Command Interface Note: [CR] = Carriage Return Code or Enter Key. Syntax: [Select], (Optional), xx = [00..FE], n = [0..32767] Adapter Commands Command Description Supported Adapters Ctrl/R,Ctrl/R,Ctrl/R Adapter Reset All This command resets the Adapter to its default state. //[CR] Status Display All Display Adapter status information. /B[0|1|2][CR] Serial Communication Baud Rate All except iPort/AI which operates at a Control fixed rate of 19.2K baud. i2cStick, Set the Adapter’s serial iPort/USB 2, and i2cStick 2 internally communication baud rate (0 = 19.2K, re-maps all three baud rates to 115.2K. 1 = 57.6K, 2 = 115.2K Baud). /C[CR] Close I2C Connection All Disconnect Adapter from the I2C Bus. /Dxx[CR] Set Destination I2C Slave Address All Set the Adapter’s destination I2C Slave Address for subsequent Master Transmit or Receive operations. /E[0|1][CR] Echo/Prompt Control [0 = Off, 1 = All On] Enable/Disable data entry echo and prompts. /F[0|1][CR] Flow Control [0 = XON/XOFF, 1 = All RTS/CTS] Select serial communication handshaking protocol. /G[0|1][CR]

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    32 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us