05-20-2011 08:26 AM
I dont know how to convert a control in a labview to a simulink code.
Thanks for your reply
Muhammad Abul Hasan
05-20-2011 08:28 AM
Thanks for your reply. Can you send me a vi files in version 9 of labview.
Muhammad Abul Hasan
05-20-2011 08:32 AM
Here you go
05-20-2011 08:35 AM
@Abul Hasan wrote:
I dont know how to convert a control in a labview to a simulink code.
Thanks for your reply
Muhammad Abul Hasan
This article should walk you through pretty much what you need.
05-20-2011 08:55 AM
I did it using SIT connection but problem here is that if I map a control with a simulink than original input in simulink would change by changing control value in a labview.
Here I attached a simple simulink file. I want to fill the tank with green color before the magnitude of sine reaches threshold (let 2 unit) and tank color would change to red.
In all the above files it works fine when you run independently on labview. I dont want to use control in a labview because in my case I am getting some input from a device in a simulink.
I hope it is more clear now.
Many thanks in advance
Thanks to you all for your replies.
Muhammad Abul Hasan
05-20-2011 09:39 AM
Abul Hasan wrote:. I dont want to use control in a labview
You may not want controls, but you clearly want an indicator (the tank).
Lets be clear here:
1) You have a simulink model which outputs a number
2) You want to read this number into a LabVIEW file and on the LabVIEW front panel you want to use a tank indicator.
3) When the tank indicator goes over a threshold, you want it to change colour.
I'm assuming that 1) is done.
3) is solved by several examples above
That just leaves item 2 - you can't get the number from Simulink into LabVIEW.
I am not a simulink user, but the instructions in the article I linked seem to explain exactly this - they link the graph (an indicator) to the output of their simulink model so that it displays their model output on the graph.
Your case seems even simpler because you don't have to map controls as well as indicators.
Not sure I can offer more than that, maybe a Simulink user might help.... anyone?
05-20-2011 09:52 AM
Or....
Is your problem that the data is mapped directly onto the tank indicator and you can't access it to compare it to your threshold?
If so, create a local variable for the tank, read the value from that, do the threshold comparison and write to the property node as in all of the above examples.(Local variable - right click, create, local variable. Right click the loacl variable, change to read)
(That sounds a bit Rube Goldberg, but I'm out of other ideas!)
05-20-2011 10:03 AM
Thanks for your reply.
Is it possible for you to send me a code?
Muhammad Abul Hasan
05-20-2011 10:04 AM
yes you are right.
05-20-2011 10:19 AM
@Abul Hasan wrote:
yes you are right.
Hooray!
So does it work now?
I wouldn't normally say this, but feel free to dish out some kudos and/or mark a solution....