<< Introduction MicroDAQ toolbox Blocks >>

MicroDAQ toolbox >> MicroDAQ toolbox > Toolbox start guide

Toolbox start guide

Explains how to setup and build first model for MicroDAQ using MicroDAQ toolbox for Scilab


MicroDAQ toolbox combines Scilab/XCos environment with Embedded Solutions MicroDAQ real-time control measurement system equipped with TI C6000 DSP. Module extends Scilab by allowing user to automatically generate DSP applications directly from XCos scheme. User can use custom XCos blocks which gives access to MicroDAQ hardware (ADC, DAC, DIO, PWM, UART, Quadrature Encoder). Generated DSP application utilizes SYS/BIOS real-time operating system combined with code generated from XCos scheme.

Depending on configuration, DSP application can be generated as a standalone or Ext application (similar like External Mode in Matlab/Simulink). In standalone mode generated application contains only real-time task, while in Ext mode code contains real-time task and low priority task which exchanges data with Scilab via TCP/IP protocol. Starting and stopping DSP application is integrated with standard Xcos Start/Stop buttons, module allows using standard sinks blocks to view live data from application running on DSP processor. Module allows to plot DSP execution profiles and generate DSP applications in „release” and „debug” mode. Generated DSP application can be used with Scilab script. Module provides macros for loading DSP application, reading data from running application on MicroDAQ device and terminating DSP execution. Attached example shows how to use generated DSP application to compute FFT from data acquired from ADC input. MicroDAQ module simplifies development of real-time control measurements applications, together with MicroDAQ hardware platform gives „out of the box” experience and can be an alternative to expensive commercial systems.

MicroDAQ resources

MicroDAQ useful links:

MicroDAQ toolbox combines Scilab/XCos environment with Embedded Solutions MicroDAQ real-time control measurement system equipped with TI C6000 DSP. Module extends Scilab by allowing user to automatically generate DSP applications directly from XCos scheme. User can use custom XCos blocks which gives access to MicroDAQ hardware (ADC, DAC, DIO, PWM, UART, Quadrature Encoder). Generated DSP application utilizes SYS/BIOS real-time operating system combined with code generated from XCos scheme.

MicroDAQ device setup

Unpack MicroDAQ and connect device to your PC. Use included 5V DC power supply and Ethernet cable to connect device to host PC. During MicroDAQ power up procedure D1, D2 LEDs are used to indicate state of device boot sequence.

Correct MicroDAQ boot sequence is indicated by following LEDs sequence:

Data exchange between MicroDAQ and host PC is done with Ethernet or Wi-Fi. User has to check if Ethernet or Wi-Fi is configured and if is possible to exchange data between PC and MicroDAQ device. In case of Ethernet connection, device and host PC has to be connected with Ethernet cable. Valid connection is indicated by LEDs on MicroDAQ Ethernet connector - yellow LED indicates valid connection, green LED indicates data exchange with host PC. If connection with host PC is valid, IP settings can be checked. Locate your Ethernet interface on host PC and change IP settings to static and set IP address.

By default MicroDAQ is configured with IP settings:

If you want setup host PC with MicroDAQ default IP settings you should use the following IP address and network mask settings for your host PC:

Setting MicroDAQ IP address

MicroDAQ IP address can be changed to meet users network configuration. In order to change MicroDAQ IP address perform following steps:

If you want to restore default MicroDAQ IP settings you can edit 'network.txt' file or you can delete whole user disk content and reboot device. After reboot default configuration files and directories will be re-created.

Testing connection with MicroDAQ

In order to use MicroDAQ device with MicroDAQ toolbox for Scilab a valid IP connection has to be created between device and host PC. Connection can be verified with standard 'ping' command which is available on Windows and Linux hosts. The 'ping' command verifies IP-level connectivity to host PC by sending Internet Control Message Protocol (ICMP) Echo Request messages.

In order to test connection system shell and run the following command:


If after running 'ping' command you have response from MicroDAQ it means that your device is ready to work with MicroDAQ toolbox for Scilab.

Compiler and real-time operating system for MicroDAQ toolbox for Scilab

MicroDAQ toolbox for Scilab allows automatic C code generation from Xcos model, generated code is automatically compiled by C compiler. Generated application is executed on MicroDAQ DSP core. MicroDAQ toolbox for Scilab uses three external components to produce DSP executable binary:

All mentioned components are available on Texas Instruments website which in case of toolbox it could be use for free. Make sure that correct version of components will be used. Use the following links to download necessary components:

MicroDAQ toolbox for Scilab configuration

Installed required components and MicroDAQ device configured to work in IP network steps has to be performed to perform this configuration step. MicroDAQ toolbox for Scilab provides function which configures toolbox to work with installed software components (compiler, RTOS). The 'microdaq_setup' script configures installed components to work with toolbox, detects MicroDAQ device, compiles SYS/BIOS RTOS for toolbox usage. Toolbox version 1.2 and higher is not compatible with MicroDAQ firmware below 2.0.0 release.

Configuring toolbox with 'microdaq_setup' setup wizard

Basic toolbox commands

Xcos model for MicroDAQ

If MicroDAQ toolbox for Scilab is configured we can create first Xcos model which utilizes MicorDAQ device. MicroDAQ toolbox for Scilab allows code generation from Xcos scheme, user can create Xcos diagram which contains MicroDAQ blocks which communicate with the device peripherals. After code generation from Xcos diagram resulting C code is compiled with C6000 compiler. Resulting DSP binary application can be loaded on target via Ethernet or Wi-Fi connection. In order to show main toolbox features and guide user how to user toolbox to generate DSP application from created Xcos diagram we will simple model which uses MicroDAQ LED block do blink D1 LED.

Creating Xcos model for MicroDAQ

Code generation from Xcos model

Created model can be used for code generation and DSP binary executable creation. In order to Build DSP application from Xcos diagram Xcos 'Tools' menu has to be used.

Toolbox options related to code generation:

Select 'Tools -> MicroDAQ build and load model' from Xcos menu to build and load DSP executable on MicroDAQ device. After this step MicroDAQ toolbox for Scilab should log the following:

### Handling SMCube blocks...   

### Generating block structure...   

### Writing generated code...   

### Generating Makefile...   

### Generating binary f i l e...   
"C:\ti\ccsv5\tools\compiler\c6000_7.4.4/bin/cl6x" -c -g -mv6740 ...
"C:\ti\ccsv5\tools\compiler\c6000_7.4.4/bin/cl6x" -c -g -mv6740 ...
"C:\ti\ccsv5\tools\compiler\c6000_7.4.4/bin/cl6x" -c -g -mv6740 ...
"C:\ti\ccsv5\tools\compiler\c6000_7.4.4/bin/cl6x" -c -g -mv6740 ...
"C:\ti\ccsv5\tools\compiler\c6000_7.4.4/bin/cl6x" -mv6740 ...
"MicroDAQ DSP application led_test.out created successfully"

### Connecting to MicroDAQ...   

### Loading led_test.out to MicroDAQ...   

### Starting model in Ext m o d e...

After '### Starting model in Ext mode...' is logged on the Scilab console code generation, compilation and loading created DSP application is done. Toolbox can generate two types of DSP executables - Ext and Standalone executables. Type of generated DSP application is configured with SETUP block properties. Standalone and Ext mode has the following characteristics:

Start DSP execution on MicroDAQ by pressing 'Start' simulation button in Xcos and observe if D1 LED blinks. You can stop DSP application execution by pressing 'Stop' simulation button or you can wait 10 seconds and DSP executable with ends its execution. Model duration is defined in SETUP block in seconds, '-1' value will set model duration to infinity.

Change 'Square' and 'Led' block parameters to blink D2 led with different frequency. Note that default CLOCK_c (model sample rate) period is 0.1 second (10Hz), if you want to blink LED with higher frequency you have to change CLOCK_c block 'Period' parameter.

Running model in host simulation mode

MicroDAQ toolbox for Scilab allows running Xcos simulation with MicroDAQ blocks in the diagram. This mode allows running the same diagram without generating DSP application. This mode of operation is different then code generation and running DSP application on target. In host simulation mode every MicroDAQ block sends request to MicroDAQ device e.g. LED block sends request to ON/OFF selected LED (D1 or D2). The request is done with UDP protocol to minimize block execution time. In this mode code generation and real-time execution on MicroDAQ DSP core is not used. This mode is not recommended for real-time applications, but it can be useful for applications where strict time constraints are not the case. Note that adding new MicroDAQ block to Xcos diagram will increase loop time execution of the model. In case of Ext mode where model is executed on dedicated DSP processor there is no delay related to data exchange between MicroDAQ and host PC.

In order run model containing MicroDAQ blocks use 'Start' simulation button. In host simulation mode DSP application in not generated and is not loaded on MicroDAQ DSP. After pressing Xcos 'Start' button MicroDAQ toolbox for Scilab checks if diagram contains blocks which communicates with MicroDAQ device, it such block is found connection with MicroDAQ is established and is used to send requests to MicroDAQ. When simulation is done or it is stopped connection with MicroDAQ is closed.

Xcos model for MicroDAQ with live data access

MicroDAQ toolbox for Scilab allows getting and presenting (e.g. on scope) live data from DSP application. Using standard Xcos sinks is possible only in Ext mode. In this mode generated DSP application executes two task - real-time task which executes code generated from Xcos model and idle task which is used to send data to Xcos sinks to allow live DSP data access with standard Xcos sinks blocks.

In order to receive DSP data a special SIGNAL block is provided by MicroDAQ palette. This block receives DSP data which can be passed to standard Xcos sink block. In Ext mode MicroDAQ DSP and Xcos simulation runs in parallel, if Xcos diagram contains SIGNAL block generated DSP application will send signals connected input port of SIGNAL block. The same block in Xcos simulation will receive data which will be passed to other blocks from SIGNAL block output. The SIGNAL block connects external code running on MicroDAQ DSP core with Xcos simulation which allows usage of standard Xcos sink blocks. In case of two or more SIGNAL block in Xcos diagram user has to provide unique 'Signal ID' block parameter.

Xcos model with live DSP data access

Report an issue
<< Introduction MicroDAQ toolbox Blocks >>