This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
nblocks:n-blocks_studio [2019/09/26 05:55] faizan |
nblocks:n-blocks_studio [2020/02/21 17:56] (current) engineer [Studio Firmware Classes] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | * As professionals, we were already using n-Blocks platform for project development, and standard firmware development tools. We soon realised that to promote the platform to new embedded system developers /users, it would be important to have an easy to use and unconventional IDE. So, we decided to create one | + | =====n-BlocksStudio===== |
+ | |||
+ | |||
+ | * <fs medium>**n-BlocksStudio** is a programming environment which facilitate an easy way to develop applications with n-Blocks based embedded systems or Internet of Things hardware.</fs> | ||
- | * The aim is to be able to develop without having to write code (although, possible in more specific cases) | + | * <fs medium>The main requirement in the design of n-BlocksStudio was to enable users to develop applications without having to write code (although this may not always be possible).</fs> |
- | * The IDE uses the Flow Based Design paradigm, using interconnected nodes to generate underlying code | + | * <fs medium>The IDE uses the Flow Based Design paradigm, using interconnected nodes to generate underlying code</fs> |
- | * Code runs in a **soft-realtime*** firmware system (similar, but not as complex as, an embedded operating system) | + | * <fs medium>The code that is created by n-BlocksStudio runs in a <color #ed1c24>soft-realtime*</color> firmware system (similar to, but not as complex as an embedded operating system)</fs> |
- | * Our first attempt was based on node-RED code base, but we soon realised that a development from zero-base using Python provided a better development roadmap | + | * <fs medium>Inititally, we used node-RED code base for the first prototype, but soon realized that a development from scratch using Python provided a better development roadmap</fs> |
- | * Our current n-BlocksStudio runs locally on a PC, making use of OpenGL 3D rendering for visual friendliness | + | * <fs medium>The current n-BlocksStudio runs locally on a PC, making use of OpenGL 3D rendering for attracting visualization</fs> |
- | * Logic and behaviour of nodes is downloaded as Libraries from a public server | + | * <fs medium> The Logic and behaviour of nodes is downloaded as Libraries from a public repository</fs> |
- | * The public server hosts libraries written by the team as well as by the users, who can contribute sharing nodes with the whole user community | + | * <fs medium>The public server hosts libraries written by the n-Blocks team as well as by the users, who contribute and share nodes with the n-Blocks user community</fs> |
Line 23: | Line 26: | ||
- | * **soft-realtime** means tasks are guaranteed to perform in the average time, but timing for each task is not precise – as opposed to hard-realtime, in which the time for each task is strictly met and deterministic | + | |
+ | |||
+ | <color #ed1c24>*soft-realtime</color> means tasks are guaranteed to perform in the average time, but timing for each task is not precise – as opposed to hard-realtime, in which the time for each task is strictly met and deterministic | ||
+ | |||
+ | {{youtube>Vm655T1XvKE}} | ||
+ | |||
+ | |||
+ | |||
+ | =====Flow based programming===== | ||
+ | In computer programming, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented. | ||
+ | FBP is a particular form of dataflow programming based on bounded buffers, information packets with defined lifetimes, named ports, and separate definition of connections. | ||
+ | https://en.wikipedia.org/wiki/Flow-based_programming | ||
+ | <WRAP centeralign>{{:nblocks:Picture1-flowbased-programming.png?300|}}</WRAP> | ||
+ | |||
+ | =====J. Morrison; Flow based programming===== | ||
+ | In computer programming, Flow-Based Programming (FBP) is a programming paradigm, discovered/invented by J. Paul Rodker Morrison in the late '60s, that uses a "data processing factory" metaphor for designing and building applications. FBP defines applications as networks of "black box" processes, which communicate via data chunks (called Information Packets) travelling across predefined connections (think "conveyor belts"), where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.https://jpaulm.github.io/fbp/ | ||
+ | <WRAP centeralign>{{:nblocks:Picture2-J.Morrison-Flow-Based-Programming.jpg?600|}}</WRAP> | ||
+ | |||
+ | |||
+ | =====Develop Application with Diagrams===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture3-Develop-application-with-Diagrams.jpg?600|}}</WRAP> | ||
+ | <WRAP centeralign>{{:nblocks:Picture4-Develop-with-Diagrams-reduce-complexity.jpg?600|}}</WRAP> | ||
+ | * IDE to develop application with Diagrams | ||
+ | * No need to write code, just use nodes and connections | ||
+ | * Reduced complexity | ||
+ | * Modularity | ||
+ | * Expandable Library of Nodes | ||
+ | * Friendly for | ||
+ | * Makers, new firmware developers | ||
+ | * Experienced embedded developers | ||
+ | |||
+ | |||
+ | =====Behind the Nodes===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture5-Behind the nodes.jpg?600|}}</WRAP> | ||
+ | * What is behind the Node-Diagram: Embedded C++ code | ||
+ | * Execution of code is managed by the underlying lightweight nBlocksStudio RTkernel | ||
+ | |||
+ | |||
+ | =====nBlocksStudio-RTkernel===== | ||
+ | **PERIOD 1mS** | ||
+ | |||
+ | * [DATA BETWEEN NODES] Each connection object retrieves data from the source node (PREVIOUS CYCLE OR INITIAL VALUES) and sends them to the destination node | ||
+ | |||
+ | * [INSIDE NODE] The step Method of each node is called: | ||
+ | * Actual operation is node specific, LIKE: | ||
+ | * Shifting a FIFO | ||
+ | * Perform calculations | ||
+ | * Get from UART hardware buffer and send to a FIFO | ||
+ | * Read Inputs | ||
+ | |||
+ | =====n -BlocksStudio Server===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture6-n-BlocksStudio Server.jpg?600|}}</WRAP> | ||
+ | nBlocksStudio Server | ||
+ | * Contribution model and registered users | ||
+ | * Downloadable Nodes | ||
+ | * New Nodes are contributed by users and the n-Blocks team | ||
+ | |||
+ | =====n -BlocksStudio Server My_nodes===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture7-n-BlocksStudio-Server-My_nodes.jpg?600|}}</WRAP> | ||
+ | |||
+ | |||
+ | |||
+ | =====Binary Counter Example created code===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture9-Binary-counter-Example-perspective.jpg?1000|}}</WRAP> | ||
+ | <WRAP centeralign>{{:nblocks:Picture8-Binary-counter-Example-created-code.jpg?1000|}}</WRAP> | ||
+ | |||
+ | =====Binary Counter Example code is running in n-Block===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture10-nBlockStudio Binary Counter Example code is running in n-Block.JPG?1000|}}</WRAP> | ||
+ | |||
+ | =====JBinary Counter Example code is running in third party board===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture11-nBlockStudio Binary Counter Example code is running in third party board.JPG?600|}}</WRAP> | ||
+ | |||
+ | =====Studio [NOT Node] Class Code===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture12-Node-class-code.jpg?600|}}</WRAP> | ||
+ | <WRAP centeralign>{{:nblocks:Picture13-Node-class-header.jpg?600|}}</WRAP> | ||
+ | |||
+ | =====ADC to serial port example===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture14-ADC-to-serialk-port-example.jpg?600|}}</WRAP> | ||
+ | This Diagram reads an ADC every 1000ms and sends the data in readable form to UART serial channel | ||
+ | |||
+ | =====ADC to serial port example Compilation ===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture15-ADC to serial port example.jpg?600|}}</WRAP> | ||
+ | |||
+ | =====ADC to serial port example main.cpp ===== | ||
+ | |||
+ | <WRAP centeralign>{{:nblocks:Picture16-ADC to serial port example.jpg?600|}}</WRAP> | ||
+ | |||
+ | |||
+ | =====[ADC-Node] C++ microprocessor code ===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture17-ADC-Node-Cpp-microprocessor code.JPG?1000|}}</WRAP> | ||
+ | |||
+ | =====Studio Firmware Classes===== | ||
+ | <WRAP centeralign>{{:nblocks:Picture18-Studio Firmware Classes.jpg?1000|}}</WRAP> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||