Error Sending Boolean Signals to Simulink Model via SIT (Simulatio​n interface toolkit)
Hi,
I am facing a problem with the Boolean instruments when working with SIT.
On my VI I have some boolean instruments (On/Off Switch). These are connected to the Simulink model Constant blocks. SIT works fine (creates diagram etc). I am also able to run the VI and establish connection with the model. But, when I change value of either of the switch the VI 'stops'.
Instead of Boolean instrument, if I use a normal numeric instrument, then everything works just fine.
Any ideas to work around the problem?
Regards,
Amit
Hi Ricardo,
Thanks for your help. The issue has been resolved. One of your representatives was here with us this afternoon.
Apparently, there is a different workaround. The one you suggested will not work. We had tried out at our end. But your suggestion is inline with logic. There is something with the way the SIT makes connections.
Anyways, bottom line is the issue is resolved. I am attaching the solution that we came up with. This also might help some other users. Thanks for the help again.
Regards,
Amit
Attachments:
ModifiedBooleanAcceptor.vi 271 KB
Similar Messages
-
Hi,
I need to implement a simple speed control for a DC motor with two cascaded PI controllers.
Is it posible to include a simulink model in a VI instead of using the simulink control blocks?
Thank you!Hi,
You can indeed build a LabVIEW interface for a simulink model by using the Simulation Interface Toolkit.
The following link will provide you informations about this toolkit and how it works in parlicular:
=> http://zone.ni.com/devzone/conceptd.nsf/webmain/955a9d79583a0ab686256db8006672b8
Regards,
JPR
NIF -
Using SIT connection manager with large simulink models is extremely slow
Hello,
I'm trying to use a large simulink model in LabVIEW but once the DLL is correctly generated and the SIT connection manager is invoked to explore the model sinks, sources and parameters, it takes hours to generate the model connections tree. Afterwards, when the connections tree is completed, it is impossible to handle it because every operation performed takes a lot of time and memory (i.e. to expand a block to see which parameters are inside).
The version of SIT I'm using is 2.0.3 with LabVIEW 7.1.
Is there anybody experienced with large simulink models and SIT?
Thanks and regards.
Ignacio Sánchez Peral
SENER Ingeniería y Sistemas S.A.
Control Systems Section
Aerospace Division
C/ Severo Ochoa, 4 (PTM).
28760 Tres Cantos (Madrid) Spain.
[email protected]
Tel + 34 91 807 74 34
Fax + 34 91 807 72 08
http://www.sener.esThe VI in the Driver VI called SIT Initialize Model.vi has an input called time step (sec) (-1: use model time step) which does what you want it to. It doesn't actually affect the time step of the solver used in the built model DLL, just the rate at which the main base rate loop actually runs in real time. In fact, base rate loop period would be a better name for this control. If you set it, you won't alter your model, but you will be able to adjust the rate of the base rate loop.
Simply create a control from this input terminal on your driver VI and fill in an appropriate period in seconds. Make sure to set this value as default in the control so that the Driver VI remembers it.
You will have to take into account that your model will still think it's running at the time step it was compiled at. So your model simulation time and the actual wall clock time won't match up.
Jarrod S.
National Instruments -
Error: Sender agreement not found, lookup of binding via CPA-CACHE failed.
Hi,
I am doing an RFC to File Scenario in which RFC has to be triggered from CRM system. The TCP/IP connection and communication Channel are working fine. But when i trigger my RFC using the RFC destination following errors occur:
1. The SYSTEM_FALIURE exception comes on CRM side.
2. In adapter monitoring the following error comes on XI side:
Error: Sender agreement not found, lookup of binding via CPA-CACHE failed for Adapter type RFC.
I have also tried the scenario with RFC request as source message and also after J2EE cache refresh but the problem still persists. And one more thing my file adapter (In receiver communication channel) is not working means it is not started. And no message is coming in SXMB_MONI.
Could anyone please help me to resolve this issue.
Regards,
Vinay YadavHi Aaron,
I had the same error and your feedback solved my problem!
Thank you sooo much!!!!
Luciana -
Compile Errors occured when simulink models including 'cmex' by SIT
I am trying to compile a simulink model to DLL with following softwares and hardwares.
Software:
LabVIEW 8.0.1
LabVIEW Realtime 8.0.1
Simulation Interface Toolkit 3.0
MATLAB R13
Visual C++ 6.0 Service Pack 4
Target Hardware:
PXI-1042RTPXI-8196
PXI-6289
When I tried to compile a model including 'cmex' function on Simulink to DLL, compile error about Visual C++ occured. Does SIT support the model including 'cmex' functions?
When I removed the function 'cmex', compiling is working correctly.
To import original model which is written by C or other language, I strongly want to use 'cmex' functions. To avoid the compile error, if you have any ideas, please let me know.
Thanks,
TsugoHello Tsugo,
I believe that it is possible to compile a DLL for SIT from a model that contains a cmex function.
To tell whether the issue is caused by SIT or not, you can try changing the RTW target file from nidll.tlc to grt.tlc (in the model's Simulation Parameters dialog, look in the Real-Time Workshop tab), and see whether the compile error still happens. If the compiler error occurs with grt.tlc, then please refer to the documentation provided by The MathWorks Inc. on how to get your cmex functions to work in Real-Time Workshop®.
If the compiler error does not occur with grt.tlc, then please post the whole text of the compiler error.
Thanks!
Andrew -
How connect to device that sends Midi-Signals via USB?
Hello,
does anybody know how to communicate with a device that sends Midi-Signals via USB? I am working with Windows XP. I would appreciate any kind of hint.rothencharl wrote:
Hello,
does anybody know how to communicate with a device that sends Midi-Signals via USB? I am working with Windows XP. I would appreciate any kind of hint.You need a bit of hardware that converts USB to ordinary RS232; you can use RXTX then to get the data in; there you can do with it whatever you want.
kind regards,
Jos -
Using Simulink models with CompactRIO via SIT
Hi there,
I am looking to use compactRIO for a Rapid Control Prototypig application and am wondering whether Simulink models can be used (via the Simulation Interface Toolkit) and deployed to CompactRIO. (I know that it is possible with PXI). Also, any ideas on ther expected performance?Hi, RichM,
Yes, you can use SIT to create and download DLLs that come from Simulink models. Basically, the CompactRIO controller is like another RT controller, so it will be done exactly the same as in PXI. The only thing different in cRIO is that the model VIs that get scripted from SIT to do data acquisition are using Traditional DAQ VIs, so you will have to manually modify those VIs so they interface with the FPGA backplane using the Read/Write Control function. For information on how to modify the VIs, you can probably look at the following tutorial: Using CAN with the LabVIEW Simulation Interface Toolkit. This tutorial is for NI-CAN, but you can just abstract from it and use the same concepts with the Read/Write Control function.
How fast are you planning on executing? Just remember that the cRIO controllers and PXI do not have the same type of processor. Depending on the method you follow to read the information from the FPGA (either polling or by interrupts), you will get different performance. I will still recommend you go with interrupts.
I hope this helps. Let me know!
GValdes -
Connect hardware I/O to simulink model
Hello,
i developed a controller using simulink. It's already been testet by connecting signal generators via "simulation interface toolkit" between labview and simulink. That worked out very well. The next step would be testing the controleron the real process. Therefore I have to connect the inputs and outputs of the simulink model to measurements and manipulated variables of the real process.
Since there is no real time hardware on wich I could apply the .dll of the Simulink model for testing purpose I have to find a different way.
So here's my question: Is there a possibility to connect Simulink IN and OUTs to measurements within LabVIEW? And apart from that I want to send the manipulated variable which is calculated by simulink back to LabVIEW and via Rs232 e.g. to the real process.
I would be thankful for every answer or hint on how to fix this problem.
Solved!
Go to Solution.Hey,
Yes, it's possible to connect IOs via customized code in the realtime driver VI.
Please have a look at the following two webcasts (they are in German, I assume you are from Germany) where this will be explained in detail.
http://zone.ni.com/wv/app/doc/p/id/wv-619 (Das LabVIEW Simulation Interface Toolkit – Teil I – Grundlagen)
http://zone.ni.com/wv/app/doc/p/id/wv-621 (Das LabVIEW Simulation Interface Toolkit – Teil II – für Fortgeschrittene)
Christian -
[SIT 5.0] Problem with running Simulink model dll on RT target
Hello!
This a continuation of my problem described here: http://forums.ni.com/ni/board/message?board.id=170&thread.id=431616
At the moment I am using following versions of software:
LabVIEW 8.6.1
LabVIEW Real-Time 8.6.1
NI-RIO 3.1.0
Simulation Interface Toolkit 5.0.0
Microsoft Visual C++ 6.0
MATLAB 7.4.0 (R2007a)
NI cRIO-9014
I have done everything mentioned in http://digital.natinst.com/public.nsf/$CXIV/ATTACH-AEEE-7JSQXS/$FILE/readme_sit_vxworks.txt
After that I was able to build nidll and nidll_vxworks using Matlab. Then I have configured SIT Connection manager, mapped controls and indicators, selected model dll etc. But when I have tried to deploy it on RT target I got following error message:
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_SIT_driversupportVIs.lvlib
Deploying NI_SIT_ClientConnMngr.lvlib
Deploying NI_FileType.lvlib
Deploying NI_SIT_Data Log.lvlib
Deploying XDNodeRunTimeDep.lvlib
Deploying NI_SIT_util.lvlib
Deploying NI_SIT_SITServer.lvlib
Deploying project01_Driver.lvproj
Deploying NI-cRIO9014-00E9D6B1(successfully deployed target settings)
Deploying MD5Checksum pad.vi(8,86 K)
Deploying NI_SIT_Replay.lvlib:Read Select Data Packet FIFO.vi(24,89 K)
Deploying NI_SIT_driversupportVIs.lvlibIT Driver FP Strings.vi(2,39 K)
Deploying NI_SIT_Data Log.lvlib:Allocate Data Log State Machine Buffers.vi(10,17 K)
Deploying compatWriteText.vi(9,04 K)
Deploying NI_SIT_Replay.lvlib:Wait for Ack.vi(5,29 K)
Deploying NI_SIT_SITServer.lvlibITs Read Data Buffer.vi(20,24 K)
Deploying NI_SIT_ClientConnMngr.lvlib:Find Channel.vi(8,23 K)
Deploying NI_SIT_Data Log.lvlib:Get Current Configuration from Queue.vi(9,46 K)
Deploying NI_SIT_Data Log.lvlibend New Group Probe List.vi(5,82 K)
Deploying NI_SIT_Replay.lvlib:Write to Active FIFO.vi(8,71 K)
Deploying NI_SIT_Replay.lvlib:Create Configuration FIFO.vi(6,29 K)
Deploying NI_SIT_driversupportVIs.lvlib:sit Microsecond Timer.vi(9,62 K)
Deploying NI_SIT_Data Log.lvlib:Get All Configurations from Queue.vi(9,30 K)
Deploying NI_SIT_Data Log.lvlibwitch Active Configuration.vi(9,77 K)
Deploying NI_SIT_Data Log.lvlib:Update Current Configuration Log Filename.vi(8,85 K)
Deploying NI_SIT_SITServer.lvlibITs Send Packet.vi(26,80 K)
Deploying Invalid Config Data Reference.vi(2,86 K)
Deploying NI_SIT_driversupportVIs.lvlibIT Set Project Directory Path.vi(16,94 K)
Deploying NI_SIT_Replay.lvlib:Update TCL Position FIFO.vi(16,39 K)
Deploying XDNodeRunTimeDep.lvlib:loadlvalarms.vi(32,39 K)
Deploying NI_SIT_driversupportVIs.lvlibIT Task Loop.vi
Failed to download NI_SIT_driversupportVIs.lvlibIT Task Loop.vi
LabVIEW: Failed to load shared library SITs.*:TaskTakeOneStep:C on RT target device.
Deployment completed with errors
I was hoping that upgrading my software will fix all problems. But sadly, it didn't. Any idea? Many thanks for help!Hello,
I also had quite a lot of problems using Labview 8.6.1, RT and SIT 5.0.1. I upgraded a software using Labview 7.1 and SIT 2.0.3 beeing used for 5 years now and it was real pain.
I not using the SIT as you are (just load the model from a DLL, use a timeloop to step the model and finally close the model) but it seems that SIT 5.0.1 has a bug (confirmed recently by NI tech support) concerning inputs and outputs if you are using an array.
It seems that if you use an array for the input during the transcoding of the simulink model to the DLL an index is not well taken into account resulting in a model not beeing able to read its intputs. In my case whatever the inputs data could be the outputs were always 0.
The model has been changed to use only scalar data and everything works fine, ... well using the developpement software :
I cannot generate an RT target executable as during the deployment it fails all the time.
I saw once a message concerning SIT VIs deployment errors and it happened shortly after i upgraded my target : SIT 2.0.3 was still installed after SIT 5.0.
I spent a few years without updating Labview and i am amazed at how many problems occurs with all versions above 8.0.
Good luck, -
I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008. I have selected system target file as nidll.tlc,make command as make_rtw and template nidll_vs.tmf. When I try to generate .dll file I get the following error.
Attachments:
SITProblem.JPG 101 KBHi,
No . I could not solve the issue. Presently we are using microautobox (from Dspace)for doing the RCP.
Himadri -
Send spool id output (sap script) via email in PDF format
Dear friends,
Looking for sample program to send spool id output of sapscript via email in PDF format.
Regards,
Praveen LoboHi,
Try this code..
* Parameters.
PARAMETERS: p_email(50) LOWER CASE.
PARAMETERS: p_spool LIKE tsp01-rqident.
* Data declarations.
DATA: plist LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: document_data LIKE sodocchgi1.
DATA: so_ali LIKE soli OCCURS 100 WITH HEADER LINE.
DATA: real_type LIKE soodk-objtp.
DATA: sp_lang LIKE tst01-dlang.
DATA: line_size TYPE i VALUE 255.
DATA: v_name LIKE soextreci1-receiver.
DATA rec_tab LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
* Get the spool data.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = p_spool
first_line = 1
last_line = 0
desired_type = ' '
IMPORTING
real_type = real_type
sp_lang = sp_lang
TABLES
buffer = so_ali
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
* Check the return code.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'Error'.
LEAVE LIST-PROCESSING.
ENDIF.
* Prepare the data.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 0.
plist-body_num = 0.
plist-doc_type = 'RAW'.
plist-obj_descr = 'Spool data'.
APPEND plist.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 1.
DESCRIBE TABLE so_ali LINES plist-body_num.
plist-doc_type = real_type.
* Get the size.
READ TABLE so_ali INDEX plist-body_num.
plist-doc_size = ( plist-body_num - 1 ) * line_size
+ STRLEN( so_ali ).
APPEND plist.
* Move the receiver address.
MOVE: p_email TO rec_tab-receiver,
'U' TO rec_tab-rec_type.
APPEND rec_tab.
IF NOT sp_lang IS INITIAL.
document_data-obj_langu = sp_lang.
ELSE.
document_data-obj_langu = sy-langu.
ENDIF.
v_name = sy-uname.
* Subject.
document_data-obj_descr = 'Spool attached'.
* Send the email.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
sender_address = v_name
sender_address_type = 'B'
TABLES
packing_list = plist
contents_bin = so_ali
receivers = rec_tab
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE e208(00) WITH 'Error in sending email'.
ENDIF.
COMMIT WORK.
* Send the email immediately.
SUBMIT rsconn01
WITH mode = 'INT'
AND RETURN.
* Success message.
MESSAGE s208(00) WITH 'Email sent'.
Thanks
Naren -
How do you count the frequency of a boolean signal?
Hi, I'm new to LabVIEW, so I suspect this is propbably quite a simple problem.
I'm developing an optical tacometer for a model gas turbine engine. I have a boolean signal in labview which is switching at a frequency between 4 and 26Hz. I need a live readout of the frequency of this signal.
Does anyone know how I could do this? Any help would be really appreciated!
Many thanks
Will
Solved!
Go to Solution.This vi should work for you
Tim
Johnson Controls
Holland Michigan
Attachments:
Calculate Frequency from boolean.vi 11 KB -
Error while distributing the ALE distribution model through BD64
Hi,
I am getting the error while distributing the distribution model through BD64. The error is as follows:
"Model view DVGDVH has not been updated
Reason: the following ALE connection already exists in model view TESTMOD".
What does this means?
Regards,
Soumya.Dear Sapera,
I faced the same problem last night.
We just manually deleted the distribution model from receiving system.
Log on to receiving system => BD64 => change/dispay => edit => delete => Save.
Once deleted log in to sender system and then select model and distribute again.
by performing this we were able to resolve this issue.
Warm regards, -
Invalid Mapping with SIT for an outport inside a subsystem in a the simulink model.
Hello everybody,
I am trying to use SIT to target simulink models on a PXI target.
The simulink model contains a subsystem with an outport. I have created
a mapping between the signal coming out of that outport to a waveform
chart on the host VI. The mapping works fine when I run the model on
the local host but becomes invalid when I target the dll to a pxi
target.
I have been able to create a very simple simulink model and host VI
that is mimicking this problem. This model does
not do anything useful and is made to only demonstrate just this problem. I am attaching the model and the userinterface here.
Note:
I have already taken care of the fact that I can not use signal storate
reuse, block reduction and also cant use linked or linked+masked
subsystems. A testimony to this is the fact that I am able to create
mapping with other signals in the subsystem. Also outport is a virtual
block in simulink so I have created a testpoint on the signal going
into the outport to be able to probe it.
Any kind of suggestions would be appreciated.
Thanks and Regards,
Vicku.
Attachments:
files.zip 77 KBYou have two options to be able to probe this signal in the subsystem that should work fine for this small example you posted. Let me know if they also apply to your actual model.
You have the outport itself set as a test point currently in your subsystem block. Try setting the wire coming out of the subsystem outport as a test point and then rebuilding your dll. That should make the outport signal probable.
Instead of probing the actual outport, you could probe the signal in the subsystem that is wired into the outport. In the case of your example that would be using_subsystem/Subsystem/Sum1:1.
Hope this helps!
Message Edited by Jarrod S. on 08-23-2007 10:59 AM
Jarrod S.
National Instruments -
Failed to send start signal for complete cluster, SLD may still be stopped.
Hello,
I am trying to create technical systems in the SLD on the portal (http://host:port/sld). It prompts me to start the SLD server by going to Administration.
When I click the button "Start Server" under Administration, I get this following error message:
"Failed to send start signal for complete cluster, SLD may still be stopped on other cluster nodes."
Can you please tell me what has to be done to successfully start the SLD server so that I can go ahead and add technical systems.
Thanks
SrinivasHi Siddarth,
I checked MMC. There is only one instance running.
Here is the structure in MMC.
Database
Instance 0
Instance 1
Instances are green and running.
Here is log on the server:
#28 12/12/2008 07:43:44.413 [SAPEngine_Application_Thread[impl:3]_15] FATAL com.sap.lcr.start.StartDirector: SLD start failure, unable to activate the SLD CIMOM. Check the log of the persistence medium for any errors. If the error is reproducible, please send a message to SAP. More...
#27 12/12/2008 07:43:44.397 [SAPEngine_Application_Thread[impl:3]_15] FATAL com.sap.lcr.objmgr.core.TransactionContainerChangeBuffer: Storing changes to cache failed. Please restart the application to reinitialize the cache.(Error: CIM_ERR_FAILED: Failed to initialize cluster notification sender.) More...
#26 12/12/2008 07:43:44.382 [SAPEngine_Application_Thread[impl:3]_15] ERROR com.sap.lcr.cimsrv.ClusterNotificationSender$JMSSender: Failed to initialize cluster notification sender. Please check your JNDI service and JMS provider for errors. More...
#25 12/12/2008 07:43:44.288 [SAPEngine_Application_Thread[impl:3]_15] ERROR com.sap.lcr.webui.CimIO: Failed to send start signal for complete cluster, SLD may still be stopped on other cluster nodes.
#24 12/12/2008 07:43:44.288 [SAPEngine_Application_Thread[impl:3]_15] ERROR com.sap.lcr.cimsrv.ClusterNotificationSender$JMSSender: Failed to initialize cluster notification sender. Please check your JNDI service and JMS provider for errors. More...
What could be the problem.
Maybe you are looking for
-
IPhone and Windows 7 64 Bit - syncing issues
Hi, Just wondering if anyone is able to help. I have updated to Windows 7 and am having problems syning my iPhone. It comes up with a multitude of errors but the most common is: 'The iPhone "Michael's iPhone" can not be syned. The required file can n
-
Hi, what is the role of different content conversion parameters: Doc name doc namespace dos offset recordset name
-
I have an iPhone 4 with iOS 4.1. First off, I have the proximity sensor problem that's driving me crazy. That said, I noticed today that I was driving down the road on the phone (Ford SYNC bluetooth), and the phone had no bars. When I hung up I pulle
-
Back ground processing in Reports
I need to prepare a report, it contains Selection Screen. This report has to run in both foreground and in background. There is no option provided in selection screen to ideentify whether it runs in Foreground or in Background. In report I need to p
-
How can I add a text substitution for changing st in 1st to superscript?
I would like to add text substitutions for 1st, 2nd, 3rd, etc. so the letters show up as superscript. I attempted to change the st, nd & rd to superscript in Pages and tried to paste it, but it simply changed it back to regular format. How can I go a