LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing tank color when input from a simulink crosses the threshold

Solved!
Go to solution

I dont know how to convert a control in a labview to a simulink code.

 

Thanks for your reply

Muhammad Abul Hasan

0 Kudos
Message 11 of 25
(832 Views)

Thanks for your reply. Can you send me a vi files in version 9 of labview.

 

Muhammad Abul Hasan

0 Kudos
Message 12 of 25
(831 Views)

Here you go

 

Tim
GHSP
Download All
0 Kudos
Message 13 of 25
(829 Views)

@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.

0 Kudos
Message 14 of 25
(827 Views)

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

0 Kudos
Message 15 of 25
(824 Views)

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?

 

0 Kudos
Message 16 of 25
(812 Views)

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!)

0 Kudos
Message 17 of 25
(807 Views)

Thanks for your reply.

 

Is it possible for you to send me a code?

 

Muhammad Abul Hasan

0 Kudos
Message 18 of 25
(803 Views)

yes you are right.

0 Kudos
Message 19 of 25
(801 Views)

@Abul Hasan wrote:

yes you are right.


Hooray! Smiley Very Happy

 

So does it work now?

 

 

I wouldn't normally say this, but feel free to dish out some kudos and/or mark a solution....

0 Kudos
Message 20 of 25
(797 Views)