Project

General

Profile

Main » History » Revision 34

Revision 33 (Torbjorn Carlqvist Admin, 11/05/2023 10:27 AM) → Revision 34/36 (Torbjorn Carlqvist Admin, 11/06/2023 09:08 AM)

h1. Then LION fieldbus concept 

 > LION is a joint venture between DAVITOR AB and Naronic AB 

 The concept consists of the following parts: 
 * Field bus specification 
 * Hardware form factor 
 * Source code 

 The bus is fundamentally an i2c bus and the IO-modules along the bus is slaves controlled by one master. 

 h3. Highlights 

 * All slaves share same i2c address independent of the number of slaves. This lowers the complexity in the Master code when the whole bus looks like a single i2c slave device independent of the number of modules. 
 * Data points as channels. 
 Currently supported channel types in the standard: 
 ** AL - Alert Channel. Special event channel to read when then ALERT line goes low. 
 ** AI - Analog Input 
 ** AO - Analog Output 
 ** DI - Digital Input 
 ** DO - Digital Output 
 ** SI - Input Stream. Forwards log text or serial data etc. to Master. 
 ** DA - Dali lightning control 
 * A dedicated ALERT line telling the master to read the alert channel 
 * Supports firmware boot loading of the slave modules over the filed bus. 

 !LION.png! 

 * Config - This is a daisy changed link that goes _through_ all slave modules. This line is used when performing channel setup but also when there is a need for stepping the bus for single modules access. Typically for maintenance, firmware upgrade etc. 
 * Alert - Goes low if a slave module needs to tell the master to read data. 
 * Clock - Clock signal 
 * Data - Data signal 
 * Power - The power supply for the slave module bus circuitry. Typically 3.3v. 
 * High Power - Typically 12v-24v that can be used when there is high power consumers internally or external from the module. Eg. motors, solenoids and lightning. 
 * Reset - When held low all modules bus chip will be rebooted. 
 * GND - Common ground for both Power and High Power lines. 

 h3. The channel concept in LION 

 All data points on a LION bus has a channel number assignment within it's channel type context. 
 Eg. If the device has three modules with 4 DO points each the total number of DO _channels_ are 12. After the initial (usual factory preset) channel assignment process is done the master will only work with channels, not modules and points. 

 h3. Bus modes and adresses 

 The LION Bus operates in three modes. 
 * Data (0x28) - Normal operational mode 
 * Config (0x2C) - Halted operation while each module are acceded individually. 
 * Bootloader (0x33) - I used when modules need firmware upgrade 

 h3. LION Tool 

 A java software called LionTool can be downloaded to handle all operation needed for test and maintain the bus. The software act as the Master and supports all three bus modes. 
 LionTool uses same java driver to become a LION master as the DTXr. 

 To install, first make sure you are in /home/admin/liontool, create the folder if not exists, then you can download from davitor repository by 

 Create if not exists 
 <pre> 
 mkdir /home/admin/liontool;cd liontool 
 </pre> 
 Else 
 <pre> 
 cd liontool 
 </pre> 
 Donwload 
 <pre> 
 wget --user admin --password **** https://artifacts.davitor.com/repository/davitor-mvn-release/com/davitor/multigrator/lion/3.1/lion-3.1-app.zip 
 </pre> 
 Unzip the file and chose to Overwrite All if you have a previous version installed. 
 <pre> 
 unzip lion-3.1-app.zip 
 </pre> 

 Consult DAVITOR for correct version and password to use! 

 %{color:red}If project:DTXr is installed and running it is important to stop that service first!% 
 <pre>sudo systemctl stop dtx</pre> 


 *    For automatic module setup with channel adress assignment use option -a as: 
 <pre> 
 sudo java -jar lion-3.1.jar -a 
 </pre> 
 *    For test mode only where a test menu will be shown use: 
 <pre> 
 sudo java -jar lion-3.1.jar 
 </pre> 
 *    There are optional inputs to liontool setting for each of the lion-specific pin routing. setting. This is useful when a non-raspberry platform is used. 
 -i2c: Path to i2c device to use 
 -fl: factory reset line (if supported) 
 -rl: reset line 
 -gcl: GPIO bus config line 
 -hcl: HMI bus vonfig line 
 -al: Alert line 

   Example for a Banana PI Zero setup: 
 <pre> 
 sudo java -jar lion-3.1.jar -i2c /dev/i2c-0 -fl 14 -rl 3 -gcl 1 -hcl 0 -al 6 
 </pre> 

 NOTE: Ignore the error message about PatterMatch. 

 %{color:red}If project:DTXr is installed you can start it again now!% 
 <pre>sudo systemctl start dtx</pre> 

 h3. Bootloader 

 It is possible to update the LION modules on the field bus. 
 Simply copy the new module firmware to same directory where you have the lion tool unpacked. 
 Perform a "-a" operation and the tool will update each and one of the modules with the files you have supplied. 
 The bootloader will try to match a file in the directory to the module hardware type. 
 lets say you have a Hw1 module (4R8DI) on the bus. Then if you place a file with pattern "4RC-hw001-va003-ve004.hex" in the directory the module will be updated to Variant 3 and Version 4. 
 You can have multiple files for different module hardware types but you will get an error if you place more than one file for same hardware type.