02-02-2006 04:50 AM - edited 02-02-2006 04:50 AM
Message Edited by Sima on 02-02-2006 04:51 AM
02-02-2006 10:44 AM
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
02-02-2006 03:00 PM
02-02-2006 03:25 PM
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