Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Using simulink models with CompactRIO 9012

Solved!
Go to solution

Good day,

I am experiencing some problems in using simulink models along with cRIO 9012 RT controller + RIO 9104.

I am using LabVIEW 2009 on a WindowsXP machine, Microsoft Visual Studio 2008, Matlab 2009a.

 

I have followed the instructions from SimulationInterfaceToolkit 2009 install directory:

 

 

"Add the following three files to support SIT on VxWorks.  
 - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R13\nidll_vxworks.tlc
 - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R14\nidll_vxworks.tlc
 - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R2007b\nidll_vxworks.tlc

 

Add the following three files to support SIT on VxWorks.   - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R13\nidll_vxworks.tlc - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R14\nidll_vxworks.tlc - X:\SimulationInterfaceToolkit\2009\ModelInterface\tmw\R2007b\nidll_vxworks.tlc"

 

I've downloaded the Wind River VxWorks "updated_vxworks63gccdist.zip" as refered in "Developing Shared Libraries for the cRIO-901x and Other VxWorks Targets".

I've tried 2 simple simulink models, the simplest is summing 2 inputs and displaying the result. In the simulation mode, the SIT manager works well and I can both have control and view the result.

The second example I've tried is an artificial neural network which output follows the input. Here also, I have control of the input and view the result correctly.

 

As I am selecting the "nidll_vxworks.tlc" and the "nidll.tlc" in the Real Time Workshop from Matlab, the vxworks gcc compiles the 2 models without any error.

I've put the *.out and the *.dll files in the same directory for automatic upload to the controller.

 

Switching to SIT manager in LabVIEW, i select the Real Time hw- cRIO 9012, and *.dll as the model DLL. I RUN the model, some files are deploying to the controller but some error occurs:

 

 

Initializing...

Calculating dependencies...

Checking items for conflicts. This operation could take a while...

Preparing items for download. This operation could take a while...

Deploying NI_SIT_Replay.lvlib

Deploying NI_FileType.lvlib

Deploying NI_SIT_driversupportVIs.lvlib

Deploying NI_SIT_SITServer.lvlib

Deploying NI_SIT_Data Log.lvlib

Deploying NI_SIT_util.lvlib

Deploying XDNodeRunTimeDep.lvlib

Deploying NI_LVConfig.lvlib

Deploying NI_SIT_ClientConnMngr.lvlib

Deploying NI_SIT_sitctls.lvlib

Deploying simplu_Driver.lvproj

Deploying cRIO-9012(successfully deployed target settings)

Deploying NI_SIT_Data Log.lvlib:Log Group Enable Message.ctl (2.32 K)

Deploying NI_SIT_sitctls.lvlib:SIT Opcode.ctl (2.24 K)

Deploying NI_SIT_Replay.lvlib:Replay Command.ctl (2.11 K)

Deploying NI_SIT_sitctls.lvlib:sit Timing Source.ctl (2.09 K)

Deploying NI_SIT_util.lvlib:sit Append to Error Cluster.vi (11.72 K)

Deploying Find First Error.vi (8.39 K)

Deploying NI_LVConfig.lvlib:Unescape String.vi (12.98 K)

Deploying NI_SIT_Replay.lvlib:Wait for Ack.vi (5.50 K)

Deploying Get File Extension.vi (8.14 K)

Deploying NI_SIT_Replay.lvlib:Check Elapsed Time.vi (18.91 K)

Deploying NI_LVConfig.lvlib:Common Path to Specific Path.vi (6.05 K)

Deploying Close File+.vi (9.04 K)

Deploying NI_SIT_Data Log.lvlib:Process Data State.ctl (2.09 K)

Deploying XDNodeRunTimeDep.lvlib:loadlvalarms.vi (31.50 K)

Deploying Search and Replace Pattern.vi (9.47 K)

Deploying MD5Checksum format message-digest.vi (7.99 K)

Deploying NI_SIT_sitctls.lvlib:sit Data Log Format (UI).ctl (2.08 K)

Deploying NI_SIT_Data Log.lvlib:SIT Check FIFO Elements to Read.vi (32.22 K)

Deploying whitespace.ctl (2.09 K)

Deploying NI_SIT_util.lvlib:sit Generate Error Cluster.vi (174.44 K)

Deploying TagReturnType.ctl (2.09 K)

Deploying NI_SIT_driversupportVIs.lvlib:SIT Server Command.ctl (2.09 K)

Deploying Merge Errors.vi (6.95 K)

Deploying NI_LVConfig.lvlib:Section.ctl (3.27 K)

Deploying NI_SIT_Data Log.lvlib:Log Command.ctl (2.10 K)

Deploying NI_SIT_Data Log.lvlib:Log Message.ctl (2.34 K)

Deploying NI_LVConfig.lvlib:Config Data.ctl (3.87 K)

Deploying NI_SIT_Data Log.lvlib:Data Packet FIFO Write Mode.ctl (2.09 K)

Deploying NI_SIT_Data Log.lvlib:Write to Data Packet FIFO.vi (78.31 K)

Deploying NI_SIT_driversupportVIs.lvlib:SIT Model Refnum.ctl (2.86 K)

Deploying NI_SIT_Data Log.lvlib:Buffer Subset.ctl (2.54 K)

Deploying NI_SIT_SITServer.lvlib:SITs Read Data Buffer.vi (21.68 K)

Deploying NI_SIT_Replay.lvlib:Replay Message.ctl (2.35 K)

Deploying Stop Timed Structure.vi (5.45 K)

Deploying NI_SIT_Data Log.lvlib:Group Probe List Info.ctl (2.82 K)

Deploying Synchronize Timed Structure Starts.vi (13.25 K)

Deploying NI_SIT_sitctls.lvlib:SIT Param Info.ctl (3.33 K)

Deploying simplu_IO Ref.ctl (2.12 K)

Deploying simplu_IO Write.vi (4.92 K)

Deploying simplu_IO Close.vi (3.86 K)

Deploying NI_SIT_Data Log.lvlib:Channel Specification.ctl (2.67 K)

Deploying Clear Errors.vi (3.90 K)

Deploying NI_SIT_Replay.lvlib:Replay Playing Status.ctl (2.10 K)

Deploying NI_SIT_driversupportVIs.lvlib:SIT Loop Timing Attributes.ctl (2.60 K)

Deploying XDNodeRunTimeDep.lvlib:wakeup.ctl (2.10 K)

Deploying Error Code Database.vi (4.40 K)

Deploying NI_FileType.lvlib:LVFileType.ctl (2.16 K)

Deploying DialogType.ctl (2.10 K)

Deploying NI_SIT_Data Log.lvlib:Log Config Specification.ctl (2.57 K)

Deploying NI_SIT_Data Log.lvlib:Send New Active Config Command.vi (6.64 K)

Deploying NI_SIT_Data Log.lvlib:Write Operation.ctl (2.09 K)

Deploying ClearError.vi (5.17 K)

Deploying NI_SIT_Data Log.lvlib:Get Group Number.vi (4.46 K)

Deploying NI_SIT_util.lvlib:SITutil Get Model ParamValue.viNI_SIT_util.lvlib:SITutil Get Model ParamValue.vi loaded with errors on the target and was closed.

LabVIEW:  Failed to load shared library SITs.*:GetParameter:C on RT target device.

Deployment completed with errors

 

 

 

"Error 1003 occurred during host VI initialization: Invoke Node in NI_SIT_sitclient.lvlib:sit Connect to Target.vi->NI_SIT_sitclient.lvlib:sit Init Model.vi->test.vi

<APPEND>

Method Name: <b>Run VI</b>

 

VI Path: <b>C:\Users\Miky\Desktop\SIT\simplu_Driver.vi</b>

Do you want to launch the SIT Connection Manager dialog box and reconfigure the simulation?"

 

 

 

For the second example, the one with the ANN, as I select the model DLL file an error occurs and I loose access to the output of the model. The artificial neural network however has intermediate points where i can view the data so I map the display output to any one of them. 

As with the first example some deployments are made to the controller but errors occur:

 

 

Initializing...

Calculating dependencies...

Checking items for conflicts. This operation could take a while...

Preparing items for download. This operation could take a while...

Deploying NI_LVConfig.lvlib

Deploying NI_FileType.lvlib

Deploying NI_SIT_sitctls.lvlib

Deploying NI_SIT_util.lvlib

Deploying XDNodeRunTimeDep.lvlib

Deploying NI_SIT_ClientConnMngr.lvlib

Deploying NI_SIT_Replay.lvlib

Deploying NI_SIT_SITServer.lvlib

Deploying NI_SIT_driversupportVIs.lvlib

Deploying NI_SIT_Data Log.lvlib

Deploying ANN3_Driver.lvproj

Deploying cRIO-9012(successfully deployed target settings)

Deploying NI_SIT_Data Log.lvlib:Channel Specification.ctl (2.67 K)

Deploying Stop Timed Structure.vi (5.45 K)

Deploying NI_SIT_Replay.lvlib:Create TCL Position FIFO.vi (5.83 K)

Deploying NI_SIT_Replay.lvlib:Get Configuration Info.vi (23.04 K)

Deploying NI_SIT_driversupportVIs.lvlib:SIT Probe Model Items.viNI_SIT_driversupportVIs.lvlib:SIT Probe Model Items.vi loaded with errors on the target and was closed.

LabVIEW:  Failed to load shared library SITs.*:ProbeSignals:C on RT target device.

Deployment completed with errors

 

 

With a FTP file manager I navigate to the ni-rt/system folder of the cRIO 9012 and I can see the *.out files deployed. 

However something isn't working well.

 

Is something that i'm missing?

I mention I don't have the LabVIEW 2009 SP1 or SimulationInterfaceToolkit 2009 SP1 installed, where I saw that some bugs are resolved. 

 

The SIT 2009 read-me states that it has support for VxWorks targets.

 

eng. Mihai CERNAIANU

0 Kudos
Message 1 of 5
(7,069 Views)
Solution
Accepted by MihaiC

It looks like you do not have the shared variable engine loaded onto your cRIO. Open MAX and install the variable engine support onto your target.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(7,052 Views)

Hi Scott W,

Thank you for the answer. It wasn't the variable engine but the Simulation Interface Toolkit the one not installed. It works now.

 

If you are kind I do have another questions:

1. The ANN model I've developed in Matlab lost it's output connection when I switched from *.mdl to *.dll file. The model has masked and linked blocks. It's that why I lost the Output mappings to the model?

2. It is possible to call the *.out files on the VxWorks target without using the SIT?

For example I want to use the ANN model in a bigger project. I'd like to call the library with "Call Library Function Node" and use the inputs and outputs of the model to interface LV code. 

In the KnoledgeBase "Calling external code on VxWorks Targets" it's stated that "...the LabVIEW development environment cannot read the library information in VxWorks shared libraries, and configuration of the Call Library Function Node must be done with a stub DLL." 

 

Thank you,

Mihai C.

0 Kudos
Message 3 of 5
(7,043 Views)

Hello.

I am having the same issue with SIT and a cRio9073.

Do I need to install the Simulation Interface Toolkit on the cRio then?

When I go to MAX I don't see the option to install the toolkit.

Any advice will be greatly appreciated.

Javier Ruiz - Partner at JKI
jki.net
vipm.io
0 Kudos
Message 4 of 5
(6,443 Views)

Hello,

You will need to complete a 'Custom Installation' in order to select SIT as an option to install on the cRIO. See the attached pictures to see which selections you should make in the Software Wizard dialogue box. Hope this helps.

 

Best,

Patricia B.

National Instruments
Applications Engineer
Download All
0 Kudos
Message 5 of 5
(6,427 Views)