LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

real time implemenation

Hi All,,
 
Im trying to control the speed of a DC motor using the PID controller, the lapview and the simulink are used together in this project, I have installed
the simulation interface toolkit that is used as an interface between the labview and the simulink enviroments. everything went okay when I was working offline, the simulink was
working correctly and it was responding to all commands done in Labview.
problems started to occur as I started to work online. the labview cannot deal directly with the simulink, the simulink files ( .mdl ) are firstly converted into  C code using the simulation interface toolkit, the C code then converts into ( .dll) files using the Microsoft visual C++. labview uses these files ( .dll) to interact with real time plants.
when I was trying to do that, I faced a problem that I did not know how to set the paramters of the simulink simuatlion , the error messages shown below show the  error occured when I tried to excute the files.
 
 
message 1
 
Error executing build command: Error using ==> make_rtw
Error using ==> c:/matlab6p5/toolbox/rtw/rtw/private/issue_inv_comp_env_val_error
Invalid setting for environment variable MSDevDir or DevEnvDir.
The setting is: ''
You can verify the setting by checking for the existence of:
  %MSDevDir%\..\vc\bin\vcvars32.bat          (for Visual C/C++ 5.0)
  %MSDevDir%\..\..\vc98\bin\vcvars32.bat     (for Visual C/C++ 6.0)
  %DevEnvDir%\..\tools\vsvars32.bat          (for Visual C/C++ 7.0)
You must define MSDevDir or DevEnvDir to be:
  set %MSDevDir%=<VisualRoot>\sharedide      (for Visual C/C++ 5.0)
  set %MSDevDir%=<VisualRoot>\common\msdev98 (for Visual C/C++ 6.0)
  set %DevEnvDir%=<VisualRoot>\common7\ide   (for Visual C/C++ 7.0)
This error may be due to an invalid preference file:
  C:\Documents and Settings\COOL\Application Data\MathWorks\MATLAB\R13\mexopts.bat
Please run "mex -setup" at the MATLAB prompt to correct
 
 
 
message 2
 
Error executing build command: Error using ==> make_rtw
Error using ==> rtwgen
The "FixedStepDiscrete" solver option specified in the simulation parameters dialog cannot be used for block diagram 'PID' because it contains continuous states
 
 
 
Can you please let me know how this problem can be sorted as soon as possible.
 
Thanks
0 Kudos
Message 1 of 3
(3,337 Views)

Hi

After having a look at your errors I am afraid there is not going to be anything I can do as they are Simulink errors not with the LabVIEW software. I do not have access to a copy of Simulink so I cannot give this a go.

What I can do is point you to some of our online resources that may help you to get around this:

Building a LabVIEW User Interface for a Simulink Moadel with the LabVIEW Simulation Toolkit

I hope this helps

Rich
NI | UK

0 Kudos
Message 2 of 3
(3,262 Views)
 
Hello mohkhakha,
Your first error message indicates that you should run mex -setup in your MATLAB session to set your environmental variables correctly.  There is a note and further instruction in the SIT help topic Converting a Model into a Model DLL (Simulation Interface Toolkit), this help is installed with SIT in addition to being available online.
 
For your second error, as the error message states, you need to choose a solver that can solve continuous states.  This is also described in the help topic I linked above.
 
Hope this helps,
Angela M
Product Support Engineer
0 Kudos
Message 3 of 3
(3,248 Views)