Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:eval:user-guides:eval-adicup3029:reference_designs:demo_plc_modbus [17 May 2019 12:18] – [MinimalModbus basic examples] Mihai Ionut Suciuresources:eval:user-guides:eval-adicup3029:reference_designs:demo_plc_modbus [08 Mar 2021 06:12] (current) – [Obtaining the Source Code] adding in .Hex files Zuedmar Arceo
Line 3: Line 3:
 ===== General Description/Overview ===== ===== General Description/Overview =====
  
-The distributed control system demo is a demo that uses a **EVAL-ADICUP3029** connected with an **EVAL-CN0416-ARDZ** and up to 4 **EVAL-CN0414-ARDZ** or **EVAL-CN0418-ARDZ** boards stacked together. This system forms a MODBUS slave device that can be addressed by any MODBUS masterThe **EVAL-CN0414-ARDZ** and **EVAL-CN0418-ARDZ** boards function as HART enabled inputs and outputs respectively, the **EVAL-ADICUP3029** is the controller that implements the MODBUS slave and **EVAL-CN0416-ARDZ** is an adapter from the UART voltage levels to the RS485 levels.+The Distributed Control System reference design is a hardware and software platform for developing HART-enabled analog input and output modules (or nodes). DCS Modules are assembled from several existing reference designs: 
 +  * **EVAL-ADICUP3029** is the processor board that implements a MODBUS slave and controls the analog input / output boards. 
 +  * **EVAL-CN0416-ARDZ** provides robust RS485 connectivity between one or more nodes and a host computer 
 +  * **EVAL-CN0414-ARDZ** provides four group-isolated voltage inputs and four HART enabled current inputs
 +  * **EVAL-CN0418-ARDZ** provides four group-isolated voltage or HART-enabled current outputs
  
-MODBUS is the most popular industrial communication protocol being used today. It is a serial master-slave protocol where the master uses a set of standard commands to read and write registers on the slave device. Reading a slave register can give information about the state and inputs of the slave and writing registers can change the state or outputs of the slave. As such, there are four types of standard registers in the MODBUS slave:+The reference design provides software connectivity using the MODBUS protocol. Modbus is a ubiquitous, open, industrial communication protocol for which there are numerous open-source and commercial software libraries and utilities. It is a serial master-slave protocol where the master uses a set of standard commands to read and write registers on the slave device, and CRC error detection ensures data integrity. Reading a slave register can give information about the state and inputs of the slave and writing registers can change the state or outputs of the slave. The mapping of Modbus registers to application-specific functions is dependent on the end application, and the DCS reference design provides convenient access to all of the functionality of the analog input and output boards.
  
-^ Coil/Register Number ^ Data addresses ^ Types ^ Names ^ +Several options for communicating with the hardware are provided or demonstrated: 
-| 1 9999 | 0 to 270E | Read-Write | Discreet Output Coils | +  * A command-line interface, requiring only terminal program on the host PC and no additional softwareuseful for initial board bringup and debug
-| 10001 - 19999 | 0 to 270E | Read-Only | Discreet Input Contacts | +  An open-source Modbus debug tool 
-| 30001 - 39999 | 0 to 270E | Read-Only | Analog Input Registers | +  A set of command-line utilities (Windows only) 
-| 40001 - 49999 | 0 to 270E | Read-Write | Output Holding Registers | +  Example applications in Pythonusing an open-source Modbus library 
- +
-Each of these registers have 16-bit address and a 16-bit value. +
- +
-The **Discreet Output Coils** are registers that control a single output wire that has a binary value (high or low). Reading this register returns the output value of the bit and writing to it will update the coil with either low value, for writing 0, or high value, for writing anything else+
-The **Discreet Input Contacts** are registers that represent the value of a single input logic wire. The register can be only read and it is 0 if the wire is logic low and 0XFFFF if the wire is logic high. +
-The **Analog Input Registers** represent an analogical valueusually from an analog wire. This register can be only read and returns a 16-bit value. +
-The **Output Holding Registers** are registers that control an analogical output or a state of the slave. Reading this register returns the state of a process or an output and writing to it may change them or start a process. +
- +
-Each register can be accessed using a function code: +
- +
-^ Function code ^ Action ^ Table name ^ +
-| 1 (0x01) | Read | Discreet Output Coils | +
-| 5 (0x05) | Write Single | Discreet Output Coils | +
-| 15 (0x0F) | Write Multiple | Discreet Output Coils | +
-| 2 (0x02) | Read | Discreet Input Contacts | +
-| 4 (0x04) | Read | Analog Input Registers | +
-| 3 (0x03) | Read | Output Holding Registers | +
-| 6 (0x06) | Write Single | Output Holding Registers | +
-| 16 (0x10) | Write Multiple | Output Holding Registers |+
  
 ===== Demo Requirements ===== ===== Demo Requirements =====
- 
-FIXME!  -  update link 
  
 The following is a list of items needed in order to replicate this demo. The following is a list of items needed in order to replicate this demo.
Line 40: Line 23:
     * EVAL-ADICUP3029     * EVAL-ADICUP3029
     * EVAL-CN0414-ARDZ and/or EVAL-CN0418-ARDZ, up to 4 boards total, in any configuration     * EVAL-CN0414-ARDZ and/or EVAL-CN0418-ARDZ, up to 4 boards total, in any configuration
-    * EVAL-CN0416-ARDZ (not needed with CLI implementation)+    * EVAL-CN0416-ARDZ (not needed for direct USB connection to a single node) 
 +    * Additional EVAL-CN0416-ARDZ, ADALM-UARTJTAG, and 2x5, 100mil cable such as [[digikey>A3AAH-1006G|AMP A3AAH-1006G]] **or:** 
 +      * other RS485 host adapter
     * Mirco USB to USB cable     * Mirco USB to USB cable
     * PC or Laptop with a USB port     * PC or Laptop with a USB port
   * Software   * Software
-    * [[https://gitlab.analog.com/Platformation/EVAL-ADICUP3029/tree/plc_system_demo_dev/projects/ADuCM3029_demo_plcsystem|ADuCM3029_demo_cn0435 demo application]]+    * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0435|ADuCM3029_demo_cn0435 demo application]]
     * CrossCore Embedded Studio (2.8.0 or higher)     * CrossCore Embedded Studio (2.8.0 or higher)
     * ADuCM302x DFP (3.2.0 or higher)     * ADuCM302x DFP (3.2.0 or higher)
Line 50: Line 35:
     * Serial Terminal Program (Required for running in CLI mode only)     * Serial Terminal Program (Required for running in CLI mode only)
       * Such as Putty or Tera Term       * Such as Putty or Tera Term
 +    * Python 3.6 (only required for modifying example applications)
  
 ===== Setting up the Hardware ===== ===== Setting up the Hardware =====
  
 <WRAP center round important 80%> <WRAP center round important 80%>
-Depending on the PLC/DCS Node configuration the power needs to be provided as follow:+Depending on the PLC/DCS Node configuration the power needs to be provided as follows:
   * If the PLC/DCS Node contain at least a CN0418 board, then the power will be provided through any CN0418 board (the jumper for P17 **MUST** to be placed for each board).   * If the PLC/DCS Node contain at least a CN0418 board, then the power will be provided through any CN0418 board (the jumper for P17 **MUST** to be placed for each board).
   * If the PLC/DCS Node contain only CN0414 boards, then the power can be provided through any CN0414 board.   * If the PLC/DCS Node contain only CN0414 boards, then the power can be provided through any CN0414 board.
 +Refer to the [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0414|CN0414]] and [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0418|CN0418]] user guides for detailed information on power requirements.
 </WRAP> </WRAP>
-==== PLC System block diagram ====+ 
 + 
 +\\ 
 +==== PLC / Single or multi-node DCS System Setup Configuration ==== 
 +Block diagrams for PLC / single-node DCS and multi-node DCS systems are shown below. These systems differ slightly in their allowable configurations: 
 +  * A Single-node system can operate with either half-duplex or full-duplex RS-485. Termination must be enabled at both ends of the RS-485 line(s). 
 +  * Modbus address conflict is not a concern in a single-node system (but the address must be known to the host.) 
 +  * A Multi-node system can only operate in half-duplex mode. 
 +  * In a Multi-node system, termination must be enabled at the ends of the RS-485 line, which is most often the host RS485 adapter and most distant node. 
 +  * Each node in a multi-node system must be set to a different address. 
 + 
 +==== PLC / Single-node DCS System block diagram ====
 {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:plc_block_diagram.png |}} {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:plc_block_diagram.png |}}
  
 \\ \\
-==== PLC System Setup Configuration ==== 
  
-FIXME Verify the setup configuration when possible+==== DCS System block diagram ==== 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:dcs_block_diagram.png |}}
  
 +\\
  
-^  \\ MODBUS Master Interface Configuration  ^^^^^^^+==== RS485 Adapter Configuration ==== 
 +An ADALM-UARTJTAG board and a spare CN0416 can function as a convenient USB Virtual COM port to RS-485 adapter. Any RS485 adapter should work, if another is available. Isolated / Non-Isolated depends on the application and difference in ground potential between the host and nodes. Full-duplex operation is only supported in the PLC/single-node DCS configuration, as both TX and RX signals are driven continuously. Both single-node and multi-node configurations can use half-duplex. 
 ^ ADALM-UARTJTAG Setup  ^^^^^ ^ ADALM-UARTJTAG Setup  ^^^^^
 +The CP2103 device must be programmed as follows to control the DE signal on the CN0416. Configure Silicon Labs Xpress Configurator as follows to program the device:
 |  IO2 configuration  |  Mode: Push-Pull, Alternate Function: RS-485, Active High  |||| |  IO2 configuration  |  Mode: Push-Pull, Alternate Function: RS-485, Active High  ||||
 +Once the CP2103 is programmed, unplug from the host computer and connect P1 on the ADALM-UARTJTAG to P11 on the CN0416 with a 2x5-socket, 100mil cable such as [[digikey>A3AAH-1006G|AMP A3AAH-1006G]]. Be sure to connect with proper polarity - pin 1 on the ADALM-UARTJTAG must correspond to pin 1 on the CN0416.
 ^ CN0416 Setup  ^^^^^ ^ CN0416 Setup  ^^^^^
 ^    ^  Isolated Full Duplex  ^  Isolated Half Duplex  ^  Non-Isolated Full Duplex  ^  Non-isolated Half Duplex  ^ ^    ^  Isolated Full Duplex  ^  Isolated Half Duplex  ^  Non-Isolated Full Duplex  ^  Non-isolated Half Duplex  ^
 |  S1 position  |  NA  |  NA  |  NA  |  NA  | |  S1 position  |  NA  |  NA  |  NA  |  NA  |
-|  S2 position  |  2  |  1  |   |   |+|  S2 position  |  2  |  1  |   |   |
 |  S4 position  |  NA  |  NA  |  2  |  1  | |  S4 position  |  NA  |  NA  |  2  |  1  |
 |  S5 position  |  2  |  1  |  NA  |  NA  | |  S5 position  |  2  |  1  |  NA  |  NA  |
 |  S6 position  |  NA  |  NA  |  2  |  2  | |  S6 position  |  NA  |  NA  |  2  |  2  |
 |  S7 position  |  2  |  2  |  NA  |  NA  | |  S7 position  |  2  |  2  |  NA  |  NA  |
-^ EVAL-ADICUP3029  ^^^^^ + 
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|USB position]]  |||| +\\ 
- S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |||| + 
-^  \\ PLC System Configuration  ^^^^^^^+ 
 +==== Node Configuration  ==== 
 +Configuration for each node is similar, noting that each node must be set to a different address (via S1 on the CN0416) and the most distant node must have its termination enabled (via S6 or S7 on CN0416.)
 ^ CN0416 Setup  ^^^^^ ^ CN0416 Setup  ^^^^^
 +(Full-duplex only valid in a single-node system.)
 +
 ^    ^  Isolated Full Duplex  ^  Isolated Half Duplex  ^  Non-Isolated Full Duplex  ^  Non-isolated Half Duplex  ^ ^    ^  Isolated Full Duplex  ^  Isolated Half Duplex  ^  Non-Isolated Full Duplex  ^  Non-isolated Half Duplex  ^
-|  S1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0416#summary_of_switch_configurations|Any position]]  |||| +|  S1 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0416#summary_of_switch_configurations|Any position but different from node to node]]  |||| 
-|  S2 position  |  2  |  1  |   |   |+|  S2 position  |  2  |  1  |   |   |
 |  S4 position  |  NA  |  NA  |  2  |  1  | |  S4 position  |  NA  |  NA  |  2  |  1  |
 |  S5 position  |  2  |  1  |  NA  |  NA  | |  S5 position  |  2  |  1  |  NA  |  NA  |
Line 91: Line 97:
 |  S7 position  |  2  |  2  |  NA  |  NA  | |  S7 position  |  2  |  2  |  NA  |  NA  |
 ^ CN0414 Setup (if available)  ^^^^^ ^ CN0414 Setup (if available)  ^^^^^
-|  P1 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#multiple_boards_stacked|Any position from MULTI configuration]]  ||||+|  P1 position  | \\ [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#multiple_boards_stacked|Any position from MULTI configuration]]  ||||
 |  P2 position  |  :::  |||| |  P2 position  |  :::  ||||
-|  P10 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_address_configurations|Any position to result a different EEPROM address from board to board]]  ||||+|  P10 position  | \\ \\ [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_address_configurations|Any position to result a different EEPROM address from board to board]]  ||||
 |  P11 position  |  :::  |||| |  P11 position  |  :::  ||||
 |  P12 position  |  :::  |||| |  P12 position  |  :::  ||||
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_configuration_for_single_or_multiple_boards_configuration_jp1|MULTI configuration position]]  ||||+|  JP1 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_configuration_for_single_or_multiple_boards_configuration_jp1|MULTI configuration position]]  ||||
 ^ CN0418 Setup (if available)  ^^^^^ ^ CN0418 Setup (if available)  ^^^^^
-|  P10 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position from MULTI configuration]]  ||||+|  P10 position  | \\ [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position from MULTI configuration]]  ||||
 |  P9 position  |  :::  |||| |  P9 position  |  :::  ||||
-|  JP2 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position to result a different EEPROM address from board to board]]  ||||+|  JP2 position  | \\ \\ [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position to result a different EEPROM address from board to board]]  ||||
 |  JP3 position  |  :::  |||| |  JP3 position  |  :::  ||||
 |  JP4 position  |  :::  |||| |  JP4 position  |  :::  ||||
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|MULTI configuration position]]  ||||+|  JP1 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|MULTI configuration position]]  ||||
 |  P17 position  | Jumper should be placed to power the whole system  |||| |  P17 position  | Jumper should be placed to power the whole system  ||||
 ^ EVAL-ADICUP3029  ^^^^^ ^ EVAL-ADICUP3029  ^^^^^
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|ARDUINO position]]  |||| +|  S2 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|ARDUINO position]]  |||| 
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  ||||+|  S5 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  ||||
  
-\\ 
  
-==== DCS System block diagram ==== +==== Direct USB connection ====
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:dcs_block_diagram.png |}} +
- +
-\\ +
- +
-==== DCS System Setup Configuration ==== +
- +
-FIXME - Verify the setup configuration when possible +
- +
- +
-^  \\ MODBUS Master Interface Configuration  ^^^^^^^ +
-^ ADALM-UARTJTAG Setup  ^^^^^ +
-|  IO2 configuration  |  Mode: Push-Pull, Alternate Function: RS-485, Active High  |||| +
-^ CN0416 Setup  ^^^^^ +
-^      Isolated Half Duplex  ^  Non-isolated Half Duplex +
-|  S1 position  |  NA  |  NA  | +
-|  S2 position  |  1  |  3  | +
-|  S4 position  |  NA  |  1  | +
-|  S5 position  |  1  |  NA  | +
-|  S6 position  |  NA  |  2  | +
-|  S7 position  |  2  |  NA  | +
-^ EVAL-ADICUP3029  ^^^^^ +
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|USB position]]  |||| +
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |||| +
-^  \\ DCS First Node System Configuration  ^^^^^^^ +
-^ CN0416 Setup  ^^^^^ +
-^    ^  Isolated Half Duplex  ^  Non-isolated Half Duplex +
-|  S1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0416#summary_of_switch_configurations|Any position but different from node to node]]  |||| +
-|  S2 position  |  1  |  3  | +
-|  S4 position  |  NA  |  1  | +
-|  S5 position  |  1  |  NA  | +
-|  S6 position  |  NA  |  2  | +
-|  S7 position  |  2  |  NA  | +
-^ CN0414 Setup (if available)  ^^^^^ +
-|  P1 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#multiple_boards_stacked|Any position from MULTI configuration]]  |||| +
-|  P2 position  |  :::  |||| +
-|  P10 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_address_configurations|Any position to result a different EEPROM address from board to board]]  |||| +
-|  P11 position  |  :::  |||| +
-|  P12 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_configuration_for_single_or_multiple_boards_configuration_jp1|MULTI configuration position]]  |||| +
-^ CN0418 Setup (if available)  ^^^^^ +
-|  P10 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position from MULTI configuration]]  |||| +
-|  P9 position  |  :::  |||| +
-|  JP2 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position to result a different EEPROM address from board to board]]  |||| +
-|  JP3 position  |  :::  |||| +
-|  JP4 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|MULTI configuration position]]  |||| +
-|  P17 position  | Jumper should be placed to power the whole system  |||| +
-^ EVAL-ADICUP3029  ^^^^^ +
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|ARDUINO position]]  |||| +
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |||| +
-^  \\ DCS Middle Node(s) System Configuration (up to 14 nodes)  ^^^^^^^ +
-^ CN0416 Setup  ^^^^^ +
-^    ^  Isolated Half Duplex  ^  Non-isolated Half Duplex +
-|  S1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0416#summary_of_switch_configurations|Any position but different from node to node]]  |||| +
-|  S2 position  |  1  |  3  | +
-|  S4 position  |  NA  |  1  | +
-|  S5 position  |  1  |  NA  | +
-|  S6 position  |  NA  |  1  | +
-|  S7 position  |  1  |  NA  | +
-^ CN0414 Setup (if available)  ^^^^^ +
-|  P1 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#multiple_boards_stacked|Any position from MULTI configuration]]  |||| +
-|  P2 position  |  :::  |||| +
-|  P10 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_address_configurations|Any position to result a different EEPROM address from board to board]]  |||| +
-|  P11 position  |  :::  |||| +
-|  P12 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_configuration_for_single_or_multiple_boards_configuration_jp1|MULTI configuration position]]  |||| +
-^ CN0418 Setup (if available)  ^^^^^ +
-|  P10 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position from MULTI configuration]]  |||| +
-|  P9 position  |  :::  |||| +
-|  JP2 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position to result a different EEPROM address from board to board]]  |||| +
-|  JP3 position  |  :::  |||| +
-|  JP4 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|MULTI configuration position]]  |||| +
-|  P17 position  | Jumper should be placed to power the whole system  |||| +
-^ EVAL-ADICUP3029  ^^^^^ +
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|ARDUINO position]]  |||| +
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |||| +
-^  \\ DCS End Node System Configuration  ^^^^^^^ +
-^ CN0416 Setup  ^^^^^ +
-^    ^  Isolated Half Duplex  ^  Non-isolated Half Duplex +
-|  S1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0416#summary_of_switch_configurations|Any position but different from node to node]]  |||| +
-|  S2 position  |  1  |  3  | +
-|  S4 position  |  NA  |  1  | +
-|  S5 position  |  1  |  NA  | +
-|  S6 position  |  NA  |  2  | +
-|  S7 position  |  2  |  NA  | +
-^ CN0414 Setup (if available)  ^^^^^ +
-|  P1 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#multiple_boards_stacked|Any position from MULTI configuration]]  |||| +
-|  P2 position  |  :::  |||| +
-|  P10 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_address_configurations|Any position to result a different EEPROM address from board to board]]  |||| +
-|  P11 position  |  :::  |||| +
-|  P12 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0414#eeprom_configuration_for_single_or_multiple_boards_configuration_jp1|MULTI configuration position]]  |||| +
-^ CN0418 Setup (if available)  ^^^^^ +
-|  P10 position  | \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position from MULTI configuration]]  |||| +
-|  P9 position  |  :::  |||| +
-|  JP2 position  | \\ \\ [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|Any position to result a different EEPROM address from board to board]]  |||| +
-|  JP3 position  |  :::  |||| +
-|  JP4 position  |  :::  |||| +
-|  JP1 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/cn0418#general_setup|MULTI configuration position]]  |||| +
-|  P17 position  | Jumper should be placed to power the whole system  |||| +
-^ EVAL-ADICUP3029  ^^^^^ +
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|ARDUINO position]]  |||| +
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |||| +
- +
-==== CLI Setup block diagram ====+
 {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_cli_setup.png |CLI setup}} {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_cli_setup.png |CLI setup}}
  
-==== CLI Setup Configuration ====+==== Direct USB Configuration ====
  
-The CLI system does not need the **EVAL-CN0416-ARDZ** board and is not affected by it's presence either.+The CLI program does not need the **EVAL-CN0416-ARDZ** board and is not affected by it's presence either. Furthermore, the PLC/ single-node DCS configuration can also operate with a direct connection, useful for testing out individual nodes quickly.
  
 ^ EVAL-ADICUP3029  ^^ ^ EVAL-ADICUP3029  ^^
-|  S2 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|USB position]] +|  S2 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#uart_switch|USB position]] 
-|  S5 position  | [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |+|  S5 position  | [[/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029#power_switch|WALL/USB position]]  |
  
 \\ \\
-===== Configuring the Software ===== 
  
-The software can be set up to work in CLI debug mode or in MODBUS mode. To set this make sure the relevant define in the **config.h** file is uncommented and the other one is commented: 
  
-<code> +===== MODBUS Implementation =====
-//#define CLI_INTEFACE +
-//#define MODBUS_INTERFACE +
-</code>+
  
-===== Outputting Data =====+There are four types of standard registers in the MODBUS slave:
  
-There are two interfaces available for this application: a **Command Line Interface (CLI)** used mainly for debugging a single **PLC** node and a **MODBUS interface** used for **PLC**/**DCS** operation for single and multiple nodes.+^ Coil/Register Number ^ Data addresses ^ Types ^ Names ^ 
 +| 1 - 9999 | 0 to 270E | Read-Write | Discreet Output Coils | 
 +| 10001 - 19999 | 0 to 270E | Read-Only | Discreet Input Contacts | 
 +| 30001 - 39999 | 0 to 270E | Read-Only | Analog Input Registers | 
 +| 40001 - 49999 | 0 to 270E | Read-Write | Output Holding Registers |
  
-The **CLI** is implemented through **UART** and must be connected to computer via **USB cable**. A serial terminal program must run on the **host PC** to display data and control the application.+Each of these registers have 16-bit address and a 16-bit value.
  
-The **MODBUS** is connected through the **EVAL-CN0416-ARDZ** **UART** to **RS485** adapter and must communicate with a **MODBUS master** on the **RS485 line**.+The **Discreet Output Coils** are registers that control a single output wire that has a binary value (high or low). Reading this register returns the output value of the bit and writing to it will update the coil with either low value, for writing 0, or high value, for writing anything else. 
 +The **Discreet Input Contacts** are registers that represent the value of a single input logic wire. The register can be only read and it is 0 if the wire is logic low and 0XFFFF if the wire is logic high. 
 +The DCS reference design does not have any functions that would map to **Discreet Output Coils** or **Discreet Input Contacts**
 +The **Analog Input Registers** represent an analog value, usually from an analog wire. This register can be only read and returns a 16-bit value. 
 +The **Output Holding Registers** are registers that control an analog output or a state of the slave. Reading this register returns the state of a process or an output and writing to it may change them or start a process.
  
-==== Command Line Interface ====+Each register can be accessed using a function code:
  
-=== Serial Terminal Output ===+^ Function code ^ Action ^ Table name ^ 
 +| 1 (0x01) | Read | Discreet Output Coils | 
 +| 5 (0x05) | Write Single | Discreet Output Coils | 
 +| 15 (0x0F) | Write Multiple | Discreet Output Coils | 
 +| 2 (0x02) | Read | Discreet Input Contacts | 
 +| 4 (0x04) | Read | Analog Input Registers | 
 +| 3 (0x03) | Read | Output Holding Registers | 
 +| 6 (0x06) | Write Single | Output Holding Registers | 
 +| 16 (0x10) | Write Multiple | Output Holding Registers |
  
-{{page>/wiki/common#serial_terminal_setup&nofooter&noheader}} 
- 
-=== Available Commands === 
- 
-Typing **help** or **h** after initial calibration sequence will display the list of commands and their short versions. The **CLI mode** has a board command menu which is only used to select the board. Each board present in the system has it's own command set based on the type.  
- 
-Bellow is the short command list for the board menu: 
- 
-^ Command                   ^ Description ^ 
-| //h//                  | Display available commands. | 
-| //bs//                 | Set the active board. \\ <//board_no//> = de ID of the board assigned by the program. It its displayed at the start of the program. Calling this command without an argument displays available boards again. | 
- 
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_main_menu_cli.png |CLI main menu}} 
- 
-The specific commands for each of the types of boards is described in they respective wiki pages: 
-  * [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0414#available_commands|EVAL-CN0414-ARDZ specific commands]] 
-  * [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0418#available_commands|EVAL-CN0418-ARDZ specific commands]] 
  
-==== MODBUS Interface ====+==== DCS reference design MODBUS Register Map ====
  
-Because the system may contain any combination of input and output boards up to four, as a **MODBUS slave**, it contains two type of **MODBUS registers**: common and board specific.+Because the DCS reference design may contain any combination of up to four input or output boards, as a **MODBUS slave**, it contains two type of **MODBUS registers**: common and board specific.
  
 The common registers are 5 read-only registers and 2 read-write registers. In standard **MODBUS terminology** that translates to 5 analog input registers and 2 holding registers: The common registers are 5 read-only registers and 2 read-write registers. In standard **MODBUS terminology** that translates to 5 analog input registers and 2 holding registers:
Line 300: Line 193:
 </code> </code>
  
-Adding a board to the system adds a number of board specific registers: 50 analog input registers and 7 output holding registers for adding an **EVAL-CN0414-ARDZ**, and 30 analog input registers and 10 output holding registers for adding an **EVAL-CN0418-ARDZ**.+The register map is configured dynamically after power-up. Adding a board to the system adds a number of board specific registers: 50 analog input registers and 7 output holding registers for each **EVAL-CN0414-ARDZ**, and 30 analog input registers and 10 output holding registers for each **EVAL-CN0418-ARDZ**.
  
 As stated before, adding an **EVAL-CN0414-ARDZ** adds 57 registers to the device: 50 analog input registers and 7 output holding registers. The analog input registers are: 16 for ADC input values, 4 for ADC input open wire detection flags and 50 for HART receive buffer. The output holding registers are: 1 for ADC output coding, 1 for ADC filter options, 1 for ADC postfilter options, 1 for ADC output data rate options, 1 for ADC open wire detection enable, 1 for HART command zero and 1 for HART channel select. The output holding registers are: 16 for the channel registers, 4 for Open Wire Detection and 30 for the HART input buffer. As stated before, adding an **EVAL-CN0414-ARDZ** adds 57 registers to the device: 50 analog input registers and 7 output holding registers. The analog input registers are: 16 for ADC input values, 4 for ADC input open wire detection flags and 50 for HART receive buffer. The output holding registers are: 1 for ADC output coding, 1 for ADC filter options, 1 for ADC postfilter options, 1 for ADC output data rate options, 1 for ADC open wire detection enable, 1 for HART command zero and 1 for HART channel select. The output holding registers are: 16 for the channel registers, 4 for Open Wire Detection and 30 for the HART input buffer.
Line 352: Line 245:
 | HART CH select | 0x09 | Output Holding Register | Select enable a current channel for HART communication: \\ 0 - Channel A (default); \\ 1 - Channel B; \\ 2 - Channel C; \\ 3 - Channel D. | | HART CH select | 0x09 | Output Holding Register | Select enable a current channel for HART communication: \\ 0 - Channel A (default); \\ 1 - Channel B; \\ 2 - Channel C; \\ 3 - Channel D. |
  
-=== qModMaster Example === 
  
 +
 +===== Configuring the Software =====
 +
 +The software can be set up to work in CLI debug mode or in MODBUS mode. To set this make sure the relevant define in the **config.h** file is uncommented and the other one is commented:
 +
 +<code>
 +//#define CLI_INTEFACE
 +//#define MODBUS_INTERFACE
 +</code>
 +
 +===== Communicating with the DCS reference design =====
 +
 +There are two interfaces available for this application: a **Command Line Interface (CLI)** used mainly for debugging a single **PLC** node and a **MODBUS interface** used for **PLC**/**DCS** operation for single and multiple nodes.
 +
 +The **CLI** is implemented through **UART** and must be connected to a computer via **USB cable**. A serial terminal program must run on the **host PC** to display data and control the application.
 +
 +The **MODBUS** is connected through the **EVAL-CN0416-ARDZ** **UART** to **RS485** adapter and must communicate with a **MODBUS master** on the **RS485 line**.
 +
 +==== Command Line Interface ====
 +
 +=== Serial Terminal Output ===
 +
 +{{page>/wiki/common#serial_terminal_setup&nofooter&noheader}}
 +
 +=== Available Commands ===
 +
 +Typing **help** or **h** after initial calibration sequence will display the list of commands and their short versions. The **CLI mode** has a board command menu which is only used to select the board. Each board present in the system has it's own command set based on the type. 
 +
 +Bellow is the short command list for the board menu:
 +
 +^ Command                   ^ Description ^
 +| //h//                  | Display available commands. |
 +| //bs//                 | Set the active board. \\ <//board_no//> = de ID of the board assigned by the program. It its displayed at the start of the program. Calling this command without an argument displays available boards again. |
 +
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_main_menu_cli.png |CLI main menu}}
 +
 +The specific commands for each of the types of boards is described in they respective wiki pages:
 +  * [[/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0414#available_commands|EVAL-CN0414-ARDZ specific commands]]
 +  * [[/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0418#available_commands|EVAL-CN0418-ARDZ specific commands]]
 +
 +==== Modbus Interface ====
 +The Modbus protocol is not human-readable; as such, a Modbus master program is required to interact with the design. QModMaster is a free and open-source implementation of a Modbus master GUI application. This program is useful for board bringup and debug, and during application development. QModMaster is avalable at [[https://sourceforge.net/projects/qmodmaster/|QModMaster on SourceForge]]
 +
 +QModMaster is used to demonstrate several basic register operations below.
  
 |  Common analog input registers read  || |  Common analog input registers read  ||
Line 369: Line 305:
 \\ \\
  
-==== MinimalModbus basic examples ====+===== Obtaining the Software =====
  
-In this application, the instrument is connected via a USB to RS485 bridge.+There are two basic ways to program the ADICUP3029 with the software for the CN0435. 
 +  - Dragging and Dropping the .Hex to the Daplink drive 
 +  - Building, Compiling, and Debugging using CCES
  
-\\+Using the drag and drop method, the software is going to be a version that Analog Devices creates for testing and evaluation purposes.  This is the EASIEST way to get started with the reference design 
 + 
 +Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needs, but will be a bit more advanced and will require you to download the CrossCore toolchain.   
 + 
 +The software for the **ADuCM3029_demo_cn0435** can be found here: 
 + 
 +<WRAP round 80% download> 
 +Prebuilt CN0435 Hex File 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/releases/download/Latest/ADuCM3029_demo_cn0435.hex| ADuCM3029_demo_cn0435.Hex]] 
 +Complete CN0435 Source Files 
 +  * [[https://github.com/analogdevicesinc/EVAL-ADICUP3029/tree/master/projects/ADuCM3029_demo_cn0435| AduCM3029_demo_cn0435 Source Code]] 
 +  
 +</WRAP> 
 + 
 +===== How to use the Tools ===== 
 + 
 +The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio.  For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the [[resources:eval:user-guides:eval-adicup3029:tools|Tools Overview page.]] 
 + 
 +==== Importing ==== 
 + 
 +For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_import_existing_projects_into_your_workspace|How to import existing projects into your workspace]] section. 
 + 
 +==== Debugging ==== 
 + 
 +For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_configure_the_debug_session_for_an_aducm3029_application|How to configure the debug session]] section. 
 + 
 +==== Project Structure ==== 
 + 
 +The application controls a dynamic system that can be physically different every time it is run. to do this it has two parts: 
 +  - The system initialization. 
 +  - The system main process. 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_main_flow.png |}} 
 + 
 +After getting parameters of the system supplied by the user in code the program initializes the software modules common to all the boards: I2C, UART, SPI, microcontroller power, software UART and the AD5700 HART modem. If the MODBUS interface is used, the update timer for the input boards is also initialized in this stage as a common module. If, by comparison, the CLI is used, each input board present initializes its own version of the update timer driver.  
 + 
 +After these initializations the system runs a board discovery routine. By using the presence of I2C EEPROM memory and testing the SPI configuration, all boards in the system are discovered and labeled as either CN0414 or CN0418. If the MODBUS interface is used, the system also scans for its MODBUS slave address and maps and initializes MODBUS registers. 
 + 
 +After board discovery, if the CLI is used, no board is set as active and the system manager loads the main menu process. If the MODBUS is used, the system activates the first board it discovers. 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_initialization.png |}} 
 + 
 +=== CLI Process === 
 + 
 +If the CLI is used, no board is active after the initialization and the system stands by to receive commands. If the user sets one of the boards to be active, the program loads the commands and process specific to that board and starts sunning them until the application is stopped or the "exit" command is called. 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_cli_process.png |}} 
 + 
 +=== MODBUS Interface Process === 
 + 
 +If the MODBUS interface is used the first board discovered is the active board. If it is a CN0414 the program runs its process until all channels are updated. If it is a CN0418 the program runs its process only once. After this the system deactivates the board and activates the next board discovered until all the boards have been active and updated. The system than cycles back from the beginning. 
 + 
 +Meanwhile the system scans the MODBUS channel for commands and if one is found that is addressed to this node it executes it and sends back a response. 
 + 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_modbus_process.png |}} 
 + 
 +=== Board Specific Processes === 
 + 
 +The process and commands for each type of boards is described in the appropriate application page: 
 +  * [[/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0414#project_structure|EVAL-CN0414-ARDZ]] 
 +  * [[/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0418#project_structure|EVAL-CN0418-ARDZ]] 
 + 
 +===== Example Applications and Utilities ===== 
 +User DCS programs running on the host will be highly application-specific, and written in any number of languages. This section presents several example applications and utilities written in Python that perform basic functions such as reading and writing analog voltages, detecting the configuration of a node, and changing the data rate of an analog input channel. 
 + 
 +==== Utility functions in Python ==== 
 + 
 +The following utility functions are demonstrated using the single-node configuration described above. It may be connected to the host either directly via USB (no RS485 interface) or over a USB to RS485 bridge. Minimalmodbus is an open-source (Apache license) Modbus RTU and Modbus ASCII implementation for Python, and is used in these examples. Similar libraries exist for other languages. 
 + 
 +=== Read common analog input registers basic example ===
  
 For example, consider an instrument (slave) with Modbus RTU and address number 1 to which we are to communicate via a serial port with the name ''COM12''. The instrument stores the actual configuration in registers 0 to 4. To read data from the instrument: For example, consider an instrument (slave) with Modbus RTU and address number 1 to which we are to communicate via a serial port with the name ''COM12''. The instrument stores the actual configuration in registers 0 to 4. To read data from the instrument:
Line 401: Line 408:
 The **EVAL-CN0414-ARDZ** boards have address 0b10 and 0b11 while **EVAL-CN0418-ARDZ** boards have address 0b00 and 0b01. The **EVAL-CN0414-ARDZ** boards have address 0b10 and 0b11 while **EVAL-CN0418-ARDZ** boards have address 0b00 and 0b01.
  
-\\+=== Read analog input registers basic example ===
  
 Next, if we want to read all analog input channels from one **EVAL-CN0414-ARDZ** we can use the following: Next, if we want to read all analog input channels from one **EVAL-CN0414-ARDZ** we can use the following:
Line 427: Line 434:
 In this example, after we run the above piece of code it results a list of 16 elements in decimal format. First 8 values corespond to voltage channels and last to current channels. In this example, after we run the above piece of code it results a list of 16 elements in decimal format. First 8 values corespond to voltage channels and last to current channels.
  
-\\+=== Read and write one output holding register for EVAL-CN0414-ARDZ example ===
  
 Next, if we want to change the output code of one **EVAL-CN0414-ARDZ** ADC to be unipolar instead of bipolar we can use the following: Next, if we want to change the output code of one **EVAL-CN0414-ARDZ** ADC to be unipolar instead of bipolar we can use the following:
Line 464: Line 471:
 In this example, after we run the above piece of code it results an integer which coresponds to ADC coding format. The default value 0, indicate that the ADC is set to bipolar coding format, while a value of 1 will indicate an unipolar coding format. In this example, after we run the above piece of code it results an integer which coresponds to ADC coding format. The default value 0, indicate that the ADC is set to bipolar coding format, while a value of 1 will indicate an unipolar coding format.
  
-\\+=== Read and write one output holding register for EVAL-CN0418-ARDZ example ===
  
 Next, if we want to change the output code of one **EVAL-CN0418-ARDZ** DAC channel we can use the following: Next, if we want to change the output code of one **EVAL-CN0418-ARDZ** DAC channel we can use the following:
Line 501: Line 508:
 In this example, after we run the above piece of code it results an integer which coresponds to DAC channel 1 output code. Depending on channel configuration this output code will corespond to a voltage or a current value. In this example the DAC channel output code is by default 0V because the default channel range is set to 0V to 5V. The 65535 value will corespond in this case to a 5V output. In this example, after we run the above piece of code it results an integer which coresponds to DAC channel 1 output code. Depending on channel configuration this output code will corespond to a voltage or a current value. In this example the DAC channel output code is by default 0V because the default channel range is set to 0V to 5V. The 65535 value will corespond in this case to a 5V output.
  
-\\+=== Detect system configuration example ===
  
 Next, if we want to determine the system configuration we can run the following script from the attached archive. Next, if we want to determine the system configuration we can run the following script from the attached archive.
 +
 {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:detect_configuration.zip |}} {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:detect_configuration.zip |}}
  
Line 509: Line 517:
  
 <xterm> <xterm>
-Available devices:  +Welcome! Use 'CTRL+C' to go back from the current menu or exit! 
-1 -> Silicon Labs CP210x USB to UART Bridge (COM12) + 
 +Available devices: 
 +1 -> Silicon Labs CP210x USB to UART Bridge (COM12)
 2 -> Intel(R) Active Management Technology - SOL (COM3) 2 -> Intel(R) Active Management Technology - SOL (COM3)
-Enter detected device index: Boards found at MODBUS address: 1+ 
 +Enter detected device index, or press ENTER to use COM12: 
 +No boards at MODBUS address: 1 No communication with the instrument (no answer) 
 + 
 +Boards found at MODBUS address: 2
 Address        Name                 Value Address        Name                 Value
 -------------  -----------------  ------- -------------  -----------------  -------
-0000 (0x0000)  Detected boards          4+0000 (0x0000)  Detected boards          
 +0001 (0x0001)  First board data         4 
 +0002 (0x0002)  Second board data        6 
 +0003 (0x0003)  Third board data     65535 
 +0004 (0x0004)  Fourth board data    65535 
 +Analog input board at address: 10 
 +Analog input board at address: 11 
 +No boards at MODBUS address: 3 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 4 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 5 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 6 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 7 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 8 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 9 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 10 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 11 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 12 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 13 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 14 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 15 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 16 No communication with the instrument (no answer) 
 +</xterm> 
 + 
 +For a DCS configuration the script output will look similarly like this: 
 +<xterm> 
 +Welcome! Use 'CTRL+C' to go back from the current menu or exit! 
 + 
 +Available devices: 
 +1 -> Silicon Labs CP210x USB to UART Bridge (COM12) 
 +2 -> Intel(R) Active Management Technology - SOL (COM3) 
 + 
 +Enter detected device index, or press ENTER to use COM12: 
 + 
 +Boards found at MODBUS address: 1 
 +Address        Name                 Value 
 +-------------  -----------------  ------- 
 +0000 (0x0000)  Detected boards          2
 0001 (0x0001)  First board data         1 0001 (0x0001)  First board data         1
 0002 (0x0002)  Second board data        3 0002 (0x0002)  Second board data        3
-0003 (0x0003)  Third board data         4 +0003 (0x0003)  Third board data     65535 
-0004 (0x0004)  Fourth board data        6+0004 (0x0004)  Fourth board data    65535
 Analog output board at address: 00 Analog output board at address: 00
 Analog output board at address: 01 Analog output board at address: 01
 +
 +Boards found at MODBUS address: 2
 +Address        Name                 Value
 +-------------  -----------------  -------
 +0000 (0x0000)  Detected boards          2
 +0001 (0x0001)  First board data         4
 +0002 (0x0002)  Second board data        6
 +0003 (0x0003)  Third board data     65535
 +0004 (0x0004)  Fourth board data    65535
 Analog input board at address: 10 Analog input board at address: 10
 Analog input board at address: 11 Analog input board at address: 11
-No boards at MODBUS address: 2 No communication with the instrument (no answer) 
 No boards at MODBUS address: 3 No communication with the instrument (no answer) No boards at MODBUS address: 3 No communication with the instrument (no answer)
 No boards at MODBUS address: 4 No communication with the instrument (no answer) No boards at MODBUS address: 4 No communication with the instrument (no answer)
Line 540: Line 598:
 No boards at MODBUS address: 16 No communication with the instrument (no answer) No boards at MODBUS address: 16 No communication with the instrument (no answer)
 </xterm> </xterm>
-===== Obtaining the Source Code ===== 
  
-We recommend not opening the project directly, but rather import it into CrossCore Embedded Studios and make a local copy in your workspace. +=== Change or check the system registers example ===
  
-The source code and include files of the **ADuCM3029_demo_cn0435** can be found here:+Next, if we want to check or change the system registers we can run the following script from the attached archive.
  
-<WRAP round 80% download>+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:read_or_write_registers.zip |}}
  
-FIXME!  -  update link+Depending on the system configuration, one or more DCS nodes will be detected. 
 +After the user selects a valid DCS node, a menu will appear which contain all available system options. 
 +Now, depending on the node configuration, not all option will be valid, even if they are shown.  
 +For example, if a DCS node doesn't contain CN0414 analog input board(s), any option which refers to CN0414 will do nothing. 
  
-[[https://gitlab.analog.com/Platformation/EVAL-ADICUP3029/tree/plc_system_demo_dev/projects/ADuCM3029_demo_plcsystem| ADuCM3029_demo_cn0435 at Github]] +<xterm> 
-  +Welcome! Use 'CTRL+C' to go back from the current menu or exit!
-</WRAP>+
  
-===== How to use the Tools =====+Available devices: 
 +1 -> Silicon Labs CP210x USB to UART Bridge (COM12) 
 +2 -> Intel(R) Active Management Technology - SOL (COM3)
  
-The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio For more information on downloading the tools and a quick start guide on how to use the tool basicsplease check out the [[resources:eval:user-guides:eval-adicup3029:tools|Tools Overview page.]]+Enter detected device index, or press ENTER to use COM12: 
 +Enter MODBUS timeout (0.05[s] to inf)or press ENTER to use 0.1[stimeout:
  
-==== Importing ====+Boards found at MODBUS address: 1 
 +Address        Name                 Value 
 +-------------  -----------------  ------- 
 +0000 (0x0000)  Detected boards          2 
 +0001 (0x0001)  First board data         1 
 +0002 (0x0002)  Second board data        3 
 +0003 (0x0003)  Third board data     65535 
 +0004 (0x0004)  Fourth board data    65535 
 +analog output board at address: 00 
 +analog output board at address: 01
  
-For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_import_existing_projects_into_your_workspace|How to import existing projects into your workspace]] section.+Boards found at MODBUS address: 2 
 +Address        Name                 Value 
 +-------------  -----------------  ------- 
 +0000 (0x0000)  Detected boards          2 
 +0001 (0x0001)  First board data         4 
 +0002 (0x0002)  Second board data        6 
 +0003 (0x0003)  Third board data     65535 
 +0004 (0x0004)  Fourth board data    65535 
 +analog input board at address: 10 
 +analog input board at address: 11 
 +No boards at MODBUS address: 3 No communication with the instrument (no answer) 
 +No boards at MODBUS address4 No communication with the instrument (no answer) 
 +No boards at MODBUS address5 No communication with the instrument (no answer) 
 +No boards at MODBUS address6 No communication with the instrument (no answer) 
 +No boards at MODBUS address7 No communication with the instrument (no answer) 
 +No boards at MODBUS address8 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 9 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 10 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 11 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 12 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 13 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 14 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 15 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 16 No communication with the instrument (no answer)
  
-==== Debugging ====+Enter MODBUS address from this list [1, 2], or press ENTER to use MODBUS address 1: 
 +Enter commands delay (0[s] to inf), or press ENTER to use 0.1[s] delay:
  
-For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_configure_the_debug_session_for_an_aducm3029_application|How to configure the debug session]] section.+Test options: 
 +Read common analog input registers. 
 +Read common output holding registers. 
 +3 - Read analog input registers. 
 +4 - Read output holding registers. 
 +5 - Write output holding register. 
 +q - Quit.
  
-==== Project Structure ====+Enter test option: 
 +</xterm>
  
-The application controls a dynamic system that can be physically different every time it is run. to do this it has two parts: 
-  - The system initialization. 
-  - The system main process. 
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_main_flow.png |}}+\\
  
-After getting parameters of the system supplied by the user in code the program initializes the software modules common to all the boards: I2C, UART, SPI, microcontroller power, software UART and the AD5700 HART modemIf the MODBUS interface is usedthe update timer for the input boards is also initialized in this stage as a common module. If, by comparison, the CLI is used, each input board present initializes its own version of the update timer driver+==== Example Applications in Python ==== 
 +The following section presents several example top-level DCS applicationsLike the utilitiesthese are based on Minimalmodbus.
  
-After these initializations the system runs board discovery routine. By using the presence of I2C EEPROM memory and testing the SPI configuration, all boards in the system are discovered and labeled as either CN0414 or CN0418. If the MODBUS interface is used, the system also scans for its MODBUS slave address and maps and initializes MODBUS registers.+=== Simple DCS control === 
 +This application provides simple way to control a DCS system and also to detect HART devices by using the HART protocol.
  
-After board discovery, if the CLI is usedno board is set as active and the system manager loads the main menu processIf the MODBUS is usedthe system activates the first board it discovers.+The HART protocol is proprietarycustomers implementing a full HART stack should refer to https://fieldcommgroup.org 
 +This reference design provides a basic implementation of "command zero" that can be used to verify connectivity with HART instruments. CN0267 is a Complete 4 mA to 20 mA Loop Powered Field Instrument with HART Interface that can be used to test the DCS HART functionality. 
 +This application allows to: 
 +  * detect sistem configuration; 
 +  * configure and read ADC channels; 
 +  * configure and write DAC channels; 
 +  * configure HART modems and send HART command zero.
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_initialization.png |}}+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:dcs_cn0435.zip |}}
  
-=== CLI Process ===+<xterm>
  
-If the CLI is used, no board is active after the initialization and the system stands by to receive commands. If the user sets one of the boards to be active, the program loads the commands and process specific to that board and starts sunning them until the application is stopped or the "exit" command is called.+Welcome! Use 'CTRL+C' to go back from the current menu or exit!
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_cli_process.png |}}+Available devices: 
 +-> Silicon Labs CP210x USB to UART Bridge (COM12) 
 +-> Intel(R) Active Management Technology - SOL (COM3)
  
-=== MODBUS Interface Process ===+Enter detected device index, or press ENTER to use COM12: 
 +Enter MODBUS timeout (0.05[s] to inf), or press ENTER to use 0.1[s] timeout:
  
-If the MODBUS interface is used the first board discovered is the active board. If it is a CN0414 the program runs its process until all channels are updated. If it is a CN0418 the program runs its process only once. After this the system deactivates the board and activates the next board discovered until all the boards have been active and updated. The system than cycles back from the beginning.+Boards found at MODBUS address: 1 
 +Address        Name                 Value 
 +-------------  -----------------  ------- 
 +0000 (0x0000)  Detected boards          2 
 +0001 (0x0001)  First board data         1 
 +0002 (0x0002)  Second board data        3 
 +0003 (0x0003)  Third board data     65535 
 +0004 (0x0004)  Fourth board data    65535 
 +analog output board at address: 00 
 +analog output board at address: 01
  
-Meanwhile the system scans the MODBUS channel for commands and if one is found that is addressed to this node it executes it and sends back a response.+Boards found at MODBUS address: 2 
 +Address        Name                 Value 
 +-------------  -----------------  ------- 
 +0000 (0x0000)  Detected boards          2 
 +0001 (0x0001)  First board data         4 
 +0002 (0x0002)  Second board data        6 
 +0003 (0x0003)  Third board data     65535 
 +0004 (0x0004)  Fourth board data    65535 
 +analog input board at address: 10 
 +analog input board at address: 11 
 +No boards at MODBUS address: 3 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 4 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 5 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 6 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 7 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 8 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 9 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 10 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 11 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 12 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 13 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 14 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 15 No communication with the instrument (no answer) 
 +No boards at MODBUS address: 16 No communication with the instrument (no answer)
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0435_modbus_process.png |}}+Enter MODBUS address from this list [1, 2], or press ENTER to use MODBUS address 1: 
 +Enter commands delay (0[s] to inf), or press ENTER to use 0.1[s] delay:
  
-=== Board Specific Processes ===+Use CTRL+C to end a process or switch between nodes. 
 +CN0414                                 CN0418                        CN0435 
 +-------------------------------------  ----------------------------  ---------------------------------------- 
 +1 - Read device voltage channel        e - Set DAC channel 1 output  o - Read common analog input registers 
 +2 - Read device current channel        f - Set DAC channel 2 output  p - Read common output holding registers 
 +3 - Read board voltage channels        g - Set DAC channel 3 output  r - Read analog input registers 
 +4 - Read board current channels        h - Set DAC channel 4 output  s - Read output holding registers 
 +5 - Read instrument voltage channels   i - Set DAC channel 1 range   t - Detect system configuration 
 +6 - Read instrument current channels   j - Set DAC channel 2 range 
 +7 - Set ADC output code                k - Set DAC channel 3 range 
 +8 - Set ADC filter                     l - Set DAC channel 4 range 
 +9 - Set ADC postfilter                 m - Send HART command zero 
 +a - Set ADC output data rate           n - Select HART channel 
 +b - Set ADC open wire detection state 
 +c - Send HART command zero 
 +d - Select HART channel                                              q - Quit
  
-The process and commands for each type of boards is described in the appropriate application page+Enter Option
-  * [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0414#project_structure|EVAL-CN0414-ARDZ]] +</xterm>
-  * [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0418#project_structure|EVAL-CN0418-ARDZ]]+
  
 // End of Document // // End of Document //
  
  
resources/eval/user-guides/eval-adicup3029/reference_designs/demo_plc_modbus.1558088293.txt.gz · Last modified: 17 May 2019 12:18 by Mihai Ionut Suciu