This post demonstrates how to get data from a measuring instrument in Scilab and display it using Equalis software. The pre-requirements are given below for this demo.
Equalis Instrument Control Module
Rigol DS4024 Digital Oscilloscope
Microchip MPLAB X
Microchip MCLV Board and the associated BLDC Motor
Microchip ICD 3 In-Circuit Debugger/Programmer
At this point, please have a look at the blog post Embedded Coder Module , because we will use the system described in it as signal sources
Equalis Instrument Control Module VISA functions are given below which will be used in this demo
This function opens a VISA session
This function sends a text_message to the instrument connected with the visa_id
The function reads the data from an instrument after a command is sent to the instrument with VISA_write()
SCPI commands of Rigol DS4024 Digital Oscilloscope are given below which will be used in this demo
Return instrument id
Return average value of signal on selected channel
Return period of signal on selected channel
Select waveform reading mode
Select waveform return format
Select source channel to read waveform
Return waveform from previously selected channel by :WAV:SOURce
Now we assume that Microchip MCLV board was loaded with the program as in the blog Equalis Embedded Coder Module Part 2 вЂ“ Sensored Brushless DC Motor Control
Overall system can be seen on Fig.-1
Figure-1 Overall system
Rigol DS4024 Digital Oscilloscope is connected with USB and it can be checked if it is functional via NI MAX Measurement and Automation Explorer. The instrument descriptor can be seen on Fig-2.
Figure-2 NI MAX Measurement and Automation Explorer
Now we can connect the instrument via connection GUI. This GUI can be found the demos in Equalis Instrument Control Module.
After start the GUI, two GUI will be opened, Connection GUI and Main GUI as in Fig.-3. We select connect item from the menu on Connection GUI, and enter instrument descriptor obtained from NI MAX, click OK then enter a VISA session ID between 1-30. Then instrument will be ready to data acquisition.
Figure-3 Connection GUI and Main GUI before connection
Now we can go to Main GUI, we selected to be displayed channels via check-boxes, and enter VISA session ID previously entered on Connection GUI. Now click Start button, we can see data on the GUI as displayed in the screen of the oscilloscope as in Fig.-4.
Figure-4 Connection GUI and Main GUI after established connection and data acquisition
When we click Stop button, data acquisition will be terminated and measured values will be stored in a file and in Scilab Workspace. This data can be used for further analyzes or plotted.
A demo can be found like that in that blog on demos in Equalis Instrument Control Module. Also you can find a demo regarding Embedded Code Generation in Equalis Xcos Coder and Embedded Coder Module.