LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation interface toolkit: is there an "NISource"?

Hello, I just started using the SIT and I noticed there's only a block to sink information to LabVIEW. How would I go about sourcing from LabVIEW to Simulink. In my Simulink model, I have a bunch of In ports and Out ports. I want to be able to control the input to the In ports. So far, the only way I see to input to Simulink from LabVIEW is by varying parameters of existing blocks, like the Sine block in NI's tutorial. Actually, there was an In port in the example, except it was never connected to anything - only the Out port was. Any clues, examples, etc?
Thanks.

Message Edited by Sima on 02-02-2006 04:51 AM

0 Kudos
Message 1 of 4
(2,878 Views)

Hi Sima,

What version of the Simulation Interface Toolkit are you using?  For version 2.0.x and earlier, you must connect any signal into an NI_Sink block if you want to see its value displayed in a LabVIEW indicator.  If you want to provide a value to the model, it must be as a parameter to a block in the model.  So if you simply want to send a control value into your model, you should be able to do this with a Constant block, and map the "Value" parameter of that constant block to a control in your LabVIEW program.  As for the Inports and Outports, this is the way that hardware signals (like AI and AO channels on a DAQ board) can get into and out of your Simulink model.

And with version 3.0 of the toolkit, you no longer need to use the NI_Sink blocks...you have the ability to probe any signal in the Simulink diagram with a LabVIEW indicator.

Hope this helps,

-D

0 Kudos
Message 2 of 4
(2,866 Views)
Hi Darren, thanks for your reply. I did try passing a value through Constant block in my Simulink model but Simulink said the parameter was undefined. I suppose it was trying to load it from the Matlab workspace? I'm using SIT v 2.0.2 for now. I also have Simulation Module v 2. Do you think that might be a better way to go? I read that it translates Simulink models into LabVIEW. If that works... yay!
0 Kudos
Message 3 of 4
(2,858 Views)

To my knowledge, the Simulation Module does have a translator that converts some Simulink models to LabVIEW Simulation diagrams, although I don't know any of the specifics on that.  As for your issue with updating the Constant, I think you need to make sure that the datatype of your LabVIEW control matches the datatype of the Constant in the Simulink model...for instance, if the constant is a 1x4 vector, make sure your LabVIEW control is a 1D array.  Also, as I recall, all the data that is passed back and forth from Simulink is DBL data, so make sure your control is of the DBL datatype.

I hope these suggestions help.  Also, I know that the communication mechanism between Simulink and LabVIEW with the Simulation Interface Toolkit 3.0 is vastly improved.

Good luck,

-D

0 Kudos
Message 4 of 4
(2,854 Views)