SlideShare a Scribd company logo
1 of 30
Download to read offline
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
1
Utilizing Scilab and Xcos
for real-time control
and measurement applications
Grzegorz Skiba
Embedded Solutions
skiba.g@embedded-solutions.pl
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
2
Agenda
 MicroDAQ device and software overview
 MicroDAQ toolbox for Scilab
 Features overview
 Code generation for MicroDAQ DSP core
 Tools
 Examples
 Q&A
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
3
MicroDAQ device
 Real-time control and measurement system
 Dedicated DSP core for signal
and real-time processing
 Ethernet, USB2.0 and WiFi connectivity
 ADC, DAC, DIO, PWM, Encoder,...
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
4
MicroDAQ device
MicroDAQ E1100
 375MHz CPU
 4GB flash memory
 Ethernet
 Wi-Fi
 USB2.0
 32 DIO lines
 8 analog inputs
 8 analog outputs
 Matlab/Simulink, LabVIEW
and Scilab support
 Price from 200€
MicroDAQ E2000
 up to 456MHz CPU
 up to 32GB flash memory
 Ethernet
 Wi-Fi
 USB2.0
 16 DIO lines
 up to 16 analog inputs
 8 analog outputs
 Matlab/Simulink, LabVIEW,
Scilab support
 Price from 400€
MicroDAQ OEM
 375MHz CPU
 4GB flash memory
 Ethernet
 USB2.0
 USB1.1
 32 DIO lines
 8 analog inputs
 8 analog outputs
 Matlab/Simulink, LabVIEW,
Scilab support
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
5
MicroDAQ device
 Processing units
 TI C6000 DSP core with floating/fixed point unit
 ARM core with Linux OS for handling communication,
file storage, web interface
 two PRU 32-bit RISC cores for real-time processing

Storage up to 32GB

Digital I/O
 16/32 DIOs, 6 PWMs, 2 Encoders, UART

Analog I/O
Analog input Analog output
166ksps, 8 channel, 12-bit, ±10V range
166ksps, 8 channel, 16-bit, ±10V range
600ksps, 8 channel, 12-bit, ±10V range
600ksps, 16 channel, 12-bit, ±10V range
500ksps, 16 channel, 16-bit, ±10V range
4000ksps, 2 channel, 16-bit, ±10V range
8 channel, 12-bit, 0-5V range
8 channel, 12-bit, ±10V range
8 channel, 16-bit, ±10V range
Simultanious sampling ADCs
C6000 DSP
375/456MHz
Floating/fixed
point
ARM
375/456MHz
with Linux
PRU0
187/228MHz
32-bit RISC
PRU1
187/228MHz
32-bit RISC
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
6
MicroDAQ software
 MLink software
 Windows/Linux support
 Access to MicroDAQ resources
 Loading DSP
 Scilab support functions
 DSPLib
 LabVIEW support package
 Matlab/Simulink Embedded Coder target
 MicroDAQ toolbox for Scilab
Available at: https://github.com/microdaq
Host
MLink library
Linux/Windows
UDP/TCP
Ethernet
Wi-Fi
Scilab/Xcos
LabVIEW
Matlab/Simulink
C/C++ application
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
7
MicroDAQ toolbox features
 Automatic code generation for MicroDAQ DSP
 Xcos for MicroDAQ peripherals
 Live data access from generated DSP
application via Ethernet and WiFi
with standard Xcos sinks
 Application loading with Ethernet and WiFi
 Standalone mode
 Easy integration of custom user C code
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
8
MicroDAQ toolbox features
 MicroDAQ hardware (ADC, DAC...) access
macros
 DSP model utilization with Scilab script, C/C++
application and LabVIEW
 Execution profiling
 Toolbox as a part for Atoms installer
 Support for Linux and Windows
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
9
MicroDAQ toolbox components
Texas Instruments
Code Composer Studio 5
C6000 DSP compiler
SYS/BIOS RTOS
MicroDAQ
Toolbox
Loading DSP binary
TCP data communication
MLink
DSP drivers for MicroDAQ
TCP data communication
DSPLib
Precompiled Scilab
libraries for DSP core
Scilab libs
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
10
Installation
 Atoms → Instrumentn Control → MicroDAQ Toolbox
 Install Code Composer Studio 5.5 – with C6000 DSP compiler
and SYS/BIOS RTOS
 microdaq_setup
 Code Composer Studio
installation paths
 SYS/BIOS RTOS compilation
 connect MicroDAQ device
and setup IP settings
 check connection
-->mdaq_ping
Connecting to MicroDAQ@10.10.1.1...OK!
 Ready to go!
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
11
MicroDAQ toolbox blocks
 MicroDAQ blocks for
hardware access
 Special MicroDAQ blocks for
setup model parameters
 Standard Xcos blocks
compiled for DSP
 Host simulation mode
and code generation
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
12
MicroDAQ special blocks
 SETUP block
 Simulation duration
 Build type: debug/release
 Build mode: Ext/Standalone
 Execution profiling
 ODE solver type
 SIGNAL block
 receive live data from DSP
 STOP block
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
13
Xcos diagram for code generation
 SETUP block
 Event generator to set step time
 Superblock for code generation
 Tools → MicroDAQ build
and load model
 Execution mode
 Standalone – load and start model
on DSP immediately
 Ext – load model on DSP and wait
for user action
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
14
Model execution modes
Model
(Real-time task)
TCP communication
(Idle task)
DSP application
MLink
TCP communication
Xcos
Model
(Real-time task)
DSP application
Ext mode
Standalone mode
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
15
Code generation
### Generating block structure...
### Writing generated code...
### Generating Makefile...
### Generating binary file...
"C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740…
"C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740…
"C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740…
"C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740…
<Linking>
"MicroDAQ DSP application led_demo.out created successfully"
Xcos
diagram
mdaq_ext_main.c or
mdaq_standalone_main.c
C code generation
C6000 DSP compiler
C6000 linker
SYS/BIOS RTOS
DSPLib
MicroDAQ blocks
Scilab libs
DSP binary
Makefile generation
SETUP block
Loading DSP binary
User blocks lib
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
16
Running DSP application with Xcos
simulation
MicroDAQ DSP Xcos
Code generation
Loading DSP on targetInitialize model execution
create TCP server
Wait for connection
Xcos Start button action
connects to MicroDAQ and
starts Xcos simulation
Create connection with host
Execute model
and send data with
SIGNAL block
Xcos simulation
receive data with SIGNAL block
Xcos diagram
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
17
Running DSP application with Xcos
simulation
Generated DSP code
int sin_demo_isr(double t)
{
int local_flag;
int i;
double *args[100];
/* Output computation */
/* Discrete activations */
/* Blocks activated on the event number 1 */
/* Call of 'mdaq_sinus' (type 4 - blk nb 2) */
block_sin_demo[1].nevprt = 1;
local_flag = 1;
mdaq_sinus(&block_sin_demo[1],local_flag);
/* Call of 'mdaq_signal' (type 4 - blk nb 3) */
block_sin_demo[2].nevprt = 1;
local_flag = 1;
mdaq_signal(&block_sin_demo[2],local_flag);
/* Call of 'cscope' (type 4 - blk nb 4) */
block_sin_demo[3].nevprt = 1;
local_flag = 1;
cscope(&block_sin_demo[3],local_flag);
return 0;
}
Xcos simulation
● When DSP is loaded
SIGNAL input is ignored
● SIGNAL block receives
data from MicroDAQ
● When DSP in not loaded
copy SIGNAL block input
to output
● mdaq_signal() funciton puts data
to IDLE communication task
● cscope() function is empty
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
18
DC motor controller
● Sample time: 0.001s
● Discrite PD controller
● H-bridge for driving
DC motor
● Live data with standard
CSCOPE block
● Loging data to workspace
with standard 'To
workspace' block
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
19
Execution profiling
 Measure model execution time
 Optimization
 How 'fast' we can run model
 Execution profiling macros
 mdaq_exec_profile
 mdaq_exec_profile_show
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
20
Custom user code
 For new user creating custom block is a tough task
 Block code and C code generation
 Created code can be compiled for debug and
release
 Block creation utility macros
 mdaq_block();
 mdaq_block_add();
 mdaq_block_build( %t );
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
21
User custom code
-->my_block = mdaq_block();
-->my_block
my_block =
name: "new_block"
desc: "Set new_block parameters"
param_name: [2x1 string]
param_size: [2x1 constant]
param_def_val: list
in: 1
out: 1
-->my_block.param_name
ans =
!param1 !
! !
!param2 !
-->mdaq_block_add(my_block);
/* Generated with MicroDAQ toolbox ver: 1.0. */
#include "scicos_block4.h"
extern double get_scicos_time( void );
/* This function will executed once at the beginning of model execution */
static void init(scicos_block *block)
{
/* Block parameters */
double *params = GetRparPtrs(block);
/* param size = 1 */
double param1 = params[0];
/* param size = 1 */
double param2 = params[1];
/* Add block init code here */
}
/* This function will be executed on every model step */
static void inout(scicos_block *block)
{
/* Block parameters */
double *params = GetRparPtrs(block);
/* param size = 1 */
double param1 = params[0];
/* param size = 1 */
double param2 = params[1];
/* Block input ports */
double *u1 = GetRealInPortPtrs(block,1);
int u1_size = GetInPortRows(block,1); /* u1_size = 1 */
/* Block output ports */
double *y1 = GetRealOutPortPtrs(block,1);
int y1_size = GetOutPortRows(block,1); /* y1_size = 1 */
/* Add block code here (executed every model step) */
}
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
22
MicroDAQ hardware access macros
link_id = mdaq_open();
ai_data = mdaq_ai_read(link_id, [1 2 3 4 5 6 7 8], 10, 1)
mdaq_close(link_id);
 Access to MicroDAQ hardware
without code generation
 Example
 IP settings managment
 Switching from Ethernet to Wi-Fi
mdaq_pwm_write
mdaq_pwm_init
mdaq_pru_set
mdaq_pru_get
mdaq_led_write
mdaq_key_read
mdaq_hs_ai_read
mdaq_hs_ai_init
mdaq_enc_read
mdaq_enc_init
mdaq_dio_write
mdaq_dio_read
mdaq_dio_func
mdaq_dio_dir
mdaq_ao_write
mdaq_ai_read
Scilab macros: mdaq_ping, mdaq_set_ip
mdaq_set_ip('10.10.2.1');
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
23
Model utilization
LabVIEW
Scilab script
Xcos
C/C++
application
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
24
Utilizing DSP model in Scilab script
// Start DSP application
result = dsp_start('fft_demo_scigfft_demo.out');
// Register signal ID and signal size
dsp_signal(123, 1);
first_time = 1;
a = [];
// Process data from DSP
sample_count = 500;
for i=1:500
[result, s] = dsp_signal_get(sample_count);
t = 0:1/sample_count:1;
N=size(t,'*'); //number of samples
y=fft(s');
f=sample_count*(0:(N/2))/N; //associated frequency vector
n=size(f,'*')
if first_time == 1 then
clf()
plot(f,abs(y(1:n)))
first_time = 0;
a = gca();
else
a.children.children.data(:,2) = abs(y(1:n))';
end
end
// Stop DSP execution
dsp_stop();
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
25
Utilizing model with C/C++ application
 Embed Xcos generated model in Windows/Linux
application
 MLink interface functions
 Example code
scilab_dsp_start("10.10.1.1", &port, "q:analog_loop.out", &link_id);
scilab_signal_register(&link_id, &id, &size, &result);
for (count = 0; count < 100; count++)
{
scilab_signal_read(&link_id, buf, &size, &result);
/* process DSP data */
scilab_mem_write(&link_id, 1, param, 2);
}
scilab_dsp_stop(&link_id, &result);
●
/* Scilab interface funcations */
EXTERNC MDAQ_API void scilab_dsp_start( const char *addr, int *port, const char *dspapp, int *link_id );
EXTERNC MDAQ_API void scilab_dsp_stop( int *link_id, int *result );
EXTERNC MDAQ_API void scilab_signal_register( int *link_id, int32_t *id, int32_t *size, int *result );
EXTERNC MDAQ_API void scilab_signal_read( int *link_id, double *data, int32_t *count, int *result );
EXTERNC MDAQ_API int scilab_mem_read( int *link_id, int start_idx, int len, float *data );
EXTERNC MDAQ_API int scilab_mem_write( int *link_id, int start_idx, float data[], int len );
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
26
Utilizing model with LabVIEW
 Analog loop
 SIGNAL block
 MEM read block for model parameter change
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
27
Utilizing model with LabVIEW
● Real-time processing
● Live DSP data
● Parameter change during DSP
execution
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
28
Conclusions
 Code generation from Xcos diagram
 Real-time procesing
 Execution profiling
 DSP binary utilization with LabVIEW and
Windows/Linux C/C++ applications
 Different hardware options avaliable
 Easy to use
 Free alternative for commercial solutions
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
29
Q&A
Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015
Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl
30
Thnak you!

More Related Content

What's hot

Verification Automation Using IPXACT
Verification Automation Using IPXACTVerification Automation Using IPXACT
Verification Automation Using IPXACT
DVClub
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
inside-BigData.com
 

What's hot (18)

Getting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testingGetting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testing
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015
 
ScilabTEC 2015 - Xilinx
ScilabTEC 2015 - XilinxScilabTEC 2015 - Xilinx
ScilabTEC 2015 - Xilinx
 
Scilab Challenge@NTU 2014/2015 Project Briefing
Scilab Challenge@NTU 2014/2015 Project BriefingScilab Challenge@NTU 2014/2015 Project Briefing
Scilab Challenge@NTU 2014/2015 Project Briefing
 
scilab
scilabscilab
scilab
 
FPGAs as Components in Heterogeneous HPC Systems (paraFPGA 2015 keynote)
FPGAs as Components in Heterogeneous HPC Systems (paraFPGA 2015 keynote) FPGAs as Components in Heterogeneous HPC Systems (paraFPGA 2015 keynote)
FPGAs as Components in Heterogeneous HPC Systems (paraFPGA 2015 keynote)
 
Scilab
ScilabScilab
Scilab
 
Cape2013 scilab-workshop-19Oct13
Cape2013 scilab-workshop-19Oct13Cape2013 scilab-workshop-19Oct13
Cape2013 scilab-workshop-19Oct13
 
VLSI IEEE PROJECTS LIST 2015 - 2016 / IEEE VLSI PROJECTS LIST 2015 - 2016
VLSI IEEE PROJECTS LIST 2015 - 2016 / IEEE VLSI PROJECTS LIST 2015 - 2016VLSI IEEE PROJECTS LIST 2015 - 2016 / IEEE VLSI PROJECTS LIST 2015 - 2016
VLSI IEEE PROJECTS LIST 2015 - 2016 / IEEE VLSI PROJECTS LIST 2015 - 2016
 
Modeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice SimulationModeling an Embedded Device for PSpice Simulation
Modeling an Embedded Device for PSpice Simulation
 
Verification Automation Using IPXACT
Verification Automation Using IPXACTVerification Automation Using IPXACT
Verification Automation Using IPXACT
 
LEGaTO: Software Stack Programming Models
LEGaTO: Software Stack Programming ModelsLEGaTO: Software Stack Programming Models
LEGaTO: Software Stack Programming Models
 
Magillem marcos av_silva
Magillem marcos av_silvaMagillem marcos av_silva
Magillem marcos av_silva
 
Ripes: Teaching Computer Architecture Through Visual and Interactive Simulators
Ripes: Teaching Computer Architecture Through Visual and Interactive SimulatorsRipes: Teaching Computer Architecture Through Visual and Interactive Simulators
Ripes: Teaching Computer Architecture Through Visual and Interactive Simulators
 
GNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationGNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generation
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
 
GNAT Pro User Day: Ada at Ansaldo STS
GNAT Pro User Day: Ada at Ansaldo STSGNAT Pro User Day: Ada at Ansaldo STS
GNAT Pro User Day: Ada at Ansaldo STS
 

Similar to ScilabTEC 2015 - Embedded Solutions

Lalit Singh FPGA resume
Lalit Singh FPGA resumeLalit Singh FPGA resume
Lalit Singh FPGA resume
Lalit singh
 
Marek Suplata Projects
Marek Suplata ProjectsMarek Suplata Projects
Marek Suplata Projects
guest14f12f
 
DACHSview++features
DACHSview++featuresDACHSview++features
DACHSview++features
A. Steinhoff
 

Similar to ScilabTEC 2015 - Embedded Solutions (20)

IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
 
CV_Arshad_21June16
CV_Arshad_21June16CV_Arshad_21June16
CV_Arshad_21June16
 
UplinQ - qualcomm® hexagon™ sdk optimize your multimedia solutions
UplinQ - qualcomm® hexagon™ sdk optimize your multimedia solutionsUplinQ - qualcomm® hexagon™ sdk optimize your multimedia solutions
UplinQ - qualcomm® hexagon™ sdk optimize your multimedia solutions
 
Qualcomm Hexagon SDK: Optimize Your Multimedia Solutions
Qualcomm Hexagon SDK: Optimize Your Multimedia SolutionsQualcomm Hexagon SDK: Optimize Your Multimedia Solutions
Qualcomm Hexagon SDK: Optimize Your Multimedia Solutions
 
Lalit Singh FPGA resume
Lalit Singh FPGA resumeLalit Singh FPGA resume
Lalit Singh FPGA resume
 
FPGA_prototyping proccesing with conclusion
FPGA_prototyping proccesing with conclusionFPGA_prototyping proccesing with conclusion
FPGA_prototyping proccesing with conclusion
 
Developing a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT EditionDeveloping a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT Edition
 
Resume
ResumeResume
Resume
 
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdfAdvanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
Advanced View Pic Microcontroller Projects List _ PIC Microcontroller.pdf
 
AXONIM 2018 embedded systems development
AXONIM 2018 embedded systems developmentAXONIM 2018 embedded systems development
AXONIM 2018 embedded systems development
 
Андрій Озгович “IoT Cypress solution. Low cost, low power” {R0boCamp}
Андрій Озгович “IoT Cypress solution. Low cost, low power” {R0boCamp}Андрій Озгович “IoT Cypress solution. Low cost, low power” {R0boCamp}
Андрій Озгович “IoT Cypress solution. Low cost, low power” {R0boCamp}
 
Introducing the CrossLink Programmable ASSP
Introducing the CrossLink Programmable ASSPIntroducing the CrossLink Programmable ASSP
Introducing the CrossLink Programmable ASSP
 
Bindu_Resume
Bindu_ResumeBindu_Resume
Bindu_Resume
 
DCC Labs Company Presentation
DCC Labs Company PresentationDCC Labs Company Presentation
DCC Labs Company Presentation
 
Marek Suplata Projects
Marek Suplata ProjectsMarek Suplata Projects
Marek Suplata Projects
 
DACHSview++features
DACHSview++featuresDACHSview++features
DACHSview++features
 
Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011
 
Pradeep_Embedded
Pradeep_EmbeddedPradeep_Embedded
Pradeep_Embedded
 
Assignmentdsp
AssignmentdspAssignmentdsp
Assignmentdsp
 
Postgraduate Projects in Scilab
Postgraduate Projects in ScilabPostgraduate Projects in Scilab
Postgraduate Projects in Scilab
 

More from Scilab

More from Scilab (20)

Statistical Analysis for Robust Design
Statistical Analysis for Robust DesignStatistical Analysis for Robust Design
Statistical Analysis for Robust Design
 
Electric motor optimization
Electric motor optimizationElectric motor optimization
Electric motor optimization
 
Asteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 KeynoteAsteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 Keynote
 
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
 
Scilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modellingScilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modelling
 
X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...
 
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
 
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCosAircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
 
Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1
 
Multiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in ScilabMultiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in Scilab
 
Scilab optimization workshop
Scilab optimization workshop Scilab optimization workshop
Scilab optimization workshop
 
INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018
 
Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018
 
Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018
 
University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018
 
DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018
 
Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018
 
Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018
 

Recently uploaded

Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 

Recently uploaded (18)

Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 

ScilabTEC 2015 - Embedded Solutions

  • 1. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 1 Utilizing Scilab and Xcos for real-time control and measurement applications Grzegorz Skiba Embedded Solutions skiba.g@embedded-solutions.pl
  • 2. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 2 Agenda  MicroDAQ device and software overview  MicroDAQ toolbox for Scilab  Features overview  Code generation for MicroDAQ DSP core  Tools  Examples  Q&A
  • 3. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 3 MicroDAQ device  Real-time control and measurement system  Dedicated DSP core for signal and real-time processing  Ethernet, USB2.0 and WiFi connectivity  ADC, DAC, DIO, PWM, Encoder,...
  • 4. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 4 MicroDAQ device MicroDAQ E1100  375MHz CPU  4GB flash memory  Ethernet  Wi-Fi  USB2.0  32 DIO lines  8 analog inputs  8 analog outputs  Matlab/Simulink, LabVIEW and Scilab support  Price from 200€ MicroDAQ E2000  up to 456MHz CPU  up to 32GB flash memory  Ethernet  Wi-Fi  USB2.0  16 DIO lines  up to 16 analog inputs  8 analog outputs  Matlab/Simulink, LabVIEW, Scilab support  Price from 400€ MicroDAQ OEM  375MHz CPU  4GB flash memory  Ethernet  USB2.0  USB1.1  32 DIO lines  8 analog inputs  8 analog outputs  Matlab/Simulink, LabVIEW, Scilab support
  • 5. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 5 MicroDAQ device  Processing units  TI C6000 DSP core with floating/fixed point unit  ARM core with Linux OS for handling communication, file storage, web interface  two PRU 32-bit RISC cores for real-time processing  Storage up to 32GB  Digital I/O  16/32 DIOs, 6 PWMs, 2 Encoders, UART  Analog I/O Analog input Analog output 166ksps, 8 channel, 12-bit, ±10V range 166ksps, 8 channel, 16-bit, ±10V range 600ksps, 8 channel, 12-bit, ±10V range 600ksps, 16 channel, 12-bit, ±10V range 500ksps, 16 channel, 16-bit, ±10V range 4000ksps, 2 channel, 16-bit, ±10V range 8 channel, 12-bit, 0-5V range 8 channel, 12-bit, ±10V range 8 channel, 16-bit, ±10V range Simultanious sampling ADCs C6000 DSP 375/456MHz Floating/fixed point ARM 375/456MHz with Linux PRU0 187/228MHz 32-bit RISC PRU1 187/228MHz 32-bit RISC
  • 6. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 6 MicroDAQ software  MLink software  Windows/Linux support  Access to MicroDAQ resources  Loading DSP  Scilab support functions  DSPLib  LabVIEW support package  Matlab/Simulink Embedded Coder target  MicroDAQ toolbox for Scilab Available at: https://github.com/microdaq Host MLink library Linux/Windows UDP/TCP Ethernet Wi-Fi Scilab/Xcos LabVIEW Matlab/Simulink C/C++ application
  • 7. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 7 MicroDAQ toolbox features  Automatic code generation for MicroDAQ DSP  Xcos for MicroDAQ peripherals  Live data access from generated DSP application via Ethernet and WiFi with standard Xcos sinks  Application loading with Ethernet and WiFi  Standalone mode  Easy integration of custom user C code
  • 8. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 8 MicroDAQ toolbox features  MicroDAQ hardware (ADC, DAC...) access macros  DSP model utilization with Scilab script, C/C++ application and LabVIEW  Execution profiling  Toolbox as a part for Atoms installer  Support for Linux and Windows
  • 9. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 9 MicroDAQ toolbox components Texas Instruments Code Composer Studio 5 C6000 DSP compiler SYS/BIOS RTOS MicroDAQ Toolbox Loading DSP binary TCP data communication MLink DSP drivers for MicroDAQ TCP data communication DSPLib Precompiled Scilab libraries for DSP core Scilab libs
  • 10. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 10 Installation  Atoms → Instrumentn Control → MicroDAQ Toolbox  Install Code Composer Studio 5.5 – with C6000 DSP compiler and SYS/BIOS RTOS  microdaq_setup  Code Composer Studio installation paths  SYS/BIOS RTOS compilation  connect MicroDAQ device and setup IP settings  check connection -->mdaq_ping Connecting to MicroDAQ@10.10.1.1...OK!  Ready to go!
  • 11. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 11 MicroDAQ toolbox blocks  MicroDAQ blocks for hardware access  Special MicroDAQ blocks for setup model parameters  Standard Xcos blocks compiled for DSP  Host simulation mode and code generation
  • 12. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 12 MicroDAQ special blocks  SETUP block  Simulation duration  Build type: debug/release  Build mode: Ext/Standalone  Execution profiling  ODE solver type  SIGNAL block  receive live data from DSP  STOP block
  • 13. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 13 Xcos diagram for code generation  SETUP block  Event generator to set step time  Superblock for code generation  Tools → MicroDAQ build and load model  Execution mode  Standalone – load and start model on DSP immediately  Ext – load model on DSP and wait for user action
  • 14. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 14 Model execution modes Model (Real-time task) TCP communication (Idle task) DSP application MLink TCP communication Xcos Model (Real-time task) DSP application Ext mode Standalone mode
  • 15. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 15 Code generation ### Generating block structure... ### Writing generated code... ### Generating Makefile... ### Generating binary file... "C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740… "C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740… "C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740… "C:ticcsv5toolscompilerc6000_7.4.4/bin/cl6x" -c -g -mv6740… <Linking> "MicroDAQ DSP application led_demo.out created successfully" Xcos diagram mdaq_ext_main.c or mdaq_standalone_main.c C code generation C6000 DSP compiler C6000 linker SYS/BIOS RTOS DSPLib MicroDAQ blocks Scilab libs DSP binary Makefile generation SETUP block Loading DSP binary User blocks lib
  • 16. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 16 Running DSP application with Xcos simulation MicroDAQ DSP Xcos Code generation Loading DSP on targetInitialize model execution create TCP server Wait for connection Xcos Start button action connects to MicroDAQ and starts Xcos simulation Create connection with host Execute model and send data with SIGNAL block Xcos simulation receive data with SIGNAL block Xcos diagram
  • 17. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 17 Running DSP application with Xcos simulation Generated DSP code int sin_demo_isr(double t) { int local_flag; int i; double *args[100]; /* Output computation */ /* Discrete activations */ /* Blocks activated on the event number 1 */ /* Call of 'mdaq_sinus' (type 4 - blk nb 2) */ block_sin_demo[1].nevprt = 1; local_flag = 1; mdaq_sinus(&block_sin_demo[1],local_flag); /* Call of 'mdaq_signal' (type 4 - blk nb 3) */ block_sin_demo[2].nevprt = 1; local_flag = 1; mdaq_signal(&block_sin_demo[2],local_flag); /* Call of 'cscope' (type 4 - blk nb 4) */ block_sin_demo[3].nevprt = 1; local_flag = 1; cscope(&block_sin_demo[3],local_flag); return 0; } Xcos simulation ● When DSP is loaded SIGNAL input is ignored ● SIGNAL block receives data from MicroDAQ ● When DSP in not loaded copy SIGNAL block input to output ● mdaq_signal() funciton puts data to IDLE communication task ● cscope() function is empty
  • 18. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 18 DC motor controller ● Sample time: 0.001s ● Discrite PD controller ● H-bridge for driving DC motor ● Live data with standard CSCOPE block ● Loging data to workspace with standard 'To workspace' block
  • 19. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 19 Execution profiling  Measure model execution time  Optimization  How 'fast' we can run model  Execution profiling macros  mdaq_exec_profile  mdaq_exec_profile_show
  • 20. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 20 Custom user code  For new user creating custom block is a tough task  Block code and C code generation  Created code can be compiled for debug and release  Block creation utility macros  mdaq_block();  mdaq_block_add();  mdaq_block_build( %t );
  • 21. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 21 User custom code -->my_block = mdaq_block(); -->my_block my_block = name: "new_block" desc: "Set new_block parameters" param_name: [2x1 string] param_size: [2x1 constant] param_def_val: list in: 1 out: 1 -->my_block.param_name ans = !param1 ! ! ! !param2 ! -->mdaq_block_add(my_block); /* Generated with MicroDAQ toolbox ver: 1.0. */ #include "scicos_block4.h" extern double get_scicos_time( void ); /* This function will executed once at the beginning of model execution */ static void init(scicos_block *block) { /* Block parameters */ double *params = GetRparPtrs(block); /* param size = 1 */ double param1 = params[0]; /* param size = 1 */ double param2 = params[1]; /* Add block init code here */ } /* This function will be executed on every model step */ static void inout(scicos_block *block) { /* Block parameters */ double *params = GetRparPtrs(block); /* param size = 1 */ double param1 = params[0]; /* param size = 1 */ double param2 = params[1]; /* Block input ports */ double *u1 = GetRealInPortPtrs(block,1); int u1_size = GetInPortRows(block,1); /* u1_size = 1 */ /* Block output ports */ double *y1 = GetRealOutPortPtrs(block,1); int y1_size = GetOutPortRows(block,1); /* y1_size = 1 */ /* Add block code here (executed every model step) */ }
  • 22. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 22 MicroDAQ hardware access macros link_id = mdaq_open(); ai_data = mdaq_ai_read(link_id, [1 2 3 4 5 6 7 8], 10, 1) mdaq_close(link_id);  Access to MicroDAQ hardware without code generation  Example  IP settings managment  Switching from Ethernet to Wi-Fi mdaq_pwm_write mdaq_pwm_init mdaq_pru_set mdaq_pru_get mdaq_led_write mdaq_key_read mdaq_hs_ai_read mdaq_hs_ai_init mdaq_enc_read mdaq_enc_init mdaq_dio_write mdaq_dio_read mdaq_dio_func mdaq_dio_dir mdaq_ao_write mdaq_ai_read Scilab macros: mdaq_ping, mdaq_set_ip mdaq_set_ip('10.10.2.1');
  • 23. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 23 Model utilization LabVIEW Scilab script Xcos C/C++ application
  • 24. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 24 Utilizing DSP model in Scilab script // Start DSP application result = dsp_start('fft_demo_scigfft_demo.out'); // Register signal ID and signal size dsp_signal(123, 1); first_time = 1; a = []; // Process data from DSP sample_count = 500; for i=1:500 [result, s] = dsp_signal_get(sample_count); t = 0:1/sample_count:1; N=size(t,'*'); //number of samples y=fft(s'); f=sample_count*(0:(N/2))/N; //associated frequency vector n=size(f,'*') if first_time == 1 then clf() plot(f,abs(y(1:n))) first_time = 0; a = gca(); else a.children.children.data(:,2) = abs(y(1:n))'; end end // Stop DSP execution dsp_stop();
  • 25. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 25 Utilizing model with C/C++ application  Embed Xcos generated model in Windows/Linux application  MLink interface functions  Example code scilab_dsp_start("10.10.1.1", &port, "q:analog_loop.out", &link_id); scilab_signal_register(&link_id, &id, &size, &result); for (count = 0; count < 100; count++) { scilab_signal_read(&link_id, buf, &size, &result); /* process DSP data */ scilab_mem_write(&link_id, 1, param, 2); } scilab_dsp_stop(&link_id, &result); ● /* Scilab interface funcations */ EXTERNC MDAQ_API void scilab_dsp_start( const char *addr, int *port, const char *dspapp, int *link_id ); EXTERNC MDAQ_API void scilab_dsp_stop( int *link_id, int *result ); EXTERNC MDAQ_API void scilab_signal_register( int *link_id, int32_t *id, int32_t *size, int *result ); EXTERNC MDAQ_API void scilab_signal_read( int *link_id, double *data, int32_t *count, int *result ); EXTERNC MDAQ_API int scilab_mem_read( int *link_id, int start_idx, int len, float *data ); EXTERNC MDAQ_API int scilab_mem_write( int *link_id, int start_idx, float data[], int len );
  • 26. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 26 Utilizing model with LabVIEW  Analog loop  SIGNAL block  MEM read block for model parameter change
  • 27. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 27 Utilizing model with LabVIEW ● Real-time processing ● Live DSP data ● Parameter change during DSP execution
  • 28. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 28 Conclusions  Code generation from Xcos diagram  Real-time procesing  Execution profiling  DSP binary utilization with LabVIEW and Windows/Linux C/C++ applications  Different hardware options avaliable  Easy to use  Free alternative for commercial solutions
  • 29. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 29 Q&A
  • 30. Utilizing Scilab and Xcos for real-time control and measurement applications – ScilabTEC 2015 Embedded Solutions; Skiba Grzegorz; skiba.g@embedded-solutions.pl 30 Thnak you!