From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Simulink in Veristand For Dummies

Solved!
Go to solution

I'm still new to Veristand and even newer to Matlab/Simulink...at least their more recent incarnations.  Does anyone know of a good "Simulink for dummies" resource online?  Especially geared for someone who will be needing to build the code in such a way that Veristand can make use of it.  I hesitate to ask for example code, as I frown on that, but I'm really just interested in the methodology, not the code itself.

 

Dan M.

0 Kudos
Message 1 of 13
(9,944 Views)
Solution
Accepted by topic author thisisnotadream
Hi Dan,

For getting started information you can find very helpful information in the NI VeriStand Help from here and here. The time when we see bigger issues is when an S-function is used that calls into custom code that will not run on a NI Real-Time system (usually a DLL dependency issue). There are times that you might use an add-in into you model that will allow mapping to 3rd party hardware. In that case, you will want to replace the input/outputs with VeriStand In and Out blocks so that you can use VeriStand to map the hardware (for example CAN).

As for specifics with MATLAB® and Simulink® getting started we respectfully defer those questions to The MathWorks, Inc.

 
MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.

Joshua B.
National Instruments
0 Kudos
Message 2 of 13
(9,925 Views)

Thanks for the great info.  This is exactly what I need to get going.  One point of clarification, though.  One of your links states that MSVC++ is required to build a model from C to DLL.  The other link implies that MEX can compile the code, if no other supported compiler is available.  Which is it?  Will I need MSVC++, or will Matlab/Simulink build the DLL for me?

 

Dan M.

0 Kudos
Message 3 of 13
(9,913 Views)

Hi Dan,

 

When converting the model DLL you need to run the mex -setup command in order to choose the compiler you wish to compile with. You will need to use one of the listed compilers from the NI VeriStand 2009 ReadMe

Message Edited by DiscoBall on 06-14-2010 10:42 AM
Joshua B.
National Instruments
0 Kudos
Message 4 of 13
(9,892 Views)

Wicked awesome.  I have Matlab R2010a, which I assume is not listed as it wasn't out when the readme was written.

 

Thanks for the support and help!

 

Dan

0 Kudos
Message 5 of 13
(9,888 Views)

Hi Dan,

You are correct, MATLAB® 2010A was not available when NI VeriStand 2009 was being developed, therefore it is not officially supported. More so, we have seen issues when using MATLAB 2009b (CAR 204598), so I am pretty 2010A will probably have an issue too. Needless to say we are working on improving NI VeriStand's coverage.

 


MATLAB® and Simulink® are registered
trademarks of The MathWorks, Inc. Other product and company names listed
are trademarks and trade names of their respective companies.

Joshua B.
National Instruments
0 Kudos
Message 6 of 13
(9,883 Views)

Thanks for the heads up.  Is there anyway that I can look at the details of the CAR to see if it will be something I need to look out for when/if it happens?

 

Dan

0 Kudos
Message 7 of 13
(9,881 Views)

Hi Dan,

 

In the NI VeriStand ReadMe you can see a list of active CARs and we post some details. For CAR 204598, VeriStand will fail to import a MATLAB® 2009b model and you will have to cancel the importation. Since MATLAB® 2009b was not listed in the ReadMe as supported, the CAR is more of a report that the model importation will fail and that NI VeriStand will not behave in an expected manner.

 

MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.
 

Joshua B.
National Instruments
0 Kudos
Message 8 of 13
(9,876 Views)
Hi Joshua, I discovered last February that, while using DLL created with Matlab 2009a, the parameters were not correctly initialized and I told this to my NI support in Italy. But can you confirm that the patch NIVeriStand2009f1Patch.exe doesn't solve this issue (see http://digital.ni.com/public.nsf/websearch/FB26609F786A88548625766C0072AF34?OpenDocument)? Thanks
0 Kudos
Message 9 of 13
(9,623 Views)

Hi JohnnyGroove,

 

Do you have the CAR or Service Request number for the the issue you report to NI Italy? In the NI VeriStand 2009 f1 Patch only three issues were apparently fixed and it does not appear that model initialization was addressed.

Joshua B.
National Instruments
0 Kudos
Message 10 of 13
(9,614 Views)