LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error closing multiple loops with local vaiable

Solved!
Go to solution

Hello, I'm working on a projekt where I have 6 different loops running at the same time. I wish to have one stop button, to close them all.

 

I followed the guide on this link:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LmXSAU&l=da-DK

 

And I'm using local variables method to do it. It has been workI transfered it to my workgroup, it suddenly didn't work anymore. None of the loops we're running and you have to press the stop button twice, to even close it now. 

 

Anyone know what happened? Maybe have a way to fix this? Thanks. 

0 Kudos
Message 1 of 8
(3,121 Views)

Not nearly enough information to make a diagnosis.  What architectures are you using to the 6 loops?  How are they all communicating?  Sharing your code with us will help us help you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(3,111 Views)

They are running independently I guess? I've been trying to work with channel writer/reader, but not sure which kind to use.

Sorry I cannot share the code as it's a school final project. 

0 Kudos
Message 3 of 8
(3,108 Views)

There's apparently a bug in your code. Probably a race condition. I would recommend the channel wire way to do it.

Certified LabVIEW Architect
0 Kudos
Message 4 of 8
(3,099 Views)

@tubidubidoo wrote:

... I've been trying to work with channel writer/reader, but not sure which kind to use....


The info in the link you provided explains step by step how to do it, what kind to use and everything. Just follow the description.

 

Certified LabVIEW Architect
0 Kudos
Message 5 of 8
(3,096 Views)
Solution
Accepted by tubidubidoo

I fixed it by making 'tag' channel writer/readers, but I still had the problem with having to press it twice before stopping. I also fixed that afterwards, by making a sequence structure telling the value to be true, before sending a signal through the channel. Not sure why it worked, but it did?

 

Thanks for the replies and trying to help

0 Kudos
Message 6 of 8
(3,091 Views)

@tubidubidoo wrote:

... but I still had the problem with having to press it twice before stopping. I also fixed that afterwards, by making a sequence structure telling the value to be true, before sending a signal through the channel. Not sure why it worked, but it did?


A good programmer understands code! Fixing bad code by throwing even more bad code at it is not a viable solution. Most often things can be fixed by simplifying code! 😄

0 Kudos
Message 7 of 8
(3,064 Views)

@tubidubidoo wrote:

I fixed it by making 'tag' channel writer/readers, but I still had the problem with having to press it twice before stopping. I also fixed that afterwards, by making a sequence structure telling the value to be true, before sending a signal through the channel. Not sure why it worked, but it did?

 

Thanks for the replies and trying to help


That sounds like you had a Race Condition which you worked around by forcing the execution order. There's probably better solutions to that problem.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(3,046 Views)