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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview real-time and simpowersystems toolbx from matlab

Hello,

LBoltzmann is correct - all toolkits that work and can generate code with RTW works fine with SIT. Many customers I have met use SimMechanics in their models they run on LabVIEW RT.

Try to benchmark the DLL itself, how long time it takes to take one step of your model. Performance of this will be dependent of the HW you run it on (CPU speed, memory). Use Execution Trace Toolkit 2.0 if you have access to it or alternatively use the VIs 'RT Get Timestamp VI' and 'RT Timestamp Analysis VI'.

Hope this helps,

Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 11 of 13
(2,611 Views)
Thanks for your comments, I will look into what you've suggested and keep you posted.

Thanks again,
Gayatri
0 Kudos
Message 12 of 13
(2,604 Views)

Hello,

In the view of my problems, I had upgraded my system to this set-up:

LV 8.5, SIT 4.0, LVRT 8.5

Matlab R2007a

 

According to NI documents, these versions are compatible.

Still I had problems while even building the dll from Simulink model in Matlab. So discussed the problem with Mathworks support and here is what I found (This is going to be compilation of a number of emails with Mathworks.

First I had some error which said:

"Error building Real-Time Workshop target for block diagram 'sourcetest2'. (my file name was sourcetest2.mdl)

 MATLAB error message:

"Error building Real-Time Workshop target for block diagram 'sourcetest2'. MATLAB error message:

Error: Real-Time Workshop Error in block: "sourcetest2/powergui/EquivalentModel1/State-Space", block type "S-Function": This S-function block must have a corresponding TLC file since it has an mdlRTW() function."

Workaround:

If its so, please read this response by Mathworks for this bug:

The error that you reported is due to a bug in the SimPowerSystems 4.4 (R20007a). SimPowerSystems models and internal functions are not well adapted to real-time applications. Consequently some of your models using SimPowerSystems blocks may not generate code when using Real-Time Workshop.

As a possible workaround for some models, please copy the attached files (sfun_spssw_discc.c and sfun_spssw_discc.mexw32) into your current directory and build the model. Unfortunately this does not work for all models and there is no workaround available at this time for these models. However, our development team is actively working to fix it in a future release.

(I'm attaching the two files with this email, in case you need them.)

Then there was another error in view of which I talked with support again.

Here is the information I got (Thanks to the support guy - Nirmal)

The S-Functions available in SimPowerSystems are:

1. discreteNLastSamples.c

2. discreteVariableTransportDelay.c

3. sfun_psbbreaker.c

4. sfun_psbdqc.c

5. sfun_spssw_discc.c

6. sfun_spssw_contc.c

of which 1,2,3,6 are currently supported and 4,5 are not supported.

The only way to find which blocks (or S-Functions) are supported for code generation is through the documentation. However, since SimPowerSystems is not yet supported for code generation for all targets, I do not know which blocks are supported for which target based on the S-functions. This issue is being currently pursued by the development team and has been posted at:

http://www.mathworks.com/support/bugreports/details.html?rp=179206

The report above says that SimPowerSystems models and internal functions are not well adapted to real-time applications and hence there is no available information regarding this issue. 

 

Just wanted to inform everyone so that they wont waste time on the same issue as I did...

 

Gayatri



Message Edited by Gayatri Damle on 04-02-2008 03:44 PM
0 Kudos
Message 13 of 13
(2,427 Views)