https://wiki.cannylogic.com/api.php?action=feedcontributions&user=CANNY&feedformat=atomCANNY Wiki - User contributions [en]2024-03-29T11:53:56ZUser contributionsMediaWiki 1.25.2https://wiki.cannylogic.com/index.php?title=CANNY_Lab_Main_window&diff=1906CANNY Lab Main window2022-07-15T08:06:29Z<p>CANNY: Undo revision 1905 by 5.188.210.20 (talk)</p>
<hr />
<div>CannyLab user interface consists of a single window - the main program window.<br />
<br />
=== Main window ===<br />
<br />
The main window is divided into several areas:<br />
* window title;<br />
* main menu;<br />
* toolbar;<br />
* function block panel;<br />
* workspace;<br />
* status bar.<br />
<br />
Depending on the current operating mode of the editor, some of CannyLab menu items and panels may not be available or hidden.<br />
<br />
[[File:4_4_1.png]]<br />
<br />
=== Main menu ===<br />
<br />
Menu "File" contains commands for working with CannyLab files.<br />
<br />
{|<br />
|- style="padding:0px;line-height:0.8;"<br />
|rowspan="9" valign="top" style="padding-top:15px;"|[[File:4_4_1_1.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- create a new function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- open an existing function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save the current function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save the current function diagram file under a new name;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save a screenshot of the function diagram in the PNG graphic format;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- view the current file properties;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- history of recently opened files (up to 5 records);''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- Exit.''<br />
|}<br />
<br />
<br />
Menu "Edit" contains the basic editing commands for working with the function diagram editor.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="12" valign="top" style="padding-top:10px;"|[[File:4_4_1_2.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- undo the last action when working with the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- redo the last action when working with the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- cut the selected part of the diagram to the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- copy the selected part of the diagram to the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- paste a part of the diagram currently contained in the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- delete the selected part of the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search next item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search previous item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search function block by its ordinal number;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- select of the entire diagram.''<br />
|}<br />
<br />
<br />
Menu "View" contains options for customizing the appearance of the toolbar, the function block panel, as well as an option for scaling the workspace.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="4" valign="top" style="padding-top:10px;"|[[File:4_4_1_13.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- scale the workspace by the contents of the diagram;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- toolbar appearance settings;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- function block panel appearance settings.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding:10px;"|[[File:4_4_1_3.png]]<br />
|valign="top" style="padding:10px;"|[[File:4_4_1_4.png]]<br />
|}<br />
<br />
<br />
Menu "Device" contains commands for working with the controller.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:10px;"|[[File:4_4_1_5.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- search and establish communication with the controller connected via USB;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- actions for uploading and erasing the controller system software;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- actions for uploading and erasing the function diagram;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- information about the connected controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- space reserved for use in future versions;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- end the communication session with the controller;''<br />
|}<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="2" valign="top" style="padding-top:10px;"|[[File:4_4_1_6.png]]<br />
|style="padding-top:10px;"| ''- upload firmware to the controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- erase controller firmware;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="2" valign="top" style="padding-top:10px;"|[[File:4_4_1_7.png]]<br />
|style="padding-top:10px;"| ''- upload the user's function diagram to the controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- erase the user's function diagram from the controller.''<br />
|}<br />
<br />
<br />
Menu "Simulation" contains controls for the controller software emulation mode in the CannyLab environment.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="10" valign="top" style="padding-top:5px;"|[[File:4_4_1_8.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable simulator mode;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable focus lock on the active function block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable pause mode that activates upon detecting any changes to the data;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- start / pause / resume diagram execution;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- execute the active function block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- execute the diagram up to the active block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- stop and reset the simulator to its initial state;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- bind simulation time-scale to windows system time;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- set the format for displaying values in the simulator mode;''<br />
|}<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="4" valign="top" style="padding-top:10px;"|[[File:4_4_1_9.png]]<br />
|style="padding-top:15px;"| ''- use the decimal number system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use the hexadecimal system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use the binary system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use character data mapping.''<br />
|}<br />
<br />
<br />
Menu "Service" contains service commands and CannyLab settings.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:5px;"|[[File:4_4_1_10.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- reorder function blocks numbers on the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change the boundaries of the workspace by the contents of the diagram;'<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- create a standalone firmware flash file;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- start CAN monitor;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change CannyLab settings;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change the interface language of CannyLab.''<br />
|}<br />
<br />
<br />
Menu "Help" provides links to this guide and information about the program.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:5px;"|[[File:4_4_1_11.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- view CannyLab version history;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- read END-USER LICENSE AGREEMENT file;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- open CannyLab reference guide;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- go to the online encyclopedia CANNY Wiki;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- check for CannyLab updates;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- get information about the current program version.''<br />
|}<br />
<br />
=== Toolbars ===<br />
<br />
Toolbars allow access to the most used commands in CannyLab.<br />
<br />
[[File:4_4_2_1.png]]<br />
<br />
Desktop Control Panel allows scaling the area of the workspace and changing its dimensions in pixels. To quickly zoom in/out, rotate the mouse wheel while holding down the «Ctrl» button on your keyboard.<br />
<br />
[[File:4_4_2_2.png]]&nbsp;&nbsp;&nbsp;[[File:4_4_2_2a.png]]<br />
<br />
=== Workspace ===<br />
<br />
The workspace is designed to display, edit, and debug function diagrams. The background of the workspace is a grid that facilitates positioning of function diagram elements. To move around the diagram displayed in the workspace, use the vertical and horizontal scroll bars, mouse wheel or arrow keys.<br />
<br />
[[File:4_4_3_1.png]]<br />
<br />
=== Status bar ===<br />
<br />
The status bar displays: the controller for which the current function diagram is designed, the status of communication with the controller, the presence of system software and function diagram in the connected controller. In the simulator mode the status bar displays information about controller resources used by the user diagram.<br />
<br />
[[File:4_4_4_1.png]]<br />
<br />
=== Function block panel ===<br />
<br />
Function block panel contains all block types available for constructing the function diagram. Function blocks in this panel are grouped by their purpose and, depending on display setting, may be presented as either icons or a list. Scroll the function block panel by using the vertical scroll bar or your mouse wheel.<br />
<br />
The two ways of displaying the function block panel:<br />
{|<br />
|[[File:4_4_5_1.png]]<br />
|&nbsp;<br />
|[[File:4_4_5_2.png]]<br />
|}<br />
<br />
=== Function block by ordinal number search dialog===<br />
<br />
Access the dialog for searching function blocks by their ordinal number by selecting "Edit" → "Find block" in the CannyLab main menu.<br />
<br />
[[File:4_4_6_1.png]]<br />
<br />
=== Text search dialog ===<br />
<br />
Access the dialog that allows searching by the specified text fragment by choosing "Edit" → "Find..." in the main menu of the program or by using the ''"Ctrl + F"'' key combination.<br />
<br />
[[File:4_4_6_2.png]]<br />
<br />
If you’ve already used text search in the current session, you can continue searching for the currently entered text fragment by choosing "Edit" → "Find next"/pressing “F3” to find the next occurrence or by choosing "Edit" → "Find previous"/pressing “Shift+F3” to find the previous occurrence.<br />
<br />
=== Settings dialog ===<br />
<br />
Access the CannyLab configuration dialog by selecting "Tools" → "Settings" in main menu.<br />
<br />
[[File:4_4_7_1.png]]<br />
<br />
{|<br />
|- valign="top"<br />
|width="300px"|Checking for updates -<br />
|Set how frequently the program checks for new software versions<br>[[File:4_4_7_2.png]]<br />
|- valign="top"<br />
|Selected Net colour -<br />
|Choose the colour of a selected connection line<br />
|- valign="top"<br />
|Associate CFD file type with CannyLab -<br />
|Associates function diagram file type with the current version of CannyLab<br />
|- valign="top"<br />
|Default diagram width -<br />
|The width of the diagram when creating a new file<br />
|- valign="top"<br />
||Default diagram hight -<br />
|The height of the diagram when creating a new file<br />
|- valign="top"<br />
|Default diagram scale -<br />
|The scale of diagram display area when creating a new file<br />
|- valign="top"<br />
|Automatic selection of scale when opening a file -<br />
|Enables fitting the diagram to screen automatically when opening an existing file.<br />
|- valign="top"<br />
|Port to connect device -<br />
|Choose a COM port for connecting devices that use the RS-232 interface for downloading the software (CANNY 5, CANNY 5 nano, CANNY 5.2, CANNY 5 duo, CANNY 5.2 duo)<br>[[File:4_4_7_3.png]]<br />
|}<br />
<br />
=== Keyboard shortcuts ===<br />
{|<br />
|- valign="top"<br />
|width="200px"|F1<br />
|Open Reference Manual;<br />
|- valign="top"<br />
|Ctrl+N<br />
|Create a new function diagram file;<br />
|- valign="top"<br />
|Ctrl+O<br />
|Open an existing diagram file;<br />
|- valign="top"<br />
|Ctrl+S<br />
|Save the function diagram file;<br />
|- valign="top"<br />
|Ctrl+A<br />
|Select all;<br />
|- valign="top"<br />
|Ctrl+Z<br />
|Undo the last action while working on the diagram;<br />
|- valign="top"<br />
|Ctrl+Y<br />
|Redo the last undone action while working on the diagram;<br />
|- valign="top"<br />
|Del<br />
|Delete selected diagram elements;<br />
|- valign="top"<br />
|Esc<br />
|Exit network editing mode;<br />
|- valign="top"<br />
|Left, Up, Right, Down<br />
|Shift workspace display area Left, Up, Right, Down;<br />
|- valign="top"<br />
|PageUp, PageDown<br />
|Shift workspace display area one page up, down;<br />
|- valign="top"<br />
|Ctrl + mouse wheel<br />
|Fast workspace zoom;<br />
|- valign="top"<br />
|Alt + mouse wheel<br />
|Horizontal scrolling within the workspace;<br />
|- valign="top"<br />
|Shift + mouse wheel<br />
|Fast vertical scrolling within the workspace;<br />
|- valign="top"<br />
|Hold mouse wheel + move the mouse<br />
|Move the diagram field within the workspace ("drag and drop").<br />
|- valign="top"<br />
|Double-click the left mouse button<br />
|In editor mode: on a network – open the rename network dialog; on a register – open the register editor dialog; on a constant – open the constant editor dialog with the last used option selected by default. In simulator mode: on a network – set/remove control point; on a function block – set/remove the breakpoint.<br />
|- valign="top"<br />
|Ctrl + double-click the left mouse button<br />
|In editor mode: on a constant – open the alternative constant editor dialog. In simulator mode: on a network – forcibly set the network value to "1"/remove the previously set value.<br />
|}</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_Lab_Main_window&diff=1904CANNY Lab Main window2022-07-11T14:41:39Z<p>CANNY: Undo revision 1903 by 46.161.11.4 (talk)</p>
<hr />
<div>CannyLab user interface consists of a single window - the main program window.<br />
<br />
=== Main window ===<br />
<br />
The main window is divided into several areas:<br />
* window title;<br />
* main menu;<br />
* toolbar;<br />
* function block panel;<br />
* workspace;<br />
* status bar.<br />
<br />
Depending on the current operating mode of the editor, some of CannyLab menu items and panels may not be available or hidden.<br />
<br />
[[File:4_4_1.png]]<br />
<br />
=== Main menu ===<br />
<br />
Menu "File" contains commands for working with CannyLab files.<br />
<br />
{|<br />
|- style="padding:0px;line-height:0.8;"<br />
|rowspan="9" valign="top" style="padding-top:15px;"|[[File:4_4_1_1.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- create a new function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- open an existing function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save the current function diagram file;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save the current function diagram file under a new name;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- save a screenshot of the function diagram in the PNG graphic format;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- view the current file properties;''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- history of recently opened files (up to 5 records);''<br />
|- style="padding:0px;line-height:0.8;"<br />
| ''- Exit.''<br />
|}<br />
<br />
<br />
Menu "Edit" contains the basic editing commands for working with the function diagram editor.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="12" valign="top" style="padding-top:10px;"|[[File:4_4_1_2.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- undo the last action when working with the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- redo the last action when working with the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- cut the selected part of the diagram to the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- copy the selected part of the diagram to the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- paste a part of the diagram currently contained in the clipboard;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- delete the selected part of the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search next item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search previous item by text;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- search function block by its ordinal number;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- select of the entire diagram.''<br />
|}<br />
<br />
<br />
Menu "View" contains options for customizing the appearance of the toolbar, the function block panel, as well as an option for scaling the workspace.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="4" valign="top" style="padding-top:10px;"|[[File:4_4_1_13.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- scale the workspace by the contents of the diagram;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- toolbar appearance settings;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- function block panel appearance settings.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding:10px;"|[[File:4_4_1_3.png]]<br />
|valign="top" style="padding:10px;"|[[File:4_4_1_4.png]]<br />
|}<br />
<br />
<br />
Menu "Device" contains commands for working with the controller.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:10px;"|[[File:4_4_1_5.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- search and establish communication with the controller connected via USB;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- actions for uploading and erasing the controller system software;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- actions for uploading and erasing the function diagram;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- information about the connected controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- space reserved for use in future versions;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- end the communication session with the controller;''<br />
|}<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="2" valign="top" style="padding-top:10px;"|[[File:4_4_1_6.png]]<br />
|style="padding-top:10px;"| ''- upload firmware to the controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- erase controller firmware;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="2" valign="top" style="padding-top:10px;"|[[File:4_4_1_7.png]]<br />
|style="padding-top:10px;"| ''- upload the user's function diagram to the controller;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- erase the user's function diagram from the controller.''<br />
|}<br />
<br />
<br />
Menu "Simulation" contains controls for the controller software emulation mode in the CannyLab environment.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="10" valign="top" style="padding-top:5px;"|[[File:4_4_1_8.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable simulator mode;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable focus lock on the active function block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- enable/disable pause mode that activates upon detecting any changes to the data;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- start / pause / resume diagram execution;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- execute the active function block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- execute the diagram up to the active block;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- stop and reset the simulator to its initial state;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- bind simulation time-scale to windows system time;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- set the format for displaying values in the simulator mode;''<br />
|}<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="4" valign="top" style="padding-top:10px;"|[[File:4_4_1_9.png]]<br />
|style="padding-top:15px;"| ''- use the decimal number system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use the hexadecimal system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use the binary system;''<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- use character data mapping.''<br />
|}<br />
<br />
<br />
Menu "Service" contains service commands and CannyLab settings.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:5px;"|[[File:4_4_1_10.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- reorder function blocks numbers on the diagram;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change the boundaries of the workspace by the contents of the diagram;'<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- create a standalone firmware flash file;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- start CAN monitor;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change CannyLab settings;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- change the interface language of CannyLab.''<br />
|}<br />
<br />
<br />
Menu "Help" provides links to this guide and information about the program.<br />
<br />
{|<br />
|- style="padding:0px;line-height: 0.8;"<br />
|rowspan="7" valign="top" style="padding-top:5px;"|[[File:4_4_1_11.png]]<br />
|&nbsp;<br />
|- style="padding:0px;line-height: 0.8;"<br />
| ''- view CannyLab version history;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- read END-USER LICENSE AGREEMENT file;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- open CannyLab reference guide;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- go to the online encyclopedia CANNY Wiki;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- check for CannyLab updates;''<br />
|- style="padding:0px;line-height: 0.6;"<br />
| ''- get information about the current program version.''<br />
|}<br />
<br />
=== Toolbars ===<br />
<br />
Toolbars allow access to the most used commands in CannyLab.<br />
<br />
[[File:4_4_2_1.png]]<br />
<br />
Desktop Control Panel allows scaling the area of the workspace and changing its dimensions in pixels. To quickly zoom in/out, rotate the mouse wheel while holding down the «Ctrl» button on your keyboard.<br />
<br />
[[File:4_4_2_2.png]]&nbsp;&nbsp;&nbsp;[[File:4_4_2_2a.png]]<br />
<br />
=== Workspace ===<br />
<br />
The workspace is designed to display, edit, and debug function diagrams. The background of the workspace is a grid that facilitates positioning of function diagram elements. To move around the diagram displayed in the workspace, use the vertical and horizontal scroll bars, mouse wheel or arrow keys.<br />
<br />
[[File:4_4_3_1.png]]<br />
<br />
=== Status bar ===<br />
<br />
The status bar displays: the controller for which the current function diagram is designed, the status of communication with the controller, the presence of system software and function diagram in the connected controller. In the simulator mode the status bar displays information about controller resources used by the user diagram.<br />
<br />
[[File:4_4_4_1.png]]<br />
<br />
=== Function block panel ===<br />
<br />
Function block panel contains all block types available for constructing the function diagram. Function blocks in this panel are grouped by their purpose and, depending on display setting, may be presented as either icons or a list. Scroll the function block panel by using the vertical scroll bar or your mouse wheel.<br />
<br />
The two ways of displaying the function block panel:<br />
{|<br />
|[[File:4_4_5_1.png]]<br />
|&nbsp;<br />
|[[File:4_4_5_2.png]]<br />
|}<br />
<br />
=== Function block by ordinal number search dialog===<br />
<br />
Access the dialog for searching function blocks by their ordinal number by selecting "Edit" → "Find block" in the CannyLab main menu.<br />
<br />
[[File:4_4_6_1.png]]<br />
<br />
=== Text search dialog ===<br />
<br />
Access the dialog that allows searching by the specified text fragment by choosing "Edit" → "Find..." in the main menu of the program or by using the ''"Ctrl + F"'' key combination.<br />
<br />
[[File:4_4_6_2.png]]<br />
<br />
If you’ve already used text search in the current session, you can continue searching for the currently entered text fragment by choosing "Edit" → "Find next"/pressing “F3” to find the next occurrence or by choosing "Edit" → "Find previous"/pressing “Shift+F3” to find the previous occurrence.<br />
<br />
=== Settings dialog ===<br />
<br />
Access the CannyLab configuration dialog by selecting "Tools" → "Settings" in main menu.<br />
<br />
[[File:4_4_7_1.png]]<br />
<br />
{|<br />
|- valign="top"<br />
|width="300px"|Checking for updates -<br />
|Set how frequently the program checks for new software versions<br>[[File:4_4_7_2.png]]<br />
|- valign="top"<br />
|Selected Net colour -<br />
|Choose the colour of a selected connection line<br />
|- valign="top"<br />
|Associate CFD file type with CannyLab -<br />
|Associates function diagram file type with the current version of CannyLab<br />
|- valign="top"<br />
|Default diagram width -<br />
|The width of the diagram when creating a new file<br />
|- valign="top"<br />
||Default diagram hight -<br />
|The height of the diagram when creating a new file<br />
|- valign="top"<br />
|Default diagram scale -<br />
|The scale of diagram display area when creating a new file<br />
|- valign="top"<br />
|Automatic selection of scale when opening a file -<br />
|Enables fitting the diagram to screen automatically when opening an existing file.<br />
|- valign="top"<br />
|Port to connect device -<br />
|Choose a COM port for connecting devices that use the RS-232 interface for downloading the software (CANNY 5, CANNY 5 nano, CANNY 5.2, CANNY 5 duo, CANNY 5.2 duo)<br>[[File:4_4_7_3.png]]<br />
|}<br />
<br />
=== Keyboard shortcuts ===<br />
{|<br />
|- valign="top"<br />
|width="200px"|F1<br />
|Open Reference Manual;<br />
|- valign="top"<br />
|Ctrl+N<br />
|Create a new function diagram file;<br />
|- valign="top"<br />
|Ctrl+O<br />
|Open an existing diagram file;<br />
|- valign="top"<br />
|Ctrl+S<br />
|Save the function diagram file;<br />
|- valign="top"<br />
|Ctrl+A<br />
|Select all;<br />
|- valign="top"<br />
|Ctrl+Z<br />
|Undo the last action while working on the diagram;<br />
|- valign="top"<br />
|Ctrl+Y<br />
|Redo the last undone action while working on the diagram;<br />
|- valign="top"<br />
|Del<br />
|Delete selected diagram elements;<br />
|- valign="top"<br />
|Esc<br />
|Exit network editing mode;<br />
|- valign="top"<br />
|Left, Up, Right, Down<br />
|Shift workspace display area Left, Up, Right, Down;<br />
|- valign="top"<br />
|PageUp, PageDown<br />
|Shift workspace display area one page up, down;<br />
|- valign="top"<br />
|Ctrl + mouse wheel<br />
|Fast workspace zoom;<br />
|- valign="top"<br />
|Alt + mouse wheel<br />
|Horizontal scrolling within the workspace;<br />
|- valign="top"<br />
|Shift + mouse wheel<br />
|Fast vertical scrolling within the workspace;<br />
|- valign="top"<br />
|Hold mouse wheel + move the mouse<br />
|Move the diagram field within the workspace ("drag and drop").<br />
|- valign="top"<br />
|Double-click the left mouse button<br />
|In editor mode: on a network – open the rename network dialog; on a register – open the register editor dialog; on a constant – open the constant editor dialog with the last used option selected by default. In simulator mode: on a network – set/remove control point; on a function block – set/remove the breakpoint.<br />
|- valign="top"<br />
|Ctrl + double-click the left mouse button<br />
|In editor mode: on a constant – open the alternative constant editor dialog. In simulator mode: on a network – forcibly set the network value to "1"/remove the previously set value.<br />
|}</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=1654Welcome to CANNY Wiki!2018-12-23T10:43:25Z<p>CANNY: /* Tips and Tricks */</p>
<hr />
<div>'''CANNY's original documentation was written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''We are intensively translating the documentation into English. You may track the work progress as displayed on the page below.'''<br />
<br />
'''For now and always we are keen to answer any of your questions [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
<span style="color:#fff00f">'''EN = Translated but need to check.'''</span> <br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#008000">'''EN'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#008000">'''EN'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#fff000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
::{|<br />
|-valign="top"<br />
|'''Constants and Registers'''<br />
*[[Constant]]<br />
*[[Copy]]<br />
*[[Input Register]]<br />
*[[Output Register]]<br />
| &nbsp;<br />
|'''Logical operators'''<br />
*[[Negation]]<br />
*[[Logical AND]]<br />
*[[Logical OR]]<br />
*[[Exclusive OR]]<br />
| &nbsp;<br />
|'''Bitwise operators'''<br />
*[[Bitwise AND]]<br />
*[[Bitwise OR]]<br />
*[[Bitwise exclusive OR]]<br />
*[[Bitwise Inversion]]<br />
*[[Left shift]]<br />
*[[Right shift]]<br />
*[[Left rotation]]<br />
*[[Right rotation]]<br />
|-valign="top"<br />
|'''Relational operators'''<br />
*[[Equal to]]<br />
*[[Greater than]]<br />
*[[Not greater than]]<br />
*[[Less than]]<br />
*[[Not less than]]<br />
| &nbsp;<br />
|'''Arithmetic operations'''<br />
*[[Addition]]<br />
*[[Subtraction]]<br />
*[[Multiplication]]<br />
*[[Division]]<br />
| &nbsp;<br />
|'''Flip-flops / Latches'''<br />
*[[SR latch]]<br />
*[[RS latch]]<br />
*[[D flip-flop]]<br />
*[[T flip-flop]]<br />
*[[JK flip-flop]]<br />
*[[Buffer]]<br />
|-valign="top"<br />
|'''Timers and Generators'''<br />
*[[Delayed turning ON]]<br />
*[[Delayed turning OFF]]<br />
*[[PWM Generator]]<br />
*[[RND Generator]]<br />
| &nbsp;<br />
|'''Counters and Edge Detectors'''<br />
*[[Counter]]<br />
*[[Rising edge detector]]<br />
*[[Falling edge detector]]<br />
| &nbsp;<br />
|'''Converters'''<br />
*[[Converter 8-to-1]]<br />
*[[Converter 16-to-1]]<br />
*[[Converter 1-to-8]]<br />
*[[Converter 1-to-16]]<br />
*[[ASCII to Integer]]<br />
*[[Integer to ASCII]]<br />
*[[Map]]<br />
|-valign="top"<br />
|'''Switches'''<br />
*[[Switch 2-to-1]]<br />
*[[Switch 8-to-1]]<br />
*[[Switch 16-to-1]]<br />
*[[Switch 1-to-2]]<br />
*[[Switch 1-to-8]]<br />
*[[Switch 1-to-16]]<br />
| &nbsp;<br />
|'''Decoration'''<br />
*[[Label]]<br />
| &nbsp;<br />
|<br />
|}<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands<br />
<br />
=== Automotive Programmable Logic Controller CANNY 5.2 duo ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo]] - Main article<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Driver | CAN Interface]] - Configuring and using built-in CAN-Interfaces<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Gateway Driver | CAN Gateway Driver]] - Configuring and using built-in CAN-Interfaces in asynchronous CAN Gateway mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, UART Driver| UART Driver]] - Using controller with serial data asynchronous interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, ADC Driver | Analog-to-digital converter (ADC)]] - Configuration and operation with the controller in analog-to-digital converter mode<br />
<br />
=== CANNY CAN(LIN) monitor (ccm.exe) ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY CAN(LIN) monitor]] - Main article<br />
<br />
=== Tips and Tricks ===<br />
<br />
* <span style="color:#fff000">'''EN'''</span> [[T-n-T: Logical AND with multiple operands]] - An alternative implementation of the logical operation for several operands. <br />
* <span style="color:#fff000">'''EN'''</span> [[T-n-T: Logical OR with multiple operands]] - An alternative implementation of the logical operation for several operands. <br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Каскадирование коммутаторов]] - Подготовка / создание списка данных длиной более 16<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Присвоение константы по условию]] - Присвоение константы по условию с приоритетом, используя каскад из коммутаторов 2-в-1<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Детектор изменения значения]] - Определение факта и величины изменения значения<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Отрицательные числа]] - Работа с отрицательными числами: выделение модуля и знака числа и обратное преобразование<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Продвинутый счетчик]] - Альтернативный способ организации Счетчика<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Борьба с переполнением регистра]] - Подсчет интервалов времени, длительностью более 65535мс<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Часы]] - Подсчет интервалов времени с использованием системного регистра длительности программного цикла<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Защита от дребезга]] - Определение получения сигнала на входе контроллера с защитой от ложных срабатываний (дребезга)<br />
* <span style="color:#ff0000">'''RU'''</span> [[T-n-T: Верификация ID устройства]] - Проверка идентификационного номера контроллера, защита пользовательской диаграммы от несанкционированного использования</div>CANNYhttps://wiki.cannylogic.com/index.php?title=T-n-T:_Logical_OR_with_multiple_operands&diff=1653T-n-T: Logical OR with multiple operands2018-12-23T10:43:04Z<p>CANNY: CANNY moved page T-n-T: Полиадическое Логическое ИЛИ to T-n-T: Logical OR with multiple operands without leaving a redirect</p>
<hr />
<div>[[Category:Tips and Tricks|12.02]]<br />
== The problem ==<br />
<br />
Implement "Logical OR" operation with eight operands.<br />
<br />
== Obvious solution ==<br />
<br />
[[File:example2.png|800px]]<br />
<br />
== Alternative solution ==<br />
<br />
[[File:example2a.png|600px]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=T-n-T:_Logical_AND_with_multiple_operands&diff=1652T-n-T: Logical AND with multiple operands2018-12-23T10:37:27Z<p>CANNY: CANNY moved page T-n-T: Полиадическое Логическое И to T-n-T: Logical AND with multiple operands without leaving a redirect</p>
<hr />
<div>[[Category:Tips and Tricks|12.02]]<br />
== The problem ==<br />
<br />
Implement "Logical AND" operation with eight operands.<br />
<br />
== Obvious solution ==<br />
<br />
[[File:example2.png|800px]]<br />
<br />
== Alternative solution ==<br />
<br />
[[File:example2a.png|600px]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=T-n-T:_Logical_AND_with_multiple_operands&diff=1651T-n-T: Logical AND with multiple operands2018-12-23T10:30:57Z<p>CANNY: </p>
<hr />
<div>[[Category:Tips and Tricks|12.02]]<br />
== The problem ==<br />
<br />
Implement "Logical AND" operation with eight operands.<br />
<br />
== Obvious solution ==<br />
<br />
[[File:example2.png|800px]]<br />
<br />
== Alternative solution ==<br />
<br />
[[File:example2a.png|600px]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=T-n-T:_Logical_OR_with_multiple_operands&diff=1650T-n-T: Logical OR with multiple operands2018-12-23T10:30:49Z<p>CANNY: </p>
<hr />
<div>[[Category:Tips and Tricks|12.02]]<br />
== The problem ==<br />
<br />
Implement "Logical OR" operation with eight operands.<br />
<br />
== Obvious solution ==<br />
<br />
[[File:example2.png|800px]]<br />
<br />
== Alternative solution ==<br />
<br />
[[File:example2a.png|600px]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=T-n-T:_Logical_AND_with_multiple_operands&diff=1649T-n-T: Logical AND with multiple operands2018-12-23T10:28:46Z<p>CANNY: </p>
<hr />
<div>[[Category:Tips and Tricks|12.02]]<br />
== The problem ==<br />
<br />
Implement "Logical OR" operation with eight operands.<br />
<br />
== Obvious solution ==<br />
<br />
[[File:example2.png|800px]]<br />
<br />
== Alternative solution ==<br />
<br />
[[File:example2a.png|600px]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=File:14_8_2_1.png&diff=1648File:14 8 2 1.png2018-12-23T10:18:02Z<p>CANNY: CANNY uploaded a new version of File:14 8 2 1.png</p>
<hr />
<div></div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=1609Welcome to CANNY Wiki!2018-12-14T11:40:41Z<p>CANNY: /* Automotive Programmable Logic Controller CANNY 5.2 duo */</p>
<hr />
<div>'''CANNY's original documentation was written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''We are intensively translating the documentation into English. You may track the work progress as displayed on the page below.'''<br />
<br />
'''For now and always we are keen to answer any of your questions [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
<span style="color:#fff00f">'''EN = Translated but need to check.'''</span> <br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#008000">'''EN'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#008000">'''EN'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#fff000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
::{|<br />
|-valign="top"<br />
|'''Constants and Registers'''<br />
*[[Constant]]<br />
*[[Copy]]<br />
*[[Input Register]]<br />
*[[Output Register]]<br />
| &nbsp;<br />
|'''Logical operators'''<br />
*[[Negation]]<br />
*[[Logical AND]]<br />
*[[Logical OR]]<br />
*[[Exclusive OR]]<br />
| &nbsp;<br />
|'''Bitwise operators'''<br />
*[[Bitwise AND]]<br />
*[[Bitwise OR]]<br />
*[[Bitwise exclusive OR]]<br />
*[[Bitwise Inversion]]<br />
*[[Left shift]]<br />
*[[Right shift]]<br />
*[[Left rotation]]<br />
*[[Right rotation]]<br />
|-valign="top"<br />
|'''Relational operators'''<br />
*[[Equal to]]<br />
*[[Greater than]]<br />
*[[Not greater than]]<br />
*[[Less than]]<br />
*[[Not less than]]<br />
| &nbsp;<br />
|'''Arithmetic operations'''<br />
*[[Addition]]<br />
*[[Subtraction]]<br />
*[[Multiplication]]<br />
*[[Division]]<br />
| &nbsp;<br />
|'''Flip-flops / Latches'''<br />
*[[SR latch]]<br />
*[[RS latch]]<br />
*[[D flip-flop]]<br />
*[[T flip-flop]]<br />
*[[JK flip-flop]]<br />
*[[Buffer]]<br />
|-valign="top"<br />
|'''Timers and Generators'''<br />
*[[Delayed turning ON]]<br />
*[[Delayed turning OFF]]<br />
*[[PWM Generator]]<br />
*[[RND Generator]]<br />
| &nbsp;<br />
|'''Counters and Edge Detectors'''<br />
*[[Counter]]<br />
*[[Rising edge detector]]<br />
*[[Falling edge detector]]<br />
| &nbsp;<br />
|'''Converters'''<br />
*[[Converter 8-to-1]]<br />
*[[Converter 16-to-1]]<br />
*[[Converter 1-to-8]]<br />
*[[Converter 1-to-16]]<br />
*[[ASCII to Integer]]<br />
*[[Integer to ASCII]]<br />
*[[Map]]<br />
|-valign="top"<br />
|'''Switches'''<br />
*[[Switch 2-to-1]]<br />
*[[Switch 8-to-1]]<br />
*[[Switch 16-to-1]]<br />
*[[Switch 1-to-2]]<br />
*[[Switch 1-to-8]]<br />
*[[Switch 1-to-16]]<br />
| &nbsp;<br />
|'''Decoration'''<br />
*[[Label]]<br />
| &nbsp;<br />
|<br />
|}<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands<br />
<br />
=== Automotive Programmable Logic Controller CANNY 5.2 duo ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo]] - Main article<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Driver | CAN Interface]] - Configuring and using built-in CAN-Interfaces<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Gateway Driver | CAN Gateway Driver]] - Configuring and using built-in CAN-Interfaces in asynchronous CAN Gateway mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, UART Driver| UART Driver]] - Using controller with serial data asynchronous interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, ADC Driver | Analog-to-digital converter (ADC)]] - Configuration and operation with the controller in analog-to-digital converter mode<br />
<br />
=== CANNY CAN(LIN) monitor (ccm.exe) ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY CAN(LIN) monitor]] - Main article</div>CANNYhttps://wiki.cannylogic.com/index.php?title=File:14_12_2_1.png&diff=1608File:14 12 2 1.png2018-12-14T11:34:09Z<p>CANNY: CANNY uploaded a new version of File:14 12 2 1.png</p>
<hr />
<div></div>CANNYhttps://wiki.cannylogic.com/index.php?title=File:14_2_1_3.png&diff=1602File:14 2 1 3.png2018-12-10T15:52:54Z<p>CANNY: CANNY uploaded a new version of File:14 2 1 3.png</p>
<hr />
<div></div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_LIN_Driver&diff=1585CANNY 7, LIN Driver2018-11-15T21:17:59Z<p>CANNY: Reverted edits by 185.255.96.99 (talk) to last revision by CANNY</p>
<hr />
<div>=== General description ===<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== Driver registers ===<br />
<br />
The following describes the acceptable LIN driver operation control registers values.<br />
<br />
LIN driver configuration Registers allows to set up the controller as a LIN bus node:<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Mode Setup Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Mode Setup Register <br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|setup a LIN driver channel configuration, determines the current operation mode and parameters (determined by special constant from the constants directory);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|disconnect the channel from the LIN driver, return channel control to input-output channels driver and allow its status changes from the functional diagram.<br />
|}<br />
|}<br />
<br />
Channel configuration for operation in this mode is determined by a constant, which is a combination of parameters: protocol version , baud rate, operation mode and the availability of internal channel pull-up.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Parameter<br />
!The list of acceptable values<br />
|- valign="top"<br />
|LIN protocol version<br />
|1.3; 2.0<br />
|- valign="top"<br />
|baud rate<br />
|2400; 9600; 19200<br />
|- valign="top"<br />
|Operation mode<br />
|MASTER; SLAVE<br />
|- valign="top"<br />
|Pull-up<br />
|[[plus]]; [[float]]<br />
|}<br />
<br />
Named constants that represent LIN configuration parameters combination, available to the user in the "LIN Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.<br />
<br />
LIN driver diagnostic registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Overflow Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Overflow Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN buffer is full;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN no buffer overflow detected.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Error Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Error Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|during LIN data reception an error occurred;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the driver is operating normally.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Ready to Send Register <br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Ready to Send Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN data transmit buffer is free and ready;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|LIN driver data transmission buffer is busy.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Data Delivered Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Data Delivered Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|in SLAVE mode, successful data transfer indication from the buffer of corresponding channel LIN, in response to MASTER node request;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|when the corresponding LIN channel is in a SLAVE mode, there were no MASTER node request received.<br />
|}<br />
|}<br />
<br />
LIN Receive Registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Data Set Ready Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Data Set Ready Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the message is received and placed into corresponding LIN channel receive buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|in the corresponding LIN channel receive buffer no actual data present.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Idle Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Idle Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|no activity on the corresponding channel LIN drivers, the line is in a passive mode;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|fixed activity on the line of corresponding LIN driver channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register LEN<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register LEN<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...8<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|a value, equal to the number of data bytes in the packet received via respective LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register ID<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register ID<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...63<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|message ID, obtained via respective channel LIN . (See note.)<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register b7:b6<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register b7:b6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|respective data byte values, LIN reception buffers of each channel by two bytes to the register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''LIN Received Data Register ID displays only the lower 6 bits of the identifier: 4-bit address of the device and the 2- bits used in the LIN 1.1 to encode the message length, and later to expand the address. 10 higher bits of LIN received message ID register always zero.''<br />
|}<br />
<br />
LIN transmit registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Request to Send Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Request to Send Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|to load data from the transfer registers in the respective channel LIN transmit buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|do not load data to the respective channel LIN transmit buffer.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register LEN<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register LEN<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...8<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"the number of data bytes that will be transmitted to the line when receiving a command to send on the corresponding LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register ID<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register ID<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...63<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|LIN ID value for message transmission via respective LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register b7:b6<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register b7:b6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|data byte values to transmit on respective LIN channel by two bytes to the register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When sending LIN-messages, the driver discards all but the lower 6 bits of LIN ID register, automatically generates two parity bits and complements them ID, according to requirements of the standard.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When working with LIN networks versions below 1.3, be careful in the formation of outgoing messages. The driver allows the use of combinations of length and identifier transmitting message unacceptable in this standard.''<br />
|}<br />
<br />
=== Canny7 in MASTER mode ===<br />
<br />
To switch LIN driver channel in to MASTER mode, it is necessary to copy the constant value corresponding to the selected mode in to appropriate driver channel address: "LINx mode setup register».<br />
<br />
For MASTER to receive data from SLAVE-node, need to send corresponding request to LIN bus: Send the message header contains the identifier of the slave node from which the data is requested. The length of transmission message LEN LEN must be set to zero, in to transmission start register to be recorded non-zero value. Upon receipt of response from the slave, the data will be placed in receive register of the corresponding LIN driver channel with simultaneous setting mark in LINx Data Set Ready Register data availability.<br />
<br />
An example of a functional diagram for MASTER data reception from SLAVE-node. MASTER every 100ms sends the data request from the slave with the identifier 0x02. After receiving a response, the controller stores the first 2 bytes of data in the D-flip-flop.<br />
<br />
[[File:6_10_4_1.png|center|950px]]<br />
<br />
For data transmission in MASTER mode, the ID and Data registers must be filled, while setting transmission LIN LEN Register, a value equal to the number of transmitting data bytes, which must be greater than zero but less than nine. Instruction for LIN driver to send messages obtained by setting a non-zero value in the "LINx Request To Send Register". As a result, the contents of the registers is copied into the transmit buffer LIN, if it is free, the driver will immediately proceed to send a message.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''To prevent data loss, before sending a new LIN message, it is recommended to ensure readiness to the transfer of the next message from corresponding LIN channel transmit buffer, by checking the LINx Ready To Send Register.''<br />
|}<br />
<br />
Example of functional diagram, sending data to the LIN bus by MASTER.<br />
MASTER every 100ms sends a message to the bus with the identifier 0x01 that contains 2 bytes of data (0h0A and 0x55).<br />
<br />
[[File:6_10_4_2.png|center|800px]]<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''If LINx Request To Send Register permanently set a non-zero value, then the attempt to copy the data to the transmission buffer for sending LIN messages will be taken at each diagram execution cycle. To avoid overflow of LIN transmission buffer, triggers the start of data transmission by single pulse using, for example, front detector functional blocks.''<br />
|}<br />
<br />
=== Canny7 in SLAVE mode ===<br />
<br />
Operating SLAVE mode, LIN node successfully receives any data transmitted over the network, but can not transmit data to the LIN itself, without not having received the request from MASTER.<br />
<br />
To switch LIN driver channel in to SLAVE mode, it is necessary to copy the constant value corresponding to the selected mode in to appropriate driver channel address: "LINx mode setup register».<br />
<br />
To ensure successful data sending for node in SLAVE mode on MASTER-node request ,It must advance without waiting for a request, to prepare the data for transmission. This requires to fill in all the necessary LINx Transmit Data Register, namely: LIN ID register, message length register LIN LEN and place sending information in LIN data register.<br />
Permission to send is given by setting a value "1" to "LINx Request To Send Register", whereby the contents of data registers is copied into LIN transmit buffer, if it is free. Sending of data, once placed in the buffer will be automatically performing by LIN driver, with each request from the MASTER.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''If LINx Request To Send Register permanently set a non-zero value, then the attempt to copy the data to the transmission buffer for sending LIN messages will be taken at each diagram execution cycle. To avoid overflow of LIN transmission buffer, triggers the start of data transmission by single pulse using, for example, front detector functional blocks.''<br />
|}<br />
<br />
Monitor a request reception from the MASTER and successful automatic response to it by LIN driver in SLAVE mode possible by the appearance of the value "1" in LINx Data Delivered Register. Update data in the buffer transmission is possible after its release. Status of the send buffer can be tracked by the value of the corresponding register.<br />
<br />
An example of a functional diagram for data transmission by LIN node in SLAVE mode.<br />
<br />
[[File:6_10_5_1.png|center|600px]]<br />
<br />
An example of a functional diagram SLAVE receiving data from the MASTER. Controller, receiving message with the identifier 0x01 that contains any data, stores the first two bytes of data message in the D-flip-flop.<br />
<br />
[[File:6_10_5_2.png|center]]<br />
<br />
=== Energy saving mode (low power consumption mode) ===<br />
<br />
To save energy, LIN specification provides the ability to switch all LIN network nodes in low energy consumption mode. Most often, such a transition is initiated by master node by sending an appropriate message to the bus,or slave nodes switch by their own, when there is no activity on the bus for a specified time interval. Exit sleep mode can be initiated by any node on the bus. MASTER-node initiates LIN bus awakening by normal query slaves. However, waking up initiated by SLAVE-node is carried by short installation of GND potential on the line.<br />
<br />
In the LIN driver of controller Canny 7, to wake the BUS, MASTER-node just need to start transmitting data or query slaves. SLAVE-nodes sends a request to awake the BUS by passing a message with any identifier, but have zero length, i.e. "LINx Transmit Data Register LEN» = 0.<br />
<br />
== See also ==<br />
[[CANNY 7]]<br />
<br />
[[CANNY 7, UART Driver]]<br />
<br />
[[CANNY 7, CAN Driver]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_CAN_Driver&diff=1582CANNY 7, CAN Driver2018-08-09T12:19:05Z<p>CANNY: /* Driver's registers */</p>
<hr />
<div>== General Description ==<br />
<br />
Two dedicated external outputs of CANNY 7 controller, located on the 4-pin connector: CAN-H and CAN-L, provided for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
== Driver's registers ==<br />
<br />
Below is a description of valid values for registers controlling CAN-bus driver operation.<br />
<br />
CAN driver configuration registers allows to set the parameters of the controller as a CAN bus node:<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"| CAN Mode Setup Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...N<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|driver activation and CAN-messages transmit/receive speed setting (defined by a special constant of constants directory);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|driver disabled.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDL 0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDL 15<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set filter value for lower part of CAN-message identifier(bits 0...10 identifier standard format or bits 0...15 expanded identifier format);<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDH 0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Acceptance Filter Identifier Register IDH 15<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set filter value for higher part of CAN-message identifier (bits 16...28 expanded identifier format);<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Listen Only Mode Enable Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN messages passive reception mode enabled (listen only);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN messages reception and transmission mode enabled (normal);<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Acceptance Filter Enable Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN received messages filtering mode enabled;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN received messages filtering mode disabled;<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmitting Cancel On Error Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN transmitting cancel on error is enabled;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN transmitting cancel on error is disabled.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In passive receiving CAN messages mode (listen only), unlike normal CAN mode, the driver operates to receive data from CAN-bus, but does not send a confirmation of reception and does not puts network in an error state when it detects such. Thus, the controller remains invisible to the other devices on the bus, does not prove itself. For normal network operation, there must be present at least two devices operating in the normal mode.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When filter mode enabled the CAN driver will accept only those messages whose identifiers match values in CAN message receive filter installation registers, ignoring all others.''<br />
|}<br />
<br />
CAN driver configuration is defined by a constant predetermined data transmission/reception speed.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"| Parameter<br />
!A list of acceptable values<br />
|- valign="top"<br />
|Data transmission/reception speed, Kbit/s<br />
|10; 33; 50; 83; 95.2; 100; 125; 250; 500; 1000<br />
|}<br />
<br />
Named constants that represent CAN configuration parameters combination, available to the user in the "CAN Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.<br />
<br />
CAN driver diagnostics registers allows the user to determine the status of the driver in one or another moment of a diagram execution.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Returning Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Idle Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN driver activity is absent, the bus is idle, the data reception is not performed;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN activity registered.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Overflow Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|error, CAN buffer is full;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|no overflow of the receive buffer.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Error Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN reception error rate exceeds a threshold;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN reception error rate below an acceptable threshold.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Ready To Send Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN driver data transmit buffer is empty and ready to send new messages;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN driver data transmit buffer is not ready.<br />
|}<br />
|}<br />
<br />
CAN driver receiving registers allows access to the values obtained on the bus.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Data Set Ready Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|CAN driver receive buffer has received message, this value appears in the register for one cycle of diagram execution, stating the relevance of data stored in the receive buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|there is no data in the CAN driver receive buffer.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Received Data Register IDL<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the lower part of the identifier received CAN-message.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Received Data Register IDH<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the higher part of the identifier received CAN-message.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Received Data Register ERL<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...'''0xXX'''08<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|a value equal to the number of bytes of data in the received message, where '''0хXX''' is: 0x00 (for standard format), 0x40 (for standard format with RTR), 0x80 (for extended format) or 0xC0 (for extended format with RTR). For more information, see note.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Received Data Register D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Received Data Register D7:D6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|values of the corresponding data bytes received in CAN message, two bytes per register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''CAN Received Data Register ERL, in addition to the number of bytes in the received message 0 ... 8 least significant bits, contains in its most significant bits information about special message attributes: bit 15 - EXT flag & bit 14 - RTR flag. Where EXT = 1, when receive a message in the extended format, EXT = 0 for a standard message format; RTR = 1 when receiving remote data request, RTR = 0 when receiving normal message.''<br />
|}<br />
<br />
CAN transmit registers are used to accommodate data in the transmission buffer to be sent.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Request To Send Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|load data from the transfer registers in to CAN driver send buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|do not load data to CAN driver transmission buffer.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmit Data Register IDL<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the lower part of the identifier transmitting CAN-message.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmit Data Register IDH<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the higher part of the identifier transmitting CAN-message.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmit Data Register ERL<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...'''0xXX'''08<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value equal to the number of bytes of data in the transmitted message, where '''0хXX''' is: 0x00 (for standard format), 0x40 (for standard format with RTR), 0x80 (for extended format) or 0xC0 (for extended format with RTR). For more information, see note.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmit Data Register D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN Transmit Data Register D7:D6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|<br />
|style="padding-left:0.5em;"|values of the corresponding data byte of transmitting CAN message, two bytes per register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''CAN Transmit Data Register ERL, in addition to the number of bytes in the transmitting message 0 ... 8 least significant bits, contains in its most significant bits information about special message attributes: bit 15 - EXT flag & bit 14 - RTR flag. Where EXT = 1, when transmitting a message in the extended format, EXT = 0 for a standard message format; RTR = 1 when transmitting remote data request, RTR = 0 when receiving normal message.''<br />
|}<br />
<br />
== Examples of message transmitting ==<br />
<br />
An example of a functional diagram of the data sent to the CAN bus. Performing diagram the controller once every 100 ms, transmits to the bus at a speed of 125 kbps, the data about the state of its three inputs, using a standard format message with the identifier 0x123, contains a single byte of data.<br />
<br />
[[File:6_9_2_1.png]]<br />
<br />
An example of a functional diagram for sending a CAN message with a standard identifier is '''0x001: 0xDE 0xAD 0xBE 0xEF 0x12 0x34 0x56 0x78''' by the appearance of a signal on the channel #8 of the controller.<br />
<br />
[[File:6_9_2_4.png|500px]]<br />
<br />
An example of a functional diagram for sending a CAN message with the extended identifier is "0x1f110001: 0xDE 0xAD 0xBE 0xEF 0x12 0x34 0x56 0x78" by the appearance of a signal on the channel #8 of the controller.<br />
<br />
Differences in sending an extended message from sending a standard one: set bit 15 of the register '''[CAN Transmit Data Register ERL]''', the leading part of the identifier should be written to the register '''[CAN Transmit Data Register IDH]'''.<br />
<br />
[[File:6_9_2_5.png|500px]]<br />
<br />
Example of a functional diagram for sending a CAN message with the standard identifier "0x001: 0xDE 0xAD 0xBE 0xEF 0x12 0x34 0x56 0x78" by the appearance of a signal on the channel #8 of the controller, and sending a message with the same ID, but with zero data when the signal on the channel #8 of the controller is disappears.<br />
<br />
[[File:6_9_2_6.png|700px]]<br />
<br />
An example of sending several CAN messages periodically.<br />
<br />
[[File:6_9_2_7.png|800px]]<br />
<br />
== Examples of message reciving ==<br />
<br />
An example of a functional diagram of the data receive from the CAN bus. Performing the diagram controller, receiving message from the bus in standard format with ID 0x0123, containing one byte of data, sets on three of its outputs, states in accordance with received value.<br />
<br />
[[File:6_9_2_2.png]]<br />
<br />
An example of a functional diagram of the data receive from the CAN bus. Performing the diagram controller, receiving message on the bus in standard format with an ID 0x01F3, analyzes contained in one of the message bytes a value and sets on its outputs and built-in LED corresponding states. <br />
<br />
[[File:6_9_2_3.png]]<br />
<br />
== See also ==<br />
[[CANNY 7]]<br />
<br />
[[CANNY 7, LIN Driver]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_5.2_duo,_CAN_Gateway_Driver&diff=1571CANNY 5.2 duo, CAN Gateway Driver2018-05-22T12:02:15Z<p>CANNY: /* General Description */</p>
<hr />
<div>== General Description ==<br />
<br />
Using the CAN gateway driver you can to implement the high-speed asynchronous relaying of messages between the CAN hardware interfaces with optional filtering and altering particular CAN messages.<br />
<br />
The CAN gateway driver allows you to realize individual processing of incoming CAN messages by configuring up to eight selection rules (selectors).<br />
<br />
Each rule (selector) allows you to select CAN messages by the combination of following user-defined properties values:<br />
* CAN interface number via which the message was coming to the controller;<br />
* CAN ID of incoming message (CAN gateway selector value).<br />
<br />
When some incoming CAN message hit the selector, the CAN gateway driver perform one of the following user-defined actions:<br />
* relay the message to another CAN interface of the controller "as is", without any changes;<br />
* modify the message, and then relay the modified message to another CAN interface of the controller;<br />
* discard the message.<br />
<br />
In case of the message modification it is performed by replacing using a bitmask any bits of the original message. You can change any CAN-message field including ID, length and bits of data.<br />
<br />
For all incoming CAN message that are not hit in any selector, you can assign one of the following actions:<br />
* relay the message to another CAN interface of the controller "as is", without any changes;<br />
* discard the message.<br />
<br />
To use the CAN gateway driver, it is necessary to specify the possible different configurations for both CAN-interfaces of the controller.<br />
<br />
When the CAN gateway driver is enabled, the diagram still can use the registers of the CAN0 Driver and the CAN1 Driver for:<br />
* sending any CAN messages through any of the CAN interfaces;<br />
* receive CAN messages, but only those that are hit some CAN gateway driver selector, regardless of what happens with the CAN message after its selection.<br />
<br />
Moreover, you can change CAN gateway driver configuration during operation. So you can organize some sort of the dynamic mode for your CAN gateway.<br />
<br />
== Driver's registers ==<br />
<br />
Below is a description of the permissible values of the CAN gate driver control registers, which allow setting the controller operation parameters for high-speed asynchronous relaying of messages between the CAN hardware interfaces.<br />
<br />
Common registers of the CAN gateway driver.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway driver enable register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Enable the CAN gateway driver;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Disable the CAN gateway driver.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway configuration register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Apply the new settings of the CAN gateway driver (see note);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Do not update the settings of the CAN gateway driver.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway filter enable for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|switch on the filtering mode of the CAN gateway for the corresponding interface: relay to the second CAN interface of the controller and transmit only CAN messages that are accepted by the gateway selections, the remaining messages are discarded;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the filtering mode of the CAN gateway for the corresponding interface is disabled: it automatically retransmits messages that have not entered the gateway selections to the second CAN-interface of the controller in unchanged form.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway logging mode enable for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|enable the CAN gateway logging mode for the corresponding interface: transmit to the function chart (in the CAN driver) all CAN messages received on this interface. The gateway driver will select, replace and relay CAN messages according to the corresponding gateway settings of the specified CAN interface;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|disable the CAN gateway logging mode for the corresponding interface: only CAN messages that are included in the gateway's selections are transmitted to the diagram (in the CAN driver), the remaining messages are discarded.<br />
|}<br />
|}<br />
<br />
<br />
CAN gateway configuration registers.<br />
<br />
Common CAN gateway driver selection registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Registers<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X enable register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|enable the appropriate selection of the CAN gateway;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the corresponding CAN gateway selection is disabled.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X linked CAN interface number register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN0 interface;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN1 interface.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway excluding mode register for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|discard all messages which match an enabled selection;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|allow processing and automatic retransmission to another CAN interface of all messages which match an enabled selection.<br />
|}<br />
|}<br />
<br />
<br />
CAN gateway selection registers.<br />
<br />
'''''The value of the selection''''' - is a parameter which, when satisfied, selects an incoming CAN message for special processing.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X value, IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the lower part of the identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the CAN message the selection will accept.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X value, IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the highest part of the identifier (bits 16 ... 28 of the extended format identifier) of the CAN message the selection will accept.<br />
|}<br />
|}<br />
<br />
<br />
The registers of the gateway driver selection masks.<br />
<br />
'''''The selection masks''''' - is a group of values whose bits define the bitwise modifications to be made when the gateway retransmits a part of the message that has been accepted by the appropriate selection. If the value of the mask bit is "0", the corresponding bit of the received message will be relayed to the other interface without changes. If the value of the mask bit is "1", the corresponding bit of the received message will be replaced by a corresponding bit from the value of the ''Substitution Substitution''<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the mask of the lower part of the CAN message identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the mask value of the upper part of the CAN message identifier (bits 16 ... 28 of the extended format identifier) of the appropriate selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, ERL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Set the mask value of the ERL register of the CAN message of the appropriate selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, CAN D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, CAN D7:D6<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the mask for the corresponding byte of data of the CAN message of the corresponding selection.<br />
|}<br />
|}<br />
<br />
<br />
Registers for replacing the selections of the CAN gateway driver.<br />
<br />
'''''Replacement of selection''''' - is a group of values whose bits replace the original bits in the retransmitted message that has fallen into the appropriate selection. If the value of the replacement bit is "0", the corresponding bit of the relayed message will be replaced by zero, with the replacement bit value equal to "1", the corresponding bit of the relayed message will be replaced by one. '''The replacement will only be applied to those bits whose selection mask value is "1".'''<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the replacement of the lower part of the CAN message identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the replacement of the highest part of the CAN message identifier (bits 16 ... 28 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN ERL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the replacement value of the ERL register of the CAN message of the selection being used.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN D7:D6<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the replacement values of the corresponding data bytes of the CAN message of the corresponding selection.<br />
|}<br />
|}<br />
<br clear="all"><br />
<br />
== Блок-схема работы контроллера в режиме CAN-шлюза ==<br />
<br />
[[Изображение:14_8_2_1.png|800px]]<br />
<br />
<!--NOPDF--><br />
== See also ==<br />
[[CANNY 5.2 duo]]<br />
<br />
[[CANNY 5.2 duo, CAN Driver]]<br />
<br />
<!--/NOPDF--></div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_5.2_duo,_CAN_Gateway_Driver&diff=1570CANNY 5.2 duo, CAN Gateway Driver2018-05-19T12:32:45Z<p>CANNY: </p>
<hr />
<div>== General Description ==<br />
<br />
Using the CAN gateway driver you can to implement the high-speed asynchronous relaying of messages between the CAN hardware interfaces with optional filtering and altering particular CAN messages.<br />
<br />
The CAN gateway driver allows you to realize individual processing of incoming CAN messages by configuring up to eight selection rules (selectors).<br />
<br />
Each rule (selector) allows you to select CAN messages by the following user-defined properties:<br />
* CAN interface number via which the message was coming to the controller;<br />
* CAN ID of incoming message (CAN gateway selector value).<br />
<br />
When some incoming CAN message hit the selector, the CAN gateway driver perform one of the following user-defined actions:<br />
* relay the message to another CAN interface of the controller "as is", without any changes;<br />
* modify the message, and then relay the modified message to another CAN interface of the controller;<br />
* discard the message.<br />
<br />
Modification of the message is performed by replacing using a bitmask any bits of the original message, including the values of its ID, length and byte of data.<br />
<br />
Для всех сообщений, поступивших с определенного интерфейса CAN, но не удовлетворяющих признакам ни одного из включенных правил отбора шлюза возможно задать одно из следующих действий: <br />
* ретранслировать сообщение на другой интерфейс CAN контроллера без изменений;<br />
* отбросить сообщение.<br />
<br />
<br />
Для работы драйвера шлюза CAN необходимо задать конфигурацию драйверов обоих CAN-интерфейсов контроллера, при этом заданные для интерфейсов конфигурации CAN могут отличаться.<br />
<br />
<br />
При включенном драйвере шлюза CAN, средствами пользовательской диаграммы возможно, используя регистры Драйвера CAN0 и Драйвера CAN1:<br />
* отправлять сообщения через любой из CAN-интерфейсов контроллера в обычном режиме;<br />
* получать сообщения CAN удовлетворяющие правилам отбора установленным для соответствующего интерфейса CAN драйвером шлюза CAN.<br />
<br />
<br />
В процессе работы пользовательской диаграммы возможно многократно изменять любые параметры конфигурации драйвера шлюза CAN средствами пользовательской диаграммы, организуя таким образом, с некоторыми временными ограничениями, динамический режим работы шлюза.<br />
<br />
== Driver's registers ==<br />
<br />
Below is a description of the permissible values of the CAN gate driver control registers, which allow setting the controller operation parameters for high-speed asynchronous relaying of messages between the CAN hardware interfaces.<br />
<br />
Common registers of the CAN gateway driver.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway driver enable register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Enable the CAN gateway driver;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Disable the CAN gateway driver.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway configuration register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Apply the new settings of the CAN gateway driver (see note);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Do not update the settings of the CAN gateway driver.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway filter enable for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|switch on the filtering mode of the CAN gateway for the corresponding interface: relay to the second CAN interface of the controller and transmit only CAN messages that are accepted by the gateway selections, the remaining messages are discarded;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the filtering mode of the CAN gateway for the corresponding interface is disabled: it automatically retransmits messages that have not entered the gateway selections to the second CAN-interface of the controller in unchanged form.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway logging mode enable for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|enable the CAN gateway logging mode for the corresponding interface: transmit to the function chart (in the CAN driver) all CAN messages received on this interface. The gateway driver will select, replace and relay CAN messages according to the corresponding gateway settings of the specified CAN interface;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|disable the CAN gateway logging mode for the corresponding interface: only CAN messages that are included in the gateway's selections are transmitted to the diagram (in the CAN driver), the remaining messages are discarded.<br />
|}<br />
|}<br />
<br />
<br />
CAN gateway configuration registers.<br />
<br />
Common CAN gateway driver selection registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Registers<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X enable register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|enable the appropriate selection of the CAN gateway;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the corresponding CAN gateway selection is disabled.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X linked CAN interface number register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN0 interface;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN1 interface.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway excluding mode register for CANx interface<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|&ge; 1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|discard all messages which match an enabled selection;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|= 0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|allow processing and automatic retransmission to another CAN interface of all messages which match an enabled selection.<br />
|}<br />
|}<br />
<br />
<br />
CAN gateway selection registers.<br />
<br />
'''''The value of the selection''''' - is a parameter which, when satisfied, selects an incoming CAN message for special processing.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X value, IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the lower part of the identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the CAN message the selection will accept.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X value, IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the value of the highest part of the identifier (bits 16 ... 28 of the extended format identifier) of the CAN message the selection will accept.<br />
|}<br />
|}<br />
<br />
<br />
The registers of the gateway driver selection masks.<br />
<br />
'''''The selection masks''''' - is a group of values whose bits define the bitwise modifications to be made when the gateway retransmits a part of the message that has been accepted by the appropriate selection. If the value of the mask bit is "0", the corresponding bit of the received message will be relayed to the other interface without changes. If the value of the mask bit is "1", the corresponding bit of the received message will be replaced by a corresponding bit from the value of the ''Substitution Substitution''<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the mask of the lower part of the CAN message identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the mask value of the upper part of the CAN message identifier (bits 16 ... 28 of the extended format identifier) of the appropriate selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, ERL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Set the mask value of the ERL register of the CAN message of the appropriate selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, CAN D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X mask setup register, CAN D7:D6<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the mask for the corresponding byte of data of the CAN message of the corresponding selection.<br />
|}<br />
|}<br />
<br />
<br />
Registers for replacing the selections of the CAN gateway driver.<br />
<br />
'''''Replacement of selection''''' - is a group of values whose bits replace the original bits in the retransmitted message that has fallen into the appropriate selection. If the value of the replacement bit is "0", the corresponding bit of the relayed message will be replaced by zero, with the replacement bit value equal to "1", the corresponding bit of the relayed message will be replaced by one. '''The replacement will only be applied to those bits whose selection mask value is "1".'''<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Register<br />
!Expected value<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN IDL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the replacement of the lower part of the CAN message identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN IDH<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0x1FFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the value of the replacement of the highest part of the CAN message identifier (bits 16 ... 28 of the extended format identifier) of the corresponding selection.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN ERL<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the replacement value of the ERL register of the CAN message of the selection being used.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN D1:D0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|CAN gateway selector X replace setup register, CAN D7:D6<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...0xFFFF<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the replacement values of the corresponding data bytes of the CAN message of the corresponding selection.<br />
|}<br />
|}<br />
<br clear="all"><br />
<br />
== Блок-схема работы контроллера в режиме CAN-шлюза ==<br />
<br />
[[Изображение:14_8_2_1.png|800px]]<br />
<br />
<!--NOPDF--><br />
== See also ==<br />
[[CANNY 5.2 duo]]<br />
<br />
[[CANNY 5.2 duo, CAN Driver]]<br />
<br />
<!--/NOPDF--></div>CANNYhttps://wiki.cannylogic.com/index.php?title=Main_Page&diff=1561Main Page2018-04-22T18:03:21Z<p>CANNY: /* Here you will see CANNY's English wiki soon */</p>
<hr />
<div>#REDIRECT [[Welcome_to_CANNY_Wiki!]]<br />
<br />
== Here you will see CANNY's English wiki soon ==<br />
<br />
<br />
CANNY's original documentation has been written in Russian.<br />
<br />
Now we intensively transfer it to CANNY Wiki and prepare to translating.<br />
<br />
You can watch this work here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]<br />
<br />
For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=1538Welcome to CANNY Wiki!2017-05-30T22:51:05Z<p>CANNY: Rejected the last text change (by 89.178.89.163) and restored revision 1535 by CANNY</p>
<hr />
<div>'''CANNY's original documentation was written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''We are intensively translating the documentation into English. You may track the work progress as displayed on the page below.'''<br />
<br />
'''For now and always we are keen to answer any of your questions [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
<span style="color:#fff00f">'''EN = Translated but need to check.'''</span> <br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#008000">'''EN'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#008000">'''EN'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#fff000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
::{|<br />
|-valign="top"<br />
|'''Constants and Registers'''<br />
*[[Constant]]<br />
*[[Copy]]<br />
*[[Input Register]]<br />
*[[Output Register]]<br />
| &nbsp;<br />
|'''Logical operators'''<br />
*[[Negation]]<br />
*[[Logical AND]]<br />
*[[Logical OR]]<br />
*[[Exclusive OR]]<br />
| &nbsp;<br />
|'''Bitwise operators'''<br />
*[[Bitwise AND]]<br />
*[[Bitwise OR]]<br />
*[[Bitwise exclusive OR]]<br />
*[[Bitwise Inversion]]<br />
*[[Left shift]]<br />
*[[Right shift]]<br />
*[[Left rotation]]<br />
*[[Right rotation]]<br />
|-valign="top"<br />
|'''Relational operators'''<br />
*[[Equal to]]<br />
*[[Greater than]]<br />
*[[Not greater than]]<br />
*[[Less than]]<br />
*[[Not less than]]<br />
| &nbsp;<br />
|'''Arithmetic operations'''<br />
*[[Addition]]<br />
*[[Subtraction]]<br />
*[[Multiplication]]<br />
*[[Division]]<br />
| &nbsp;<br />
|'''Flip-flops / Latches'''<br />
*[[SR latch]]<br />
*[[RS latch]]<br />
*[[D flip-flop]]<br />
*[[T flip-flop]]<br />
*[[JK flip-flop]]<br />
*[[Buffer]]<br />
|-valign="top"<br />
|'''Timers and Generators'''<br />
*[[Delayed turning ON]]<br />
*[[Delayed turning OFF]]<br />
*[[PWM Generator]]<br />
*[[RND Generator]]<br />
| &nbsp;<br />
|'''Counters and Edge Detectors'''<br />
*[[Counter]]<br />
*[[Rising edge detector]]<br />
*[[Falling edge detector]]<br />
| &nbsp;<br />
|'''Converters'''<br />
*[[Converter 8-to-1]]<br />
*[[Converter 16-to-1]]<br />
*[[Converter 1-to-8]]<br />
*[[Converter 1-to-16]]<br />
*[[ASCII to Integer]]<br />
*[[Integer to ASCII]]<br />
*[[Map]]<br />
|-valign="top"<br />
|'''Switches'''<br />
*[[Switch 2-to-1]]<br />
*[[Switch 8-to-1]]<br />
*[[Switch 16-to-1]]<br />
*[[Switch 1-to-2]]<br />
*[[Switch 1-to-8]]<br />
*[[Switch 1-to-16]]<br />
| &nbsp;<br />
|'''Decoration'''<br />
*[[Label]]<br />
| &nbsp;<br />
|<br />
|}<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands<br />
<br />
=== Automotive Programmable Logic Controller CANNY 5.2 duo ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo]] - Main article<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Driver | CAN Interface]] - Configuring and using built-in CAN-Interfaces<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, CAN Gateway Driver | CAN Gateway Driver]] - Configuring and using built-in CAN-Interfaces in asynchronous CAN Gateway mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, UART Driver| UART Driver]] - Using controller with serial data asynchronous interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
<br />
=== CANNY CAN(LIN) monitor (ccm.exe) ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY CAN(LIN) monitor]] - Main article</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=1535Welcome to CANNY Wiki!2017-05-30T22:40:36Z<p>CANNY: Reverted edits by Kelly (talk) to last revision by Support</p>
<hr />
<div>'''CANNY's original documentation was written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''We are intensively translating the documentation into English. You may track the work progress as displayed on the page below.'''<br />
<br />
'''For now and always we are keen to answer any of your questions [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
<span style="color:#fff00f">'''EN = Translated but need to check.'''</span> <br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#008000">'''EN'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#008000">'''EN'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#fff000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
::{|<br />
|-valign="top"<br />
|'''Constants and Registers'''<br />
*[[Constant]]<br />
*[[Copy]]<br />
*[[Input Register]]<br />
*[[Output Register]]<br />
| &nbsp;<br />
|'''Logical operators'''<br />
*[[Negation]]<br />
*[[Logical AND]]<br />
*[[Logical OR]]<br />
*[[Exclusive OR]]<br />
| &nbsp;<br />
|'''Bitwise operators'''<br />
*[[Bitwise AND]]<br />
*[[Bitwise OR]]<br />
*[[Bitwise exclusive OR]]<br />
*[[Bitwise Inversion]]<br />
*[[Left shift]]<br />
*[[Right shift]]<br />
*[[Left rotation]]<br />
*[[Right rotation]]<br />
|-valign="top"<br />
|'''Relational operators'''<br />
*[[Equal to]]<br />
*[[Greater than]]<br />
*[[Not greater than]]<br />
*[[Less than]]<br />
*[[Not less than]]<br />
| &nbsp;<br />
|'''Arithmetic operations'''<br />
*[[Addition]]<br />
*[[Subtraction]]<br />
*[[Multiplication]]<br />
*[[Division]]<br />
| &nbsp;<br />
|'''Flip-flops / Latches'''<br />
*[[SR latch]]<br />
*[[RS latch]]<br />
*[[D flip-flop]]<br />
*[[T flip-flop]]<br />
*[[JK flip-flop]]<br />
*[[Buffer]]<br />
|-valign="top"<br />
|'''Timers and Generators'''<br />
*[[Delayed turning ON]]<br />
*[[Delayed turning OFF]]<br />
*[[PWM Generator]]<br />
*[[RND Generator]]<br />
| &nbsp;<br />
|'''Counters and Edge Detectors'''<br />
*[[Counter]]<br />
*[[Rising edge detector]]<br />
*[[Falling edge detector]]<br />
| &nbsp;<br />
|'''Converters'''<br />
*[[Converter 8-to-1]]<br />
*[[Converter 16-to-1]]<br />
*[[Converter 1-to-8]]<br />
*[[Converter 1-to-16]]<br />
*[[ASCII to Integer]]<br />
*[[Integer to ASCII]]<br />
*[[Map]]<br />
|-valign="top"<br />
|'''Switches'''<br />
*[[Switch 2-to-1]]<br />
*[[Switch 8-to-1]]<br />
*[[Switch 16-to-1]]<br />
*[[Switch 1-to-2]]<br />
*[[Switch 1-to-8]]<br />
*[[Switch 1-to-16]]<br />
| &nbsp;<br />
|'''Decoration'''<br />
*[[Label]]<br />
| &nbsp;<br />
|<br />
|}<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands<br />
<br />
=== Automotive Programmable Logic Controller CANNY 5.2 duo ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo]] - Main article<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, CAN Driver | CAN Interface]] - Configuring and using built-in CAN-Interfaces<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, CAN Gateway Driver | CAN Gateway Driver]] - Configuring and using built-in CAN-Interfaces in asynchronous CAN Gateway mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 5.2 duo, UART Driver| UART Driver]] - Using controller with serial data asynchronous interface<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#fff000">'''EN'''</span> [[CANNY 5.2 duo, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
<br />
=== CANNY CAN(LIN) monitor (ccm.exe) ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY CAN(LIN) monitor]] - Main article</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=1380CANNY 72016-12-13T17:03:13Z<p>CANNY: /* Electrical characteristics and environmental requirements */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. At the end of the software download mode , if EEPROM system software is loaded correctly, the controller will switch to running mode, otherwise it returns to SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used include assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on a required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named [[CANNY_7,_Discrete_IO_Driver|"Default Positive Output"]] at the input of the function block "Copy" and setting the address with the name [[CANNY_7,_Discrete_IO_Driver|"Discrete Input/Output Mode Setup Register, IO Channel №0"]] at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ([[CANNY_7,_Discrete_IO_Driver|"Discrete Input Value Register, IO Channel №0"]]), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== Controllers' Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The set of system registers located in the "System Registers" directory of CannyLab IDE registers list, which is available via function blocks' input or output "Add Register / Select from List" context menu.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels. Each channel is physically available through corresponding pins of X2 and X3 connectors. Writing and reading data of the respective drivers registers, the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small electric motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment, etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the functional diagram.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmission , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers are implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' or as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on pins 1 & 2 of X1 connector: CAN-H and CAN-L, designed for connection to '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connected both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
Communication lines (SDA and SCL) can be assigned to any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user while the controller is loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parameters set by user become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM Driver]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels can be used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 mA / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 K or 200 K<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>o</sup>С...+85<sup>o</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller do not have life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off to the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture comes in contact with output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=PWM_Generator&diff=1379PWM Generator2016-12-13T17:01:51Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_8_3_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|PWM<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Timers and Generators | Timers and Generators]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Period, мс:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Duty, мс:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Start:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Output:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 0.6b<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_8_3_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
Non-zero value at the input "Start", generates a logic one at the output with a predetermined duration and periodicity.<br />
<br />
[[File:5_8_3_3.png|left|thumb|Pulse signal parameters]]<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
For asynchronous generation of the precision PWM signal at the output using[[CANNY_7,_Discrete_IO_Driver#PWM_output_mode | Discrete IO Driver]] or [[CANNY_7,_HR_PWM_Driver | HR PWM Driver]]<br />
<br />
== Features ==<br />
When working with CANNY 7, it is a good practice to use the time intervals greater than 5-10 ms.<br />
<br />
When specifying temporal values on the diagram, it is necessary to take into account the duration of the diagram execution cycle, which depends on the model of the controller, the size of the chart, controllers' operation mode, controller periphery. It may be varied from cycle to cycle within certain limits during operation. Exact execution time for each cycle is available in the register, during controller operation [[CANNY_7,_System_Registers#Function_Diagram_actual_run_time | "Last Execution Loop Duration Register"]].<br />
<br />
Time intervals in the diagram should not be specified by value less than the duration of one cycle and will be measured with an uncertainty about the duration of one cycle of a user diagram. <br />
<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_8_3_4.png|thumb]]<br />
|-<br />
|[[File:5_8_3_5.png|thumb|Timing diagram]]<br />
|}<br />
<br />
== See also ==<br />
[[Delayed turning OFF]]<br />
<br />
[[Delayed turning ON]]<br />
<br />
[[RND Generator]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=PWM_Generator&diff=1378PWM Generator2016-12-13T17:01:02Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_8_3_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|PWM<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Timers and Generators | Timers and Generators]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Period, мс:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Duty, мс:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Startт:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Выход:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 0.6b<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_8_3_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
Non-zero value at the input "Start", generates a logic one at the output with a predetermined duration and periodicity.<br />
<br />
[[File:5_8_3_3.png|left|thumb|Pulse signal parameters]]<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
For asynchronous generation of the precision PWM signal at the output using[[CANNY_7,_Discrete_IO_Driver#PWM_output_mode | Discrete IO Driver]] or [[CANNY_7,_HR_PWM_Driver | HR PWM Driver]]<br />
<br />
== Features ==<br />
When working with CANNY 7, it is a good practice to use the time intervals greater than 5-10 ms.<br />
<br />
When specifying temporal values on the diagram, it is necessary to take into account the duration of the diagram execution cycle, which depends on the model of the controller, the size of the chart, controllers' operation mode, controller periphery. It may be varied from cycle to cycle within certain limits during operation. Exact execution time for each cycle is available in the register, during controller operation [[CANNY_7,_System_Registers#Function_Diagram_actual_run_time | "Last Execution Loop Duration Register"]].<br />
<br />
Time intervals in the diagram should not be specified by value less than the duration of one cycle and will be measured with an uncertainty about the duration of one cycle of a user diagram. <br />
<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_8_3_4.png|thumb]]<br />
|-<br />
|[[File:5_8_3_5.png|thumb|Timing diagram]]<br />
|}<br />
<br />
== See also ==<br />
[[Delayed turning OFF]]<br />
<br />
[[Delayed turning ON]]<br />
<br />
[[RND Generator]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Counter&diff=1377Counter2016-12-13T16:56:27Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_9_1_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|COUNT<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Counters and Edge Detectors | Counters and Edge Detectors]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Increment:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
|style="padding-left:1em;"|Decrement:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
|style="padding-left:1em;"|Reset:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Logical]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Result:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 0.6b<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_9_1_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
At zero value on input "Reset": on each rising edge (change in values from zero to non-zero) on the input "increment" is adding 1 to the "Result" value, and on each rising edge (change in values from zero to non-zero) at the input to "Decrement" is subtracted 1 from the output.<br />
<br />
At non-zero value on input "Reset", sets the output value to zero. <br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
== Features ==<br />
The output value is 16-bit, with the overflow. In other words, the result can not exceed 65535. In case of increasing output value over 65535, the result will be zero, and in case of reducing output value below zero, the result will be 65535.<br />
<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_9_1_3.png|thumb|Step 1]]<br />
|<br />
|[[File:5_9_1_4.png|thumb|Step 2]]<br />
|-<br />
|[[File:5_9_1_5.png|thumb|Step 3]]<br />
|<br />
|[[File:5_9_1_6.png|thumb|Step 4]]<br />
|-<br />
|[[File:5_9_1_7.png|thumb|Step 5]]<br />
|}<br />
<br />
== See also ==<br />
[[Rising edge detector]]<br />
<br />
[[Falling edge detector]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_LIN_Driver&diff=1375CANNY 7, LIN Driver2016-12-13T16:54:40Z<p>CANNY: /* Driver registers */</p>
<hr />
<div>=== General description ===<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== Driver registers ===<br />
<br />
The following describes the acceptable LIN driver operation control registers values.<br />
<br />
LIN driver configuration Registers allows to set up the controller as a LIN bus node:<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Mode Setup Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Mode Setup Register <br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|setup a LIN driver channel configuration, determines the current operation mode and parameters (determined by special constant from the constants directory);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|disconnect the channel from the LIN driver, return channel control to input-output channels driver and allow its status changes from the functional diagram.<br />
|}<br />
|}<br />
<br />
Channel configuration for operation in this mode is determined by a constant, which is a combination of parameters: protocol version , baud rate, operation mode and the availability of internal channel pull-up.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Parameter<br />
!The list of acceptable values<br />
|- valign="top"<br />
|LIN protocol version<br />
|1.3; 2.0<br />
|- valign="top"<br />
|baud rate<br />
|2400; 9600; 19200<br />
|- valign="top"<br />
|Operation mode<br />
|MASTER; SLAVE<br />
|- valign="top"<br />
|Pull-up<br />
|[[plus]]; [[float]]<br />
|}<br />
<br />
Named constants that represent LIN configuration parameters combination, available to the user in the "LIN Modes" CannyLab constants directory, which can be accessed via function block entry context menu having "constant" type.<br />
<br />
LIN driver diagnostic registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Overflow Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Overflow Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN buffer is full;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN no buffer overflow detected.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Error Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Error Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|during LIN data reception an error occurred;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the driver is operating normally.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Ready to Send Register <br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Ready to Send Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|corresponding channel LIN data transmit buffer is free and ready;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|LIN driver data transmission buffer is busy.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Data Delivered Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Data Delivered Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|in SLAVE mode, successful data transfer indication from the buffer of corresponding channel LIN, in response to MASTER node request;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|when the corresponding LIN channel is in a SLAVE mode, there were no MASTER node request received.<br />
|}<br />
|}<br />
<br />
LIN Receive Registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Data Set Ready Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Data Set Ready Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the message is received and placed into corresponding LIN channel receive buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|in the corresponding LIN channel receive buffer no actual data present.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Idle Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Idle Register<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|no activity on the corresponding channel LIN drivers, the line is in a passive mode;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|fixed activity on the line of corresponding LIN driver channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register LEN<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register LEN<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...8<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|a value, equal to the number of data bytes in the packet received via respective LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register ID<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register ID<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...63<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|message ID, obtained via respective channel LIN . (See note.)<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Received Data Register b7:b6<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Received Data Register b7:b6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|respective data byte values, LIN reception buffers of each channel by two bytes to the register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''LIN Received Data Register ID displays only the lower 6 bits of the identifier: 4-bit address of the device and the 2- bits used in the LIN 1.1 to encode the message length, and later to expand the address. 10 higher bits of LIN received message ID register always zero.''<br />
|}<br />
<br />
LIN transmit registers.<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected Values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Request to Send Register<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Request to Send Register<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|to load data from the transfer registers in the respective channel LIN transmit buffer;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|do not load data to the respective channel LIN transmit buffer.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register LEN<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register LEN<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...8<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"the number of data bytes that will be transmitted to the line when receiving a command to send on the corresponding LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register ID<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register ID<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...63<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|LIN ID value for message transmission via respective LIN channel.<br />
|}<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN1 Transmit Data Register b7:b6<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register b1:b0<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|LIN2 Transmit Data Register b7:b6<br />
|}<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|data byte values to transmit on respective LIN channel by two bytes to the register.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When sending LIN-messages, the driver discards all but the lower 6 bits of LIN ID register, automatically generates two parity bits and complements them ID, according to requirements of the standard.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When working with LIN networks versions below 1.3, be careful in the formation of outgoing messages. The driver allows the use of combinations of length and identifier transmitting message unacceptable in this standard.''<br />
|}<br />
<br />
=== Canny7 in MASTER mode ===<br />
<br />
To switch LIN driver channel in to MASTER mode, it is necessary to copy the constant value corresponding to the selected mode in to appropriate driver channel address: "LINx mode setup register».<br />
<br />
For MASTER to receive data from SLAVE-node, need to send corresponding request to LIN bus: Send the message header contains the identifier of the slave node from which the data is requested. The length of transmission message LEN LEN must be set to zero, in to transmission start register to be recorded non-zero value. Upon receipt of response from the slave, the data will be placed in receive register of the corresponding LIN driver channel with simultaneous setting mark in LINx Data Set Ready Register data availability.<br />
<br />
An example of a functional diagram for MASTER data reception from SLAVE-node. MASTER every 100ms sends the data request from the slave with the identifier 0x02. After receiving a response, the controller stores the first 2 bytes of data in the D-flip-flop.<br />
<br />
[[File:6_10_4_1.png|center|950px]]<br />
<br />
For data transmission in MASTER mode, the ID and Data registers must be filled, while setting transmission LIN LEN Register, a value equal to the number of transmitting data bytes, which must be greater than zero but less than nine. Instruction for LIN driver to send messages obtained by setting a non-zero value in the "LINx Request To Send Register". As a result, the contents of the registers is copied into the transmit buffer LIN, if it is free, the driver will immediately proceed to send a message.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''To prevent data loss, before sending a new LIN message, it is recommended to ensure readiness to the transfer of the next message from corresponding LIN channel transmit buffer, by checking the LINx Ready To Send Register.''<br />
|}<br />
<br />
Example of functional diagram, sending data to the LIN bus by MASTER.<br />
MASTER every 100ms sends a message to the bus with the identifier 0x01 that contains 2 bytes of data (0h0A and 0x55).<br />
<br />
[[File:6_10_4_2.png|center|800px]]<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''If LINx Request To Send Register permanently set a non-zero value, then the attempt to copy the data to the transmission buffer for sending LIN messages will be taken at each diagram execution cycle. To avoid overflow of LIN transmission buffer, triggers the start of data transmission by single pulse using, for example, front detector functional blocks.''<br />
|}<br />
<br />
=== Canny7 in SLAVE mode ===<br />
<br />
Operating SLAVE mode, LIN node successfully receives any data transmitted over the network, but can not transmit data to the LIN itself, without not having received the request from MASTER.<br />
<br />
To switch LIN driver channel in to SLAVE mode, it is necessary to copy the constant value corresponding to the selected mode in to appropriate driver channel address: "LINx mode setup register».<br />
<br />
To ensure successful data sending for node in SLAVE mode on MASTER-node request ,It must advance without waiting for a request, to prepare the data for transmission. This requires to fill in all the necessary LINx Transmit Data Register, namely: LIN ID register, message length register LIN LEN and place sending information in LIN data register.<br />
Permission to send is given by setting a value "1" to "LINx Request To Send Register", whereby the contents of data registers is copied into LIN transmit buffer, if it is free. Sending of data, once placed in the buffer will be automatically performing by LIN driver, with each request from the MASTER.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''If LINx Request To Send Register permanently set a non-zero value, then the attempt to copy the data to the transmission buffer for sending LIN messages will be taken at each diagram execution cycle. To avoid overflow of LIN transmission buffer, triggers the start of data transmission by single pulse using, for example, front detector functional blocks.''<br />
|}<br />
<br />
Monitor a request reception from the MASTER and successful automatic response to it by LIN driver in SLAVE mode possible by the appearance of the value "1" in LINx Data Delivered Register. Update data in the buffer transmission is possible after its release. Status of the send buffer can be tracked by the value of the corresponding register.<br />
<br />
An example of a functional diagram for data transmission by LIN node in SLAVE mode.<br />
<br />
[[File:6_10_5_1.png|center|600px]]<br />
<br />
An example of a functional diagram SLAVE receiving data from the MASTER. Controller, receiving message with the identifier 0x01 that contains any data, stores the first two bytes of data message in the D-flip-flop.<br />
<br />
[[File:6_10_5_2.png|center]]<br />
<br />
=== Energy saving mode (low power consumption mode) ===<br />
<br />
To save energy, LIN specification provides the ability to switch all LIN network nodes in low energy consumption mode. Most often, such a transition is initiated by master node by sending an appropriate message to the bus,or slave nodes switch by their own, when there is no activity on the bus for a specified time interval. Exit sleep mode can be initiated by any node on the bus. MASTER-node initiates LIN bus awakening by normal query slaves. However, waking up initiated by SLAVE-node is carried by short installation of GND potential on the line.<br />
<br />
In the LIN driver of controller Canny 7, to wake the BUS, MASTER-node just need to start transmitting data or query slaves. SLAVE-nodes sends a request to awake the BUS by passing a message with any identifier, but have zero length, i.e. "LINx Transmit Data Register LEN» = 0.<br />
<br />
== See also ==<br />
[[CANNY 7]]<br />
<br />
[[CANNY 7, UART Driver]]<br />
<br />
[[CANNY 7, CAN Driver]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_EEPROM_Driver&diff=1374CANNY 7, EEPROM Driver2016-12-13T16:54:06Z<p>CANNY: /* Nonvolatile memory registers */</p>
<hr />
<div>=== General description ===<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Nonvolatile memory registers ===<br />
<br />
Below is a description of permissible values of controller nonvolatile memory setup registers. They are used to store information in the NVRAM cells.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|EEPROM Set Cell 00<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|EEPROM Set Cell 63<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|stored value.<br />
|}<br />
|}<br />
<br />
Below is a description of acceptable values controller non-volatile memory read registers. They are used to restore information from the NVRAM cells.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return values<br />
|- valign="top"<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|EEPROM Get Cell 00<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|...<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|EEPROM Get Cell 63<br />
|}<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|stored value.<br />
|}<br />
|}<br />
<br />
An example of a functional diagram with non-volatile memory cells.<br />
<br />
[[File:6_15_2_1.png|center|900px]]<br />
<br />
The number of a button clicks that is connected to controller's channel #0, is added to the previously stored in the network named "counter" values. The value of the network «counter» are stored in non-volatile memory when the button is released. After turning off and then restoring controller's power, a value stored in non-volatile memory cell is automatically read and transmitted back to the network named "counter". This avoids loss of information on the number of clicks on this button after controller power loss.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''The process of storing data in the NVRAM takes time, i.e. not instantaneous.''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''The number of overwrites information in non-volatile memory is limited. CANNY 7 memory operation driver is organized in such a way that substantially increased its resource. However, avoid permanent unwanted data saving in to the NVRAM or store data on each execution cycle of the diagram. Perform information preservation upon a certain condition (see example above).''<br />
|}<br />
<br />
== See also ==<br />
[[CANNY 7]]<br />
<br />
[[CANNY 7, User Preprogrammed Parameters]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_Dallas_1-Wire_Driver&diff=1373CANNY 7, Dallas 1-Wire Driver2016-12-13T16:52:49Z<p>CANNY: /* Dallas 1-Wire® driver */</p>
<hr />
<div>=== General Description ===<br />
<br />
Controller CANNY 7 can be used as a master node in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]''', while it has the ability to only send requests for data from slave devices.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
The slave must have a permanent, rather than parasitic power.<br />
<br />
=== Dallas 1-Wire® driver ===<br />
<br />
Below is a description of the Dallas 1-Wire® driver registers.<br />
<br />
Dallas 1-Wire® driver configuration registers.<br />
<br />
To activate Dallas 1-Wire® driver, you need to select the controller channel number connected to Dallas 1-Wire® bus, in the appropriate driver register.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''At any given time, the driver can work with only one of the connected Dallas 1-Wire® bus, when it is allowed to dynamically switch between buses in the implementation of the functional diagram.''<br />
|}<br />
<br />
Sent requests management to get information from the slaves and control receiving of their responses (sensors poll) is performed by appropriate registers of 1-Wire driver.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''To avoid data loss, when working with several Dallas buses, perform switching between them only after receiving responses from the slaves requested by the controller and processing or saving the data.''<br />
|}<br />
<br />
Example of channel #5 configured to work with a temperature sensor DS18X20.<br />
<br />
[[File:6_12_2_1.png|center|300px]]<br />
<br />
Dallas 1-Wire® Setup Registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|Dallas 1-Wire® Mode Setup register<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|driver activation and setting the device type (defined by a special constant of the constants directory);<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|disconnect the channel from 1-Wire driver, return channel control to IO channels driver and allow status changing from the functional diagram.<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® IO Channel Select Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...10<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|set the channel number used by the controller to work with Dallas 1-Wire® bus .<br />
|}<br />
|}<br />
<br />
<br />
Channel configuration to operate in this mode is set by the following named constants:<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Parameter<br />
!List of expected values<br />
|- valign="top"<br />
|Dallas 1-Wire® device type<br />
|DS18X20 temperature sensor, CP-Z reader in the DS1990A emulation mode, DS1990A reader<br />
|}<br />
<br />
<br />
Dallas 1-Wire® Request Registers.<br />
<br />
With the help of Dallas 1-Wire® driver request registers , the user can specify the address of respondent slave node and send a request for data transfer. <br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|Dallas 1-Wire® Request To Send Register<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|send a request for data to the slave;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|do not send a request for data to the slave.<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Requested Device ID RAW Data Register SN0:FC<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: the lower part represent a device family identifier (FC), the upper part contains the first byte of the unique device address (SN0).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Requested Device ID RAW Data Register SN2:SN1<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: the lower part contains the 2nd byte of the unique device address (SN1), the upper part contains the 3rd byte of the unique device address (SN2).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Requested Device ID RAW Data Register SN4:SN3<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: the lower part contains the 4th byte of the unique device address (SN3), the upper part contains the 5th byte of the unique device address (SN4).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Requested Device ID RAW Data Register CRC:SN5<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: the lower part contains the 6th byte of the unique device address (SN5), the upper part contains ROM-code addressee checksum (CRC).<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''The setup registers of Dallas 1-Wire® 64-bit transmission destination ROM-code is only used to select a device on the Dallas 1-Wire® bus by its unique number (ROM-code), in case of multiple devices connected to the same bus. During operation with a single device on the bus, when its ROM- code unknown, set "0" value into all registers of Dallas transmission destination ROM-code.''<br />
|}<br />
<br />
<br />
Dallas 1-Wire® Receive Registers .<br />
<br />
During its operation, upon reception of responses from the slave devices to the controller data requests, according to Dallas 1-Wire® driver configuration, stored in its corresponding receiving registers.<br />
<br />
General receive registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return values<br />
|- valign="top"<br />
|Dallas 1-Wire® Data Set Ready Register<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|successfully received data from the slave node and it is available in Dallas 1-Wire® driver read registers;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|there is no actual data in the driver receive buffer.<br />
|}<br />
|}<br />
<br />
<br />
iButton® DS1990A Receive Mode Registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return values<br />
|- valign="top"<br />
|Dallas 1-Wire® Received Raw Data Register D0:FC<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: lower part contains family key identifier (FC), higher part contains the first byte of unique key address (SN0).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Received Raw Data Register D2:D1<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: lower part contains the second byte of unique key address (SN1), higher part contains the third byte of unique key address (SN2).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Received Raw Data Register D4:D3<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: lower part contains the forth byte of unique key address (SN3), higher part contains the fifth byte of unique key address (SN4).<br />
|}<br />
|- valign="top"<br />
|Dallas 1-Wire® Received Raw Data Register CRC:D5<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|register value: lower part contains the sixth byte of unique key address (SN5), higher part contains key checksum ROM-code (CRC).<br />
|}<br />
|}<br />
<br />
<br />
DS18X20 Receive Mode Registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Returning values<br />
|- valign="top"<br />
|DS18X20 Received Temperature Data Register: Integer Part<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...125<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|modulo of integer part of temperature value measured by the sensor.<br />
|}<br />
|- valign="top"<br />
|DS18X20 Received Temperature Data Register: Fractional Part ( x 0.0001)<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...9999<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|modulo of decimal part of temperature value measured by the sensor.<br />
|}<br />
|- valign="top"<br />
|DS18X20 Received Temperature Data Register: Sign (0 = above zero; 1 = below zero)<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the temperature measured by the sensor is above zero;<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the temperature measured by the sensor is below zero.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When receiving in DS18X20 mode, temperature sensor duty cycle, those send requests via Dallas transmission start register, should not be less than 750ms.''<br />
|}<br />
<br />
Example of a functional diagram working with DS18X20 temperature sensor.<br />
<br />
[[File:6_12_2_2.png|center]]<br />
<br />
temperature sensor poll, connected to the channel #5, carried out 1 time per second. When receiving data from DS18X20, in Dallas 1-Wire® Data Set Ready Register appears value "1" and data from the temperature reading registers, with help of D flip-flops, is stored in respective named networks for further processing.<br />
<br />
== See also ==<br />
[[CANNY 7]]<br />
<br />
[[CANNY 7, I²C Driver]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=1372CANNY 72016-12-13T16:52:03Z<p>CANNY: /* Access to hardware resources */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. At the end of the software download mode , if EEPROM system software is loaded correctly, the controller will switch to running mode, otherwise it returns to SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used include assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on a required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named [[CANNY_7,_Discrete_IO_Driver|"Default Positive Output"]] at the input of the function block "Copy" and setting the address with the name [[CANNY_7,_Discrete_IO_Driver|"Discrete Input/Output Mode Setup Register, IO Channel №0"]] at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ([[CANNY_7,_Discrete_IO_Driver|"Discrete Input Value Register, IO Channel №0"]]), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== Controllers' Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The set of system registers located in the "System Registers" directory of CannyLab IDE registers list, which is available via function blocks' input or output "Add Register / Select from List" context menu.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels. Each channel is physically available through corresponding pins of X2 and X3 connectors. Writing and reading data of the respective drivers registers, the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small electric motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment, etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the functional diagram.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmission , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers are implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' or as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on pins 1 & 2 of X1 connector: CAN-H and CAN-L, designed for connection to '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connected both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
Communication lines (SDA and SCL) can be assigned to any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user while the controller is loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parameters set by user become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM Driver]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels can be used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>o</sup>С...+85<sup>o</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller do not have life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off to the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture comes in contact with output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7,_System_Registers&diff=1371CANNY 7, System Registers2016-12-13T16:50:46Z<p>CANNY: /* Device ID */</p>
<hr />
<div>=== General description ===<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers are located in the "State of the controller" addresses, directory of CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Reset controller ===<br />
<br />
Controller reset occurs as a result of any of the three events: when power up the controller, soft reset from the functional diagram or on command by [[WatchDog Timer]]. The controller is initialized after reset: the entire memory contents is cleared, input-output channels are reset to a neutral state, system software drivers are transferred to the initial state, power consumption is set to normal, a functional diagram execution starts from the beginning. The non-volatile memory content does not change at reset.<br />
<br />
Information about the reset is available by accessing the address "Power On Detect Register"<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Power On Detect Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the current execution cycle is the first one, since a soft reset or restored power<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|the current execution cycle is not the first one, since a soft reset or restored power<br />
|}<br />
|}<br />
<br />
Forced reset of the controller is performed by writing a nonzero value to "Reset Register" address. In this case, the controller reset takes place immediately after the end of the execution cycle of functional diagram, in which there was such a record.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Reset Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|start a forced controller reset<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|value is ignored<br />
|}<br />
|}<br />
<br clear="all"><br />
<br />
=== Built-in LED ===<br />
<br />
The controller has a built-in bi-color (green/red) LED. The functional diagram controls switching-on of each color by writing specific values into the appropriate registers. <br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Green LED On/Off Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|turn-on built-in Green LED<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|turn-off built-in Green LED<br />
|}<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Red LED On/Off Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|turn-on built-in Red LED<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|turn-off built-in Red LED<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Turning the LED simultaneously in both colors is unavailable, so if functional diagram set simultaneous switching on of Red and Green LEDs, the LED turns green only (green priority).''<br />
|}<br />
<br />
A functional diagram fragment, which turns on built-in Red LED for one second after each controller reset. <br />
[[File:6_5_3_1.png|center]]<br />
<br clear="all"><br />
<br />
=== Hibernation ===<br />
<br />
After reset, the controller starts working in normal power consumption, functional diagram will be executed continuously. Transition to [[Hibernation Mode]] carried out by command of functional diagram, recording a non-zero value to "Sleep Mode Enable Register". Transition to Sleep Mode takes place immediately after the end of functional diagram execution cycle, in which such recording was made, in the absence of conditions that impede this transition.<br />
<br />
The duration of "sleep" phase can be set from the functional diagram by writing a value to the address "Sleep Mode Time Scale Register". By default, if the functional diagram has no entry in the corresponding register, the "sleep" phase of hibernation mode lasts 1000ms. This means that while controller in low power mode, in the absence of conditions for transition to the normal power, the controller makes a pause of 1 second after each execution cycle of functional diagram.<br />
<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Expected values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Sleep Mode Enable Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|go into low power mode<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|return to normal power mode<br />
|}<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Sleep Mode Time Scale Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|duration of "sleep" phase in milliseconds after each execution cycle of functional diagrams<br />
|}<br />
|}<br />
<br />
Returning controller to normal power can be done manually - immediately after the end of the execution cycle of functional diagrams, during which it was written "0" at "Sleep Mode Enable Register", or automatically by any of the following events:<br />
*with changing of the electric potential in any terminal with the appropriate controller channel, configured as an active input or pulse counter;<br />
*when enabled from the functional diagram of any of the drivers CAN, LIN, UART/RS232, IR or Elita GSW with changing of the electric potential on the corresponding drivers' terminal.<br />
<br />
Information on the current power mode is available when accessing the address "Sleep Mode Control Register" <br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Sleep Mode Control Register<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|1<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|controller is in Sleep Mode<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|controller is in Normal Mode<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When creating a functional diagram, using low-power mode should be considered as a side effect brought by the change in the time scale. This effect manifests itself in functional blocks increment time: delay start, stop and PWM generators in a low power mode occurs in leaps and bounds according to the time actually spent in the phase of "sleep" (default 1000 ms increments).''<br />
|}<br />
<br />
A fragment of a functional diagram with typical low-power mode control: transition to the low power mode in the absence within 10 seconds conditions preventing it and automatic return to normal mode doe to controller periphery activity or set ban to "sleep" from the diagram:<br />
<br />
[[File:6_5_4_1.png|center]]<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Inversion of the output of the function block №4.''<br />
|}<br />
<br />
=== WatchDog Timer ===<br />
<br />
To eliminate infinite loop occurrence out of functional diagram, of what could happen in the event of controller incorrect connection or errors in system software provided a WatchDog Timer (WDT).<br />
<br />
In CannyLab IDE up to version 1.4, the user can control watchdog operation: enable or disable it, set its period.<br />
<br />
From CannyLab version 1.4 onwards, the user does not have access to the management of WDT. The watchdog timer is enabled permanently and its period is 1 ... 2 seconds.<br />
<br />
If pausing of the functional diagram execution exceeds the period of WDT, it will automatically reset the controller.<br />
<br />
=== Function Diagram actual run time ===<br />
<br />
The time required for the controller to perform functional diagram in actual conditions depends on the number and type of functional blocks present in the diagram, the number of drivers involved included in the system software and their activity. In practice, CANNY 7 execution cycle of a diagram contains about 400 function blocks and is actively interacting with CAN driver, lasts approximately 9 ms.<br />
<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When creating a functional diagram, the effect of execution loop duration should be considered. The effect is reflected in the fact that the increment of functional blocks time counters- start/stop delays and PWM generators occurs abruptly. Thus, when the actual cycle length of 6 cm, all PWM generators actual period on the diagram is a multiple of 6 ms.''<br />
|}<br />
<br />
Information about the length of functional diagram previous execution cycle is available at "Last Execution Loop Duration Register".<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|style="padding-left:0.5em;"|Last Execution Loop Duration Register, ms<br />
|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|length of functional diagram previous execution cycle in integer fractions of milliseconds.<br />
|}<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''The most accurate way to measure the total time of the controller operation, such as the implementation of the clock is the summation with accumulation of the values obtained at "Last Execution Loop Duration Register" during each execution cycle of functional diagram.''<br />
|}<br />
A fragment of a functional diagram that implements a high-precision seconds counter is suitable for use in real-time clock:<br />
<br />
[[File:6_5_6_1.png|center]]<br />
<br />
=== Device ID ===<br />
<br />
With CANNY 7 updated boot loader release, version 001004, during devices manufacture, each of which is assigned a unique identification number that can be used for further development to better protect against unauthorized use.<br />
<br />
Access to the device identifier is carried out via relevant special system registers.<br />
<br />
{|border="1" style="border-collapse:collapse;" align="left" width="100%"<br />
|- align="center" valign="top"<br />
!width="250px"|Address<br />
!Return Values<br />
|- valign="top"<br />
|style="padding-left:0.5em; padding-right:0.5em;"|Device ID Register D1:D0<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Lover two bites (D1 & D0) controller ID;<br />
|}<br />
|- valign="top"<br />
|style="padding-left:0.5em; padding-right:0.5em;"|Device ID Register D3:D2<br />
|valign="top"|<br />
{|border="0" align="left"<br />
|- valign="top"<br />
|width="70px" style="padding-left:0.5em;"|0...65535<br />
|style="padding-left:0.5em;"|=<br />
|style="padding-left:0.5em;"|Upper two bites (D3 и D2) controller ID.<br />
|}<br />
|}<br />
<br clear="all"><br />
<br />
During custom diagram development in CannyLab, the device ID, can be found by accessing device information, available in the section "Device" → "Information" of main menu or by clicking the "Information" toolbar, where it is represented in 4-byte (32-bit) number, with the location of the high byte on the left.<br />
<br />
For example, the identifier 0x563B8693 be presented as follows: Device ID Register D1:D0 is equal to 0x8693, Device ID register D3:D2 is 0x563B.<br />
<br />
EXAMPLE- functional diagram illustrating an operation with the device identifier. In the diagram a value read from device identification registers is compared with the given and if they match, the network will display "device ID is correct" saved "1".<br />
<br />
[[File:6_5_7_1.png|center]]<br />
<br />
== See also ==<br />
[[CANNY 7]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Right_shift&diff=1370Right shift2016-12-13T16:48:04Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_4_6_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|>><br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Bitwise operators | Bitwise operators]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Value:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Shift, bits:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|outputs<br />
|-<br />
|style="padding-left:1em;"|Result:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 0.6b<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_4_6_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
Logical shift to the Right. Set the output result as the logical right shift in binary representation of the input "Value", the number of bits to shift specified by the input "Shift, bit".бит».<br />
</div><br />
</div><br />
<br clear="left"><br />
In other words, the result is equivalent to the result of copying each bit in binary representation of input "value" to its right position, to the number of times specified by the value of the input "Shift, bit". Thus, the most significant (left-most) bit in the binary representation of the results each time gets a "0".<br />
<br />
For example:<br />
<br />
{|border="0" style="border-collapse:collapse;"<br />
|-<br />
|style="padding:5px;"|Value<br />
|style="padding:5px;"|=<br />
|style="padding:5px;"|22<br />
|style="padding:5px;"|=<br />
|style="padding:5px;"|0x0016<br />
|style="padding:5px;"|=<br />
|style="padding:5px;"|0b0000000000010110<br />
|-<br />
|style="padding:5px;"|Shift, bits<br />
|style="padding:5px;"|=<br />
|align="center"|2<br />
|align="center"|<br />
|-<br />
|style="padding:5px;"|Result<br />
|style="padding:5px;"|=<br />
|style="padding:5px;"|5<br />
|style="padding:5px;"|=<br />
|style="padding:5px;"|0x0005<br />
|style="padding:5px;"|=<br />
|align="center"|0b0000000000000101<br />
|}<br />
<br />
== Features ==<br />
The result of logical right shift::<br />
<br />
for one bit — equivalent to the results of its integer division by 2<br />
<br />
for two bits — equivalent to the results of its integer division by 4<br />
<br />
for three bits — equivalent to the results of its integer division by 8<br />
<br />
etc.<br />
<br />
== Examples ==<br />
{|<br />
|[[File:5_4_6_3.png|thumb|400px|As decimal]]<br />
|[[File:5_4_6_4.png|thumb|500px|As binary]]<br />
|}<br />
<br />
== See also ==<br />
[[Bitwise AND]]<br />
<br />
[[Bitwise OR]]<br />
<br />
[[Bitwise exclusive OR]]<br />
<br />
[[Bitwise Inversion]]<br />
<br />
[[Left shift]]<br />
<br />
[[Left rotation]]<br />
<br />
[[Right rotation]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Interaction_with_equipment&diff=1369Interaction with equipment2016-12-13T16:45:48Z<p>CANNY: </p>
<hr />
<div>IDE CannyLab gives users the ability to upload system software to the controller, required to perform the functional diagram, as well as the functional diagram itself. <br />
<br />
=== Connecting the controller to the PC ===<br />
<br />
Disconnect the controller from an external power supply and connect it to a PC via a standard "miniUSB" cable, the green LED will turn on at the same time. When controller is connected for the first time, Windows reports the discovery of a new standard device and will automatically install the driver for it.<br />
<br />
Linking CannyLab with the controller connected to the PC is done by selecting "Device" → "Connect" of the main menu or by pressing [[File:4_8_1_1.png]] from toolbar.<br />
<br />
If communication with the controller is successful, the controller's green LED will be flashing. The CannyLab status bar will display information about the connection, i.e. the presence or absence of the connected controller software, available menu items and toolbar buttons relevant to the work with the controller.<br />
<br />
=== Loading system software in the controller ===<br />
<br />
Loading system software in to connected controller carried out through the menu ''«Device»'' → ''«Firmware»'' → ''«Write»'', herewith, the choice of the controller system software file is performed in the pop-up dialog box.<br />
<br />
Writing system software in to PLC CANNY 7 takes about a minute. Information on the progress of the write process will be displayed in the dialog box. At the time of writing, the frequency of the controller green LED flickering increases.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''The user will be prompted If a previous recorded system software and functional diagram are detected, and it will be replaced with new system software.''<br />
|}<br />
<br />
=== Loading functional diagram in to the controller ===<br />
<br />
Loading functional diagram is only possible if controller already contains system software. Loading currently opened CannyLab functional diagram to the controller can be done via the menu ''«Device»'' → ''«Diagram»'' → ''«Write»'' or by pressing the button [[File:4_8_3_1.png]] on toolbar.<br />
<br />
Information of the loading progress will be displayed in the dialog box. At loading time, the controller green LED will flicker at higher frequency.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Upon request confirmation from the user, existing diagram in the controller will be erased. Previously written system software will remain unchanged. Loading diagram in the controller is usually faster than writing system software.''<br />
|}<br />
<br />
=== Completion of session with the controller ===<br />
<br />
After software loading has finished, for safe work completion, disconnect the USB cable from the controller. To make sure that the software recording process has been completed, before physically unplugging the controller it is recommended to select «Device» → «Disconnect» on main menu, or click [[File:4_8_4_1.png]] on toolbar, then controllers' green LED stops flashing.<br />
<br />
=== Obtaining technical information about the connected controller ===<br />
<br />
To obtain specific technical information about the connected controller, you must select''«Device»'' → ''«Information»'' main menu, or click [[File:4_8_5_1.png]] on toolbar. The device information will be displayed in a special window.<br />
<br />
[[File:4_8_5_2.png]]<br />
<br />
=== Deleting a functional diagram from controller's memory ===<br />
<br />
To delete a functional diagram from controller's memory, please select ''«Device»'' → ''«Diagram»'' → ''«Erase»'' on main window, or click [[File:4_8_6_1.png]] on toolbar. After prompted user confirmation, the diagram will be erased from controller memory.<br />
<br />
=== Removing firmware from the controller memory ===<br />
<br />
To remove firmware from controller, please select ''«Device»'' → ''«Firmware»'' → ''«Eraseь»'' on main window. After prompted user confirmation, the controller memory will be cleared.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''When removing firmware from controller memory, the user diagram will also be erased.''<br />
|}<br />
<br />
== See also ==<br />
[[CANNY Lab]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Delayed_turning_OFF&diff=1368Delayed turning OFF2016-12-13T16:43:53Z<p>CANNY: /* Features */</p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_8_2_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|DLF<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Timers and Generators | Timers and Generators]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Input:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Delay:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Output:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 0.6b<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_8_2_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
After changing the input value to zero, within a predetermined time keeps the output value equal to last non-zero input value.<br />
<br />
If holding the "input" value not equal to zero, copies it to the output. When changing the input values to zero, the output value does not change, and starts time countdown. By holding the input value to zero for a time more than a predetermined by input "Delay"in ms, sets output value to zero. When the input value changes to non-zero, the clock is reset.<br />
<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
== Features ==<br />
When working with CANNY 7, it is a good practice to use the time intervals greater than 5-10 ms.<br />
<br />
When specifying temporal values on the diagram, it is necessary to take into account the duration of the diagram execution cycle, which depends on the model of the controller, the size of the chart, controllers' operation mode, controller periphery. It may be varied from cycle to cycle within certain limits during operation. Exact execution time for each cycle is available in the register, during controller operation [[CANNY_7,_System_Registers#Function_Diagram_actual_run_time | "Last Execution Loop Duration Register"]].<br />
<br />
Time intervals in the diagram should not be specified by value less than the duration of one cycle and will be measured with an uncertainty about the duration of one cycle of a user diagram.<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_8_2_3.png|thumb|Т=0мс]]<br />
|<br />
|[[File:5_8_2_4.png|thumb|Т=1мс]]<br />
|-<br />
|[[File:5_8_2_5.png|thumb|Т=100мс]]<br />
|<br />
|[[File:5_8_2_6.png|thumb|Т>250мс]]<br />
|}<br />
<br />
== See also ==<br />
[[Delayed turning ON]]<br />
<br />
[[PWM Generator]]<br />
<br />
[[RND Generator]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=1364CANNY 72016-12-13T16:40:50Z<p>CANNY: /* Electrical characteristics and environmental requirements */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. At the end of the software download mode , if EEPROM system software is loaded correctly, the controller will switch to running mode, otherwise it returns to SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used include assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named [[CANNY_7,_Discrete_IO_Driver|"Default Positive Output"]] at the input of the function block "Copy" and setting the address with the name [[CANNY_7,_Discrete_IO_Driver|"Discrete Input/Output Mode Setup Register, IO Channel №0"]] at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ([[CANNY_7,_Discrete_IO_Driver|"Discrete Input Value Register, IO Channel №0"]]), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== Controllers' Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The set of system registers located in the "System Registers" directory of CannyLab IDE registers list, which is available via function blocks' input or output "Add Register / Select from List" context menu.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels. Each channel is physically available through corresponding pins of X2 and X3 connectors. Writing and reading data of the respective drivers registers, the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small electric motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment, etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the functional diagram.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmission , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers are implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' or as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on pins 1 & 2 of X1 connector: CAN-H and CAN-L, designed for connection to '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connected both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
Communication lines (SDA and SCL) can be assigned to any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user while the controller is loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parameters set by user become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM Driver]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels can be used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>o</sup>С...+85<sup>o</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller do not have life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off to the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture comes in contact with output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Label&diff=1114Label2016-04-15T14:49:11Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_12_1_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|A<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Converters | Decoration]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 1.15<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_12_1_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
The Label element represents a caption for a any area on diagram.<br />
The Label is element of diagram decoration only, it does not consume RAM/ROM resources and have no effect on execution process nor execution result.<br />
<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
== Features ==<br />
Every Label element on diagram may have individual style properties.<br />
<br />
== Examples ==<br />
{|<br />
|[[File:5_12_1_3.png|thumb|Example of Label]]<br />
|}<br />
<br />
{|<br />
|[[File:5_12_1_4.png|thumb|Label properties dialog]]<br />
|}<br />
<br />
== See Also ==<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Label&diff=1113Label2016-04-15T14:48:28Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_12_1_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|A<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Converters | Decoration]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 1.15<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_12_1_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
The Label element represents a caption for a any area on diagram.<br />
The Label is element of diagram decoration, it does not consume RAM/ROM resources and have no effect on execution process nor execution result.<br />
<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
== Features ==<br />
Every Label element on diagram may have individual style properties.<br />
<br />
== Examples ==<br />
{|<br />
|[[File:5_12_1_3.png|thumb|Example of Label]]<br />
|}<br />
<br />
{|<br />
|[[File:5_12_1_4.png|thumb|Label properties dialog]]<br />
|}<br />
<br />
== See Also ==<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Label&diff=1112Label2016-04-15T14:43:45Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_12_1_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|A<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Converters | Decoration]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 1.15<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_12_1_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
The Label element represents a caption for a any area on diagram.<br />
The Label is element of diagram decoration, it have no effect on execution process nor execution result.<br />
<br />
</div><br />
</div><br />
<br clear="left"><br />
<br />
== Features ==<br />
Every Label element on diagram may have individual style properties.<br />
<br />
== Examples ==<br />
{|<br />
|[[File:5_12_1_3.png|thumb|Example of Label]]<br />
|}<br />
<br />
{|<br />
|[[File:5_12_1_4.png|thumb|Label properties dialog]]<br />
|}<br />
<br />
== See Also ==<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Map&diff=1111Map2016-04-15T14:05:58Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_10_7_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|MAP<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Converters | Converters]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Value:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Value from:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Value to:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Result from:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
|style="padding-left:1em;"|Result to:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Result:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 1.18<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_10_7_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
Re-maps a number from one range to another using '''[https://en.wikipedia.org/wiki/Linear_interpolation linear interpolation]''' method.<br clear="left"><br />
</div><br />
<br />
<div><br />
For the mathematically inclined, here's the whole formula:<br />
<br />
[[File:5_10_7_1a.png]]<br />
<br />
<br />
The Map function block uses integer math so will not generate fractions. Fractional remainders are truncated, and are not rounded or averaged.<br />
<br />
If the denominator of a fraction in above formula is zero, the Result is equal to 65535<br />
<br />
Does not constrain values to within the range, because out-of-range values are sometimes intended and useful.<br />
<br />
</div><br />
<br />
</div><br />
<br />
== Features ==<br />
You can use the Map function block to map an analog input value, which ranges from 0 to 4095 to a voltage value, which ranges from 0 - 5000 millivolts.<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_10_7_3.png|thumb|ADC value to millivolts]]<br />
|}<br />
<br />
== See Also ==<br />
[[Converter 8-to-1]]<br />
<br />
[[Converter 16-to-1]]<br />
<br />
[[Converter 1-to-8]]<br />
<br />
[[Converter 1-to-16]]<br />
<br />
[[ASCII to Integer]]<br />
<br />
[[Integer to ASCII]]<br />
<br />
[[Built-in_Function_Blocks | Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Buffer&diff=1105Buffer2016-04-15T08:34:22Z<p>CANNY: </p>
<hr />
<div><br />
<div style="float:right;margin:5px;"><br />
<br />
{|class="cannytable" width="350px"<br />
|- <br />
!colspan="2" style="background-color:#AFEEEE;"|Appearance<br />
|-<br />
|colspan="2" align="center" style="padding:10px;"|[[File:5_7_6_2.png]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Symbol<br />
|-<br />
|colspan="2" align="center"|BUF<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Group<br />
|-<br />
|colspan="2" align="center"|[[Built-in Function Blocks#Flip-flops / Latches | Flip-flops / Latches]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Inputs<br />
|-<br />
|style="padding-left:1em;"|Input:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Outputs<br />
|-<br />
|style="padding-left:1em;"|Output:<br />
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]<br />
|-<br />
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]<br />
|-<br />
|colspan="2" align="center"|from 1.18<br />
|}<br />
</div><br />
<br />
<div style="min-height:100%;display:block;"><br />
<div style="float:left;width:70px;"><br />
[[File:5_7_6_1.png|left|Icon]]<br />
</div><br />
<br />
<div><br />
Copies the value of input to output with a one execution cycle delay.<br />
The initial value on block's output is "0"<br />
</div><br />
<br />
</div><br />
<br />
== Features ==<br />
The buffer is useful for value change detection.<br />
<br />
The chain of buffers can be used for efficient queuing (FIFO buffers).<br />
<br />
== Examples ==<br />
{|<br />
|-<br />
|[[File:5_7_6_3.png|thumb|Cycle 1]]<br />
|<br />
|[[File:5_7_6_4.png|thumb|Cycle 2]]<br />
|-<br />
|[[File:5_7_6_5.png|thumb|Cycle 3]]<br />
|<br />
|[[File:5_7_6_6.png|thumb|Cycle 4]]<br />
|-<br />
|[[File:5_7_6_7.png|thumb|Cycle 5]]<br />
|<br />
|[[File:5_7_6_8.png|thumb|Cycle 6]]<br />
|-<br />
|[[File:5_7_6_9.png|thumb|Cycle 7]]<br />
|<br />
|<br />
|}<br />
<br />
== See also ==<br />
[[SR latch]]<br />
<br />
[[SR latch]]<br />
<br />
[[D flip-flop]]<br />
<br />
[[T flip-flop]]<br />
<br />
[[JK flip-flop]]<br />
<br />
[[Built-in Function Blocks | The set of CFD Built-in Function Blocks]]</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=941Welcome to CANNY Wiki!2016-02-16T08:09:22Z<p>CANNY: /* Automotive Programmable Logic Controller CANNY 7 */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<span style="color:#ff0000">'''RU = Not translated yet! Text is in Russian BUT all pictures is in English now.'''</span><br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
<span style="color:#ffff00">'''EN = Translated need to check.'''</span><br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#ff0000">'''RU'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#ffff00">'''EN'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#008000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7]] - Main article<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode.<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#ffff00">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=924Welcome to CANNY Wiki!2016-02-03T19:12:41Z<p>CANNY: </p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<span style="color:#ff0000">'''RU = Not translated yet! Text is in Russian BUT all pictures is in English now.'''</span><br />
<br />
<span style="color:#008000">'''EN = Translated.'''</span><br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab]] - Main article<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode<br />
* <span style="color:#ff0000">'''RU'''</span> [[Interaction with equipment]] - CANNY Lab IDE and controller interaction<br />
* <span style="color:#ff0000">'''RU'''</span> [[Firmware Update Utility]] - Creating and using SFX-Files<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* <span style="color:#ff0000">'''RU'''</span> [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* <span style="color:#008000">'''EN'''</span> [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us)<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode.<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface<br />
* <span style="color:#008000">'''EN'''</span> [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* <span style="color:#ff0000">'''RU'''</span> [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=923Welcome to CANNY Wiki!2016-02-03T18:58:34Z<p>CANNY: /* Automotive Programmable Logic Controller CANNY 7 */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* [[CANNY Lab]] - Main article '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Interaction with equipment]] - CANNY Lab IDE and controller interaction '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Firmware Update Utility]] - Creating and using SFX-Files '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* [[CFD Language]] - The Canny Functional Diagram graphical language '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms).<br />
* [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us).<br />
* [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode. <br />
* [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface.<br />
* [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg; '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]] '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands '''(Not translated yet! Text is in Russian, pictures is in English.)'''</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=922Welcome to CANNY Wiki!2016-02-03T18:57:11Z<p>CANNY: /* Functional Block Diagrams */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* [[CANNY Lab]] - Main article '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Interaction with equipment]] - CANNY Lab IDE and controller interaction '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Firmware Update Utility]] - Creating and using SFX-Files '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* [[CFD Language]] - The Canny Functional Diagram graphical language '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms).<br />
* [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us).<br />
* [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode. <br />
* [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface.<br />
* [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=921Welcome to CANNY Wiki!2016-02-03T18:56:56Z<p>CANNY: /* CANNY Lab Integrated Development Environment */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* [[CANNY Lab]] - Main article '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Interaction with equipment]] - CANNY Lab IDE and controller interaction '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
* [[Firmware Update Utility]] - Creating and using SFX-Files '''(Not translated yet! Text is in Russian, pictures is in English.)'''<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms).<br />
* [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us).<br />
* [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode. <br />
* [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface.<br />
* [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=920Welcome to CANNY Wiki!2016-02-03T18:55:50Z<p>CANNY: /* CANNY Lab Integrated Development Environment */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* [[CANNY Lab]] - Main article '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
* [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
* [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
* [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
* [[Interaction with equipment]] - CANNY Lab IDE and controller interaction '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
* [[Firmware Update Utility]] - Creating and using SFX-Files '''(Not translated yet! Texts in Russian, pictures in English.)'''<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms).<br />
* [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us).<br />
* [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode. <br />
* [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface.<br />
* [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=Welcome_to_CANNY_Wiki!&diff=919Welcome to CANNY Wiki!2016-02-03T18:53:58Z<p>CANNY: /* CANNY Lab Integrated Development Environment */</p>
<hr />
<div>'''CANNY's original documentation has been written in Russian. You can find it here: [http://translate.google.com/translate?hl=ru&sl=ru&tl=en&u=http%3A%2F%2Fwiki.canny.ru%2F&sandbox=1 http://wiki.canny.ru]'''<br />
<br />
'''Now we intensively translate it in English. You can watch this works progress below on this page.'''<br />
<br />
'''For now and always we ready to answer any your question [http://www.cannylogic.com/contacts here] and [http://forum.cannylogic.com/ here].'''<br />
<br />
<br />
<br />
=== CANNY Lab Integrated Development Environment ===<br />
<br />
* [[CANNY Lab]] - Main article '''(In Russian. Not translated yet.)'''<br />
* [[CANNY Lab Main window | Main window]] - CANNY Lab Main window, tools and menu '''(In Russian. Not translated yet.)'''<br />
* [[CANNY Lab Functional Diagram Editor | Functional Diagram Editor mode]] - Functional diagram editor description and basic operations '''(In Russian. Not translated yet.)'''<br />
* [[CANNY Lab Simulator | Simulator mode]] - CANNY Lab IDE simulator mode '''(In Russian. Not translated yet.)'''<br />
* [[Interaction with equipment]] - CANNY Lab IDE and controller interaction '''(In Russian. Not translated yet.)'''<br />
* [[Firmware Update Utility]] - Creating and using SFX-Files '''(In Russian. Not translated yet.)'''<br />
<br />
=== Functional Block Diagrams ===<br />
<br />
* [[CFD Language]] - The Canny Functional Diagram graphical language<br />
* [[Built-in Function Blocks]] - The set of CFD Built-in Function Blocks<br />
<br />
=== Automotive Programmable Logic Controller CANNY 7 ===<br />
<br />
* [[CANNY 7]] - Main article<br />
* [[CANNY 7, PLC | Programmable Logic Controller]] - General information about the programmable logic controllers<br />
* [[CANNY 7, System Registers | System Registers]] - Managing system operation and indication<br />
* [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] - Using IO channels in a discrete mode and low-resolution PWM mode (1 ms).<br />
* [[CANNY 7, HR PWM Driver | High Resolution PWM]] - Using IO channels #1 and #2 in high-resolution PWM mode (1 us).<br />
* [[CANNY 7, UART Driver | UART / RS232 / Modbus]] - Using IO channels #9 and #10 in serial data interface asynchronous mode. <br />
* [[CANNY 7, CAN Driver |CAN Interface]] - Configuring and using built-in CAN-Interface.<br />
* [[CANNY 7, LIN Driver | LIN]] - Using IO channels #9 and #10 in LIN MASTER or LIN SLAVE modes.<br />
* [[CANNY 7, I²C Driver | I²C]] - Configuring and using channels in MASTER mode of synchronous serial data interface I²C<br />
* [[CANNY 7, Dallas 1-Wire Driver | Dallas&reg; 1-Wire&reg;]] - Configuring and using channels in MASTER mode of asynchronous serial data interface 1-Wire&reg;<br />
* [[CANNY 7, User Preprogrammed Parameters | User pre-Programmed Parameters]] - Access to parameters, set by the user when loading a software to the controller with [[Firmware Update Utility | Firmware Update Utility]]<br />
* [[CANNY 7, EEPROM Driver | EEPROM Non-volatile Memory]] - Writing and reading data to/from non-volatile memory<br />
* [[CANNY 7, IRRC Driver | Infrared Remote Control Driver]] - Configuring and using channels for receiving and transmitting IR remote control commands</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=871CANNY 72015-12-30T15:35:22Z<p>CANNY: /* System Registers */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to running mode, otherwise it returns to the SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named [[CANNY_7,_Discrete_IO_Driver|"Default Positive Output"]] at the input of the function block "Copy" and setting the address with the name [[CANNY_7,_Discrete_IO_Driver|"Discrete Input/Output Mode Setup Register, IO Channel №0"]] at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ([[CANNY_7,_Discrete_IO_Driver|"Discrete Input Value Register, IO Channel №0"]]), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== Controllers' Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The set of system registers located in the "System Registers" directory of CannyLab IDE registers list, which is available via function blocks' input or output "Add Register / Select from List" context menu.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels. Each channel is physically available through corresponding pins of X2 and X3 connectors. Writing and reading data of the respective drivers registers, the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small electric motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment, etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the functional diagram.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 1 & 2 pins of X1 connector: CAN-H and CAN-L, designed for connection to '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=870CANNY 72015-12-30T13:43:00Z<p>CANNY: /* Access to hardware resources */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to running mode, otherwise it returns to the SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named [[CANNY_7,_Discrete_IO_Driver|"Default Positive Output"]] at the input of the function block "Copy" and setting the address with the name [[CANNY_7,_Discrete_IO_Driver|"Discrete Input/Output Mode Setup Register, IO Channel №0"]] at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ([[CANNY_7,_Discrete_IO_Driver|"Discrete Input Value Register, IO Channel №0"]]), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== System Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers located in the "State of the controller" addresses directory CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels . Each channel is physically available through corresponding pins of X2 and X3 connectors . Writing and reading data of the respective drivers registers , the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment , etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamic override the channel configuration from the functional diagram in the process of its execution.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 4 pin connector: CAN-H and CAN-L, designed for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=869CANNY 72015-12-30T13:39:38Z<p>CANNY: /* Access to hardware resources */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to running mode, otherwise it returns to the SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read-only registers and write-only registers. <br />
<br />
The user is able to specify the read-only register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Write-only register address can be used as the output target for any functional block on the diagram. Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab IDE, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named "Default Positive Output" at the input of the function block "Copy" and setting the address with the name "Discrete Input/Output Mode Setup Register, IO Channel №0" at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ("Discrete Input Value Register, IO Channel №0"), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== System Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers located in the "State of the controller" addresses directory CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels . Each channel is physically available through corresponding pins of X2 and X3 connectors . Writing and reading data of the respective drivers registers , the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment , etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamic override the channel configuration from the functional diagram in the process of its execution.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 4 pin connector: CAN-H and CAN-L, designed for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=868CANNY 72015-12-30T13:21:31Z<p>CANNY: /* Operation modes */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software upload mode ===<br />
<br />
In this mode, the controller is running bootloader to load firmware, and functional diagram under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW upload mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to running mode, otherwise it returns to the SW download mode.<br />
<br />
=== Running mode ===<br />
<br />
Running mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the controllers' system software.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal running mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read registers (control) and recording registers. <br />
<br />
The user is able to specify the reading register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Recording register address can be used as the output recipient for any functional block on the diagram.Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab environment, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named "standard positive output" at the input of the function block "Copy" and setting the address with the name "channel №0 configuration register» at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ("channel №0 input value register"), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== System Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers located in the "State of the controller" addresses directory CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels . Each channel is physically available through corresponding pins of X2 and X3 connectors . Writing and reading data of the respective drivers registers , the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment , etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamic override the channel configuration from the functional diagram in the process of its execution.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 4 pin connector: CAN-H and CAN-L, designed for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=867CANNY 72015-12-30T13:16:47Z<p>CANNY: /* Software Structure */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 firmware in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software download mode ===<br />
<br />
In this mode, the controller is running boot loader to load system software, and functional blocks under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW download mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to standalone mode, otherwise it returns to the download mode.<br />
<br />
=== Autonomous mode ===<br />
<br />
Standalone mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the system software when loaded.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal standalone mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read registers (control) and recording registers. <br />
<br />
The user is able to specify the reading register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Recording register address can be used as the output recipient for any functional block on the diagram.Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab environment, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named "standard positive output" at the input of the function block "Copy" and setting the address with the name "channel №0 configuration register» at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ("channel №0 input value register"), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== System Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers located in the "State of the controller" addresses directory CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels . Each channel is physically available through corresponding pins of X2 and X3 connectors . Writing and reading data of the respective drivers registers , the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment , etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamic override the channel configuration from the functional diagram in the process of its execution.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 4 pin connector: CAN-H and CAN-L, designed for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNYhttps://wiki.cannylogic.com/index.php?title=CANNY_7&diff=866CANNY 72015-12-30T13:15:29Z<p>CANNY: /* Design and functional operation */</p>
<hr />
<div>'''CANNY 7''' — miniature [[PLC | programmable logic controller]] designed for automotive, domestic and industrial use.<br />
<br />
== General Information ==<br />
<br />
<br />
Due to limited external channels, programmable logic controller CANNY7 may be attributed to a class of smart relays or Nano PLC. CANNY7 is capable of solving many automation, controlling and monitoring tasks.<br />
<br />
CANNY7 is the first programmable logic controller oriented for automotive applications, with the following unique features and combination:<br />
<br />
*rated power supply and IO channels voltage 0 / 12V (18V max);<br />
*the maximum output current of each of the 11 IO channels +/- 120mA, sufficient to control usual automotive relay;<br />
*CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 widely used in modern cars;<br />
*built-in energy consumption management in the range of 5 to 60 mA, helps to conserve battery power during period of inactivity in a car;<br />
*EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;<br />
*wide operating temperature ranged from -40 to + 85 ° C;<br />
*Integrated surge protection and short circuit protection<br />
*compact housing compliant to IP50 enclosure protection specification, suitable for installation and operation as part of a car cabin equipment;<br />
*specialised packages of system and application software to use with automotive CAN and LIN networks.<br />
<br />
To develop custom software for CANNY7, use graphical programming language CFD to quickly create user-effective applications- Functional Diagrams. The free of charge IDE CannyLab contains tools for editing, debugging and writing software to the controller.<br />
<br />
Requirements for writing software to the controller:<br />
*PC with a USB port version 1.1 or higher<br />
*Installed CannyLab IDE<br />
*Ordinary miniUSB cable<br />
<br />
Controllers' memory accessible to user is enough to accommodate the program, consisting of several hundred functional blocks, which allows for fairly sophisticated algorithms.<br />
Each of the 11 IO channels are able to operate in any of the 98 modes that define the voltage, current, and temporal parameters of the input and output signals. In addition, some of the channels can be configured to operate in digital mode, to transmit / receive data of such protocols as 1-Wire, I2C, RS-232, LIN, CAN. The configuration of each channel can be set and adjusted from the user application.<br />
Two-coloured LEDs, controlled from the user application, are useful to indicate controller or debugging mode.<br />
<br />
== Design and functional operation ==<br />
=== The appearance and layout ===<br />
<br />
The main components of CANNY 7 are: a micro controller (MCU) with the auxiliary circuits, power supply system for all controllers' elements, IO channels level matching circuit, electric protection system, connectors and LED, based on a single print board 65 x 23 mm mounted inside a quick-open plastic casing. The controller has three external connectors and one internal. To connect the controller to the power supply and external devices, the kit includes a set of jumper harness.<br />
<br />
*External connector X1 contains four terminals: + 12V input, power input GND, CAN-H and CAN-L.<br />
*External connector X2 contains eight terminals, corresponding to the first eight channels of the controller, from №0 to №7. <br />
*External connector X3 has three terminals, channels accordingly- №8, №9 and №10. Internal connector USB1 is to connect controller to the PC with miniUSB cable.<br />
<br />
[[File:6_2_1_1.png|800px]]<br />
<br />
=== Software Architecture ===<br />
<br />
CANNY 7 is a digital programmable computing control device. CANNY 7 main structural elements are: arithmetic logic unit (ALU), internal memory, commands execution management subsystem and input-output system.<br />
<br />
[[File:6_2_2_1.png|800px]]<br />
<br />
Arithmetic Logic Unit is the processing core of CANNY 7. ALU provides system software and user functional execution diagram placed into the internal memory of the controller.<br />
Controller's internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command's management subsystem is responsible for switching and setting mode of the controller. The IO system provides controllers' communication to the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.<br />
<br />
=== Software Structure ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_2_3_1.png|250px]]<br />
</div><br />
Software CANNY 7 consists of: a bootloader, system software (operating system and drivers), and a custom function diagram.<br />
<br />
The bootloader provides the controller with the software download mode, organising data transmission between CANNY 7 and PC using USB protocol. It checks the data integrity transmitted from the PC and loading to the controllers' internal memory. The bootloader placed into the internal memory of the controller during production and can not be deleted or modified by the user. The manufacturer distributes CANNY 7 system software in CCX file format. It includes an operating system and a set of drivers providing function diagram execution and its interaction with the controllers' resources. The contents of various CCX files can be reloaded into the controller by user but user is restricted to modify CCX file content.<br />
<br />
Custom block diagram is created and modified in CannyLab IDE, then it can be loaded into the controller where it specifies the algorithm to work standalone or saved in to CFD file.<br />
<br clear="all"><br />
<br />
== Operation modes ==<br />
<br />
There are several operation modes to perform basic operations with controller.<br />
<br />
=== Software download mode ===<br />
<br />
In this mode, the controller is running boot loader to load system software, and functional blocks under CannyLab management. Controller switch to this mode automatically when connected to PC with USB cable. During the transition to SW download mode the controller performs a master reset: the functional diagram execution stops, IO channels are switching to neutral state, built-in green LED turns on. When controller establishes communicating with the PC software, the green LED goes into a flickering mode. Exit from this mode happens automatically when the connection to the PC is disrupted. If at the end of the software download mode , EEPROM have system software loaded correctly, the controller will switch to standalone mode, otherwise it returns to the download mode.<br />
<br />
=== Autonomous mode ===<br />
<br />
Standalone mode is the main controllers' mode. In this mode, the controller is running continuously under system software sequence, in an endless cycle, performing the functional diagram, working on the algorithm specified by the user. Transition to this mode takes place automatically when the controller is connected to an external 12V power supply and the absence of the USB connection.<br />
When operating in this mode, the functional diagram has access to all resources of the controller and drivers included in the system software when loaded.<br />
<br />
=== Sleep mode ===<br />
<br />
This mode is an option of normal standalone mode in which, after each cycle of execution of a function diagram, the controller pauses to reduce its power consumption to a minimum. Thus, the controller operates in a pulsed mode, periodically "asleep" and "waking up". Enable, disable, and configure the parameters of this mode are controlled by the functional diagram. Using this mode is relevant when developing systems, focused on battery-power, such as the on-board car equipment.<br />
<br />
== Runtime Environment ==<br />
<br />
=== Functional diagram presentation ===<br />
<br />
The graphical block diagram developed in CannyLab environment, automatically processed by the translator just before loading to the controller. CannyLab checks on the consistency of the diagram, determines function blocks execution order and converts the diagram into the executable code - a sequence of machine instructions CANNY 7 controllers' ALU.<br />
<br />
=== The execution order ===<br />
<br />
<div style="float:left;padding-right:1em;"><br />
[[File:6_4_2_1.png|450px]]<br />
</div><br />
<br />
Executable program code during loading into the controller already contained system software, is including in the sequence of the system software machine instructions. Thus, the aggregate command sequence loaded with system software and functional diagram, will be: initialisation routines executed once after each controllers' reset and executable functional diagram code, framed with the controller resources' procedure management, and placed in an infinite executable loop - diagrams running loop. Some of the drivers included in the controller system software, such as CAN driver, require controller to raise immediate response during data transmission and reception of program events. Program code of these drivers asynchronously processed by the controller in parallel with the main execution flow. In the processing of asynchronous drivers calls, the diagrams main run loop performance is briefly suspended.<br />
<br clear="all"><br />
<br />
=== Access to hardware resources ===<br />
<br />
All available resources to the user from the functional diagram : the system resources of the controller, IO subsystem and additional drivers included in the system software, appears on a controllers' internal memory protected address space. This address space is divided into read registers (control) and recording registers. <br />
<br />
The user is able to specify the reading register address as a source of input data from virtually any function block of a diagram. Thereby extract and use to implement their own algorithms, data received by the controller from the outside world. For example information about the electric potential on any controllers' terminal, or the data packet contents received from the CAN bus. Recording register address can be used as the output recipient for any functional block on the diagram.Thus, the user controls the resources of the controller from functional diagrams which gives an opportunity to influence the objects of the outside world. For example: switch external relay by changing the electrical potential on one of the pins of the controller, turn LED on; set CAN operation mode; send a data packet.<br />
<br />
The most resources used includes assignment required operating parameters, such as the polarity of the output channels, the polarity and the sensitivity of the input channels, CAN communication speed and so on.<br />
<br />
Specifying these parameters is made in the form of recording specific constants in one or a few specific registers, depending on а required set of resources configuration. For example, copying a constant with a value of 121 in the register located at 2432 address is set channel №0 to an output positive polarity mode.<br />
<br />
[[File:6_4_3_1.png|center]]<br />
<br />
In CannyLab environment, for user convenience, all the of the controllers' available registers are named, as well as all special constants that are used in interaction with the controllers' resources. Therefore, for CannyLab user this operation will look as setting the constants named "standard positive output" at the input of the function block "Copy" and setting the address with the name "channel №0 configuration register» at its output.<br />
<br />
[[File:6_4_3_2.png|center]]<br />
<br />
Having thus established channel №0 mode, by the appearance of the value "1" in the register located at 2465 address ("channel №0 input value register"), we can learn about the application of a positive electric potential to №1 terminal of X2 connector.<br />
<br />
== System Registers ==<br />
<br />
=== System Registers ===<br />
<br />
:''Main article'': '''[[CANNY 7, System Registers]]'''<br />
<br />
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The list of system resources registers located in the "State of the controller" addresses directory CannyLab, which is available to the user via IO context menu "Address" type of the function blocks.<br />
<br />
=== Discrete Inputs and Outputs ===<br />
<br />
:''Main article'': '''[[CANNY 7, Discrete IO Driver]]'''<br />
<br />
CANNY 7 users have access to eleven discrete general purpose IO channels . Each channel is physically available through corresponding pins of X2 and X3 connectors . Writing and reading data of the respective drivers registers , the functional diagram can manage the electric potential in each of these contacts and getting information about the current potential of each of them.<br />
The channel physical characteristics allow connection to a variety of external actuators such as: electromagnetic relays, small motors, LEDs. As an external digital input signal, it is possible to use a mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V and transistor outputs of various equipment , etc.<br />
<br />
Channels operation mode and parameters specified by function diagram. At any given time, the channel can only work in one of the possible modes, but it is possible to dynamic override the channel configuration from the functional diagram in the process of its execution.<br />
<br />
=== High Resolution PWM ===<br />
<br />
:''Main article'': '''[[CANNY 7, HR PWM Driver]]'''<br />
<br />
Two of the eleven IO channels (Channel №1 and №2) CANNY 7 are able to work in high-resolution pulse-width modulator mode. The channels may be activated independently of each other and have a configuration independent duty cycle and line pull-up, however, the high-resolution PWM period is a common parameter to both channels. In HR PWM mode, the PWM timing parameters - the period and duty cycle are set in the range of from 2 to 20,000 microseconds, in 1 microsecond increments.<br />
<br />
HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up or external pull-up) or with the internal pull-up to +12V (specified by setting value in the appropriate register ). In this mode, the channel is asynchronous to functional diagram, which allows for maximum stability of generated signal timing parameters.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In the high-resolution pulse width modulator the electrical short circuit protection is disabled! Overload or channels short circuit being in RF PWM mode can cause damage to controller!''<br />
|}<br />
<br />
=== UART / RS232 / Modbus driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, UART Driver]]'''<br />
<br />
Two of eleven IO channels (#9 and #10) CANNY 7 supports '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''', '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' serial protocols data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.<br />
<br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' implementation in CANNY 7 controllers allows to organize serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY7 may have two independent connections using the <br />
'''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' protocol. Monitoring of the data link status should be done from the functional diagram. If the channel is free, the device may start data transmitting , otherwise the device should wait for the line release.<br />
<br />
'''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' implementation by using both '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' data channels , allows to exchange data with other '''[https://en.wikipedia.org/wiki/RS-232 RS-232]''' device in a duplex mode, i.e. one channel to perform data sending and on the other to simultaneously receive data.<br />
<br />
'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' protocol in CANNY7 controllers implemented as over '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]''' as over '''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''. As ADU (Application Data Unit) used compact binary option Modbus RTU. Checking the data integrity carried out by automatically calculated checksum (CRC). Package size is limited to 16 bytes including the CRC.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''For correct operation of all protocols based on the UART / RS-232 requires that all GND terminals of the devices committing communication, were given to a single potential ("common ground"). ''<br />
|}<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''In UART implementation-active line is the potential GND 100mA, passive - positive potential of a given internal or external channel pull-up. In implementing RS-232 - the potentials inverse.''<br />
|}<br />
<br />
Driver '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' operates using controllers' channels resources, but has a higher priority than a discrete input-output driver. Thus, upon activation of '''[https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter UART]'''/'''[https://en.wikipedia.org/wiki/RS-232 RS-232]'''/'''[https://en.wikipedia.org/wiki/Modbus Modbus]''' driver, for channels involved in its operation, a value changes in registers associated with discrete input-output driver, will be ignored.<br />
<br />
=== CAN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, CAN Driver]]'''<br />
Two special external terminals of CANNY 7 controller, located on the 4 pin connector: CAN-H and CAN-L, designed for connection to digital information '''[https://en.wikipedia.org/wiki/CAN_bus CAN-bus]'''.<br />
<br />
=== LIN driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, LIN Driver]]'''<br />
<br />
Two of eleven input-output channels of CANNY 7, which can be placed under control of UART/RS-232 driver (Channel №9 and №10), can be used to organize data reception and transmission as two independent '''[https://en.wikipedia.org/wiki/Local_Interconnect_Network LIN]''' driver channels. <br />
<br />
LIN driver channels can be connect both together and individually, have individual baud rate settings , pull-up line and bus node type- MASTER or SLAVE.<br />
<br />
LIN driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon LIN driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
=== I²C driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, I²C Driver]]'''<br />
<br />
As communication lines (SDA and SCL) can be assigned any pair of channels CANNY 7 controller. At the same time, these channels should be pulled-up to 5V with resistor 1 - 10k Ohm from the outside. The peculiarity of '''[https://en.wikipedia.org/wiki/I%C2%B2C I²C]''' protocol implementation is that CANNY 7 controller can act only as a Master node. Data exchange between devices, that can be both single and bi directional, takes place in separate sessions, i. e. opening multiple sessions with different devices is not allowed. The maximum length of the message within one session I²C of 16 bytes. Exchange rate is fixed to 100 kbit/s. The total number of slaves on the line can reach several tens.<br />
<br />
Driver I²C operates using controller channels' resources , but has a higher priority than discrete input-output driver. Thus, upon activation I²C driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver, will be ignored.<br />
<br />
=== Dallas 1-Wire driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, Dallas 1-Wire Driver]]'''<br />
<br />
CANNY 7 controller can be used as a MASTER in a single-wire data network '''[https://en.wikipedia.org/wiki/1-Wire Dallas® 1-Wire®]'''.<br />
<br />
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.<br />
<br />
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.<br />
<br />
=== User Preprogrammed Parameters ===<br />
<br />
:''Main article'': '''[[CANNY 7, User Preprogrammed Parameters]]'''<br />
<br />
The custom configuration parameters can be specified by the end user at the time the controller loading a software using [[Firmware Update Utility]]. After software downloading and controller run in standalone mode, parametrs set by user so, become available in the relevant functional diagram of the controller registers.<br />
<br />
Proper use of user-defined parameters significantly increases the flexibility and versatility of the controller-based solutions, enabling the end user without the skills to work with CannyLab, make safe changes in controller operation algorithm, using a simple user interface.<br />
<br />
=== EEPROM Non-volatile Memory ===<br />
<br />
:''Main article'': '''[[CANNY 7, EEPROM]]'''<br />
<br />
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.<br />
<br />
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.<br />
<br />
{|<br />
|valign="top" style="padding-left:0.5em;"|''Note:''<br />
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration.''<br />
|}<br />
<br />
=== Infrared Remote Control Driver ===<br />
<br />
:''Main article'': '''[[CANNY 7, IRRC Driver]]'''<br />
<br />
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels used.<br />
<br />
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.<br />
<br />
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.<br />
<br />
== Specifications ==<br />
<br />
=== Electrical characteristics and environmental requirements ===<br />
{|<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Supply voltage<br />
|valign="top" style="padding-left:0.5em;"|9...18 V<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|Current consumption:<br />
|valign="top" style="padding-left:0.5em;"|in operation (no more than)<br />
|valign="top" style="padding-left:0.5em;"|55 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;"|<br />
|valign="top" style="padding-left:0.5em;"|in power saving mode (not more)<br />
|valign="top" style="padding-left:0.5em;"|5,5 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|The maximum current of each channel in output mode<br />
|valign="top" style="padding-left:0.5em;"|+120 мА / -120 mA<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Channel resistance in input mode <br />
|valign="top" style="padding-left:0.5em;"|4 К or 200 К<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Operating temperature range<br />
|valign="top" style="padding-left:0.5em;"|-40<sup>о</sup>С...+85<sup>о</sup>С<br />
|- valign="top"<br />
|valign="top" style="padding-left:0.5em;" colspan="2"|Ingress Protection Rating<br />
|valign="top" style="padding-left:0.5em;"|IP50<br />
|}<br />
<br />
Electrical circuits protection:<br />
<br />
*from channel short-circuit - software;<br />
*from channel overload - internal current-limiting fusing resistorsи;<br />
*from power supply reverse polarity - internal diode;<br />
*high emissions suppression circuit during inductive loads switching on channels №0 to №7 - diode and varistor;<br />
*high emissions suppression circuit during inductive loads switching on channels №8 to №10 — absent.<br />
<br />
=== Safety Precautions ===<br />
<br />
The circuits of the controller has not life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller and maintenance are made only with the power off, the controller and connected devices..<br />
<br />
=== Installation and connection ===<br />
<br />
Installation and connection of the controller must be carried out only by qualified personal studied this documentation. Controller installation must be carried out in suitable areas to operation conditions of the controller.<br />
<br />
Do not allow moisture to output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids , alkalis, and other corrosive substances.<br />
<br />
Installing the controller and the cables laying connected to it must be done at a distance of not less than 0.3 meters from the high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.<br />
<br />
=== Transportation and storage ===<br />
<br />
Controllers transported by all types of covered transportation . Placing and securing the shipping container with the packed devices in vehicles must provide their stable position and to prevent movement during transport.<br />
<br />
Transportation and storage should be carried out at ambient temperatures from minus -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.</div>CANNY