Interfacing DSP core from LabView
The MicroDAQ Support Package for LabView contains VIs which can be used to control MicroDAQ DSP core. The user can start and stop DSP execution from LabView and also access DSP data during its execution without disturbing the real-time performance. On the other hand, we have MicroDAQ toolbox for Scilab which generates DSP application from Xcos diagram and this DSP application can be used directly in LabView. This approach encapsulates time-critical part of the application in DSP executable which can be used in different LabView applications. E.g. user wants to create an application for DC motor control with PID controller which runs at a 5kHz. When writing pure LabView application without real-time LabView extension it is not possible to achieve 200 microseconds period due to high jitter and USB/Ethernet communication overhead. But when we time-critical part of the application is executed on MicroDAQ DSP core this application can be done with standard LabView.
The first thing we need to to do is DSP application which will be generated from Xcos diagram. We need to prepare Xcos model which will perform our control task. In this article, we will show how to prepare DC motor control system with PID controller. Let's suppose we have worked and tested Xcos model which we want to use to control DC motor.
This model after compilation can be used with LabView, we don't need to make any modification to run and get results from the experiment. However, it is not convenient to change PID gains, rebuild model and run LabView application when we need change something in the controller. The perfect solution will be the model which has the ability to get parameters from outside application - in our case LabView. In order to do that we need to replace the Constant block with MEM read block.
By doing this simple modification our model will read PID gains from memory which can be accessed from LabView. The SIGNAL block sends experiment data to host while MEM read block reads data written by host application - LabView application.