LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fix labview variable to control input

Hi,

 

I am using the Simulation Interface Toolkit to send variables to Simulink. What I would like to have is a control that is coupled to the value of a text file. In other words the value of the text file will be the control input to Simulink sent via Labview. I can read the variable into Labview and save the local variable. I also have a slide control interfaced with Simulink that can send data. However, I have no idea on how to connect them together - make the slide track the variable I defined. Does anyone have any ideas?

 

Thanks,

Andy

0 Kudos
Message 1 of 3
(2,156 Views)

Hi,

 

I also tried a solution that is similar to this topic:

http://forums.ni.com/t5/LabVIEW/I-want-a-flexible-knob/td-p/1780280

 

The problem is now that the slider will update fine and track what ever external variable I define. However, the value will not be sent to Simulink correctly. Rather, Simulink will continue to read what it was previous and will only update upon a mouse click on the slider. If I use the mouse to modify the slider position, Simulink will track the slider position. When I let go, the slider will return to where is should be (based on the value I define as the control input) but Simulink will not follow. Simulink will remain where the last position of the mouse was. Does anyone have any suggestions on how to correct that?

 

Thanks,

Andy

0 Kudos
Message 2 of 3
(2,149 Views)

Hello Andy,

 

I'm a little shaky on the transfer mechanism you are describing- would you be able to post a small example VI or screenshot of how you are handling the file-to-control data transfer?

 

Based on your reference to the other forum post, it looks as though you may be using an event structure to update your simulation, in which case you may find the Value (Signaling) property useful.  More information on this property can be found here:

 
KnowledgeBase 4J3DI2MA: Event Structure Does Not Capture the 'Value Change' Event When Values are Programmatically Changed 

http://forums.ni.com/t5/LabVIEW/fix-labview-variable-to-control-input/m-p/2174476

 

LabVIEW Help: Value (Signaling) Property

http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/ctrl_value_signaling/

 

I hope that helps, and if you're able to provide an example I might be able to give more specific advice.

 

Tom L.
0 Kudos
Message 3 of 3
(2,107 Views)