LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control and simulation loop does not stop even after using halt

hey guys,

 

i would like to generate pulses in labview continously as  a pulse generator in multisim.

so i have used, control and simulation loop in labview to import multisim data.

cosimulation.JPG

in this, i have some problems.

 

1. the xender inputs from while loop are not transferrring to control and simulation loop. here i've used local variables of xender in while loop to move it to control and simulation loop. still it is not transfering to C&S (control and simulation) loop. please clear my query.

 

2. eventhough, after making halt true it is not stopping the vi.  In this, i've used local variable of halt to stop the while loop. if the mistake is to use this halt as local variable, suggest me some other way.

 

0 Kudos
Message 1 of 5
(2,908 Views)

You are going to hear a lot about the "Evil Local Variable"  (Unless I do my job well here)

 

"halt" and "Halt?" cannot refer to the same object.  So, even if you change the value of "Halt?" from FALSE to TRUE How could that effect the value of "halt" that you read from the Local?  And, What is the Mechanical Action of "Halt?" ? if it is a "Latching" action it will reset after a read.

 

In other words, your picture does not show enough of the relationship between the value of "Halt?" and "halt" for us to find the issue.... it does give us a place to help you look!


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(2,894 Views)

Next time, if you attach your actual VI (or a compressed folder with all of your VIs) instead of just a picture of tiny parts of your code, we'll be able to provide more complete help (see Jeff's message).

 

Bob Schor

0 Kudos
Message 3 of 5
(2,875 Views)

i 've used Halt as latching switch. halt in the while loop is the result of halt in the control and simulation loop. i mean, i've used a condition and Halt swithching using 'or' gate. See the vi as shown below. the questions are same

cosimulation.JPG

0 Kudos
Message 4 of 5
(2,767 Views)

@JÞB wrote:

 

"halt" and "Halt?" cannot refer to the same object.  So, even if you change the value of "Halt?" from FALSE to TRUE How could that effect the value of "halt" that you read from the Local?  And, What is the Mechanical Action of "Halt?" ? if it is a "Latching" action it will reset after a read.

 


While your advice about how a latch performs is solid, keep in mind the moment you create a local variable from a latch, the VI gives a broken run arrow. 

 

OP, you want to send data from one loop to another.  Odds are, you want to use every value from the first loop rather than whatever is active in your second.  Otherwise, what's the point in generating a specific wave?  You're using the Local Variable.  This is a lossy means of communication.  If the loops operate at different periods, you're going to either reuse or discard data points from the first loop.  Use a queue.  It will ensure every data point from the first loop is used in the second loop.

 

Get rid of that silly additional boolean.  It's not serving a worthwhile purpose.  Have your first loop quit.  After it does so, watch the queue to see when it's empty.  When it's empty, release it.  Use the error in the control loop coming from the released queue to stop the second loop.

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