LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

local variable and feedback control

I'm working on a feedback control problem using labview simulation and i noticed that the use of local variables with feedback generated an error. let's say if i have the controller output to be fed back to the plant input and i used a local variable to do this instead of wiring it directly, i get errors. if i wire it directly there are no errors. i noticed that this happens because the local variable executed earlier in the simulation rather than if you wire directly from controller output to plant input.

this was just information to people using that, but i have a question that just came to my mind, can i set the sequence in which things execute for something like this??
0 Kudos
Message 1 of 5
(2,524 Views)

"...can i set the sequence in which things execute for something like this??"

Please take a look at the Action Engine Nugget - Running Average example. That may give you some ideas on how to handle this sequencing issue.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,505 Views)
Ben

Thank you for the reply. unfortunately, i'm a newbie and i don't seem to get what is there in your AE post. All i could get is that you somehow make the two loops share the same memory block which if i translated that into my problem so the controller output should be sharing with the local variable the same memory block, correct me if i'm wrong. Isn't this a standard thing that should be with the local variable? i mean if it didn't share the same memory block so the values would be different. could you explain how can I use AE with my problem, please?

another thing... when i said the sequence, i meant that the local variable executes before the controller output because it happens to be in an earlier place to the left than the controller output. Please check the pictures attached and check the variable called "sim output"
Download All
0 Kudos
Message 3 of 5
(2,492 Views)

I am not sure that an AE will help you.

Please explain to us were the data being read from the local is supposed to come from the first time this code runs so we can help.

Is that the simulation toolkit?

Cool arrows on the wire.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,473 Views)
it should come from  the Sim output on the left since it's an output of a state space system and state space has initial conditions in it.

if you notice now, the same code works right on the other picture where the output is connected instead of using the local variable.


0 Kudos
Message 5 of 5
(2,468 Views)