LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switch never turns true after clicking

I have a case where I connect a switch and it never turns true, this is inside case 3 of the while loop.

the folder structure where the spreadsheet will be saved is Mapeo\Inputs\Honduras\Metadatos, in the application directory.

I wrote a comment where I am having the error.

Please someone help me.

Geologia - ESNACIFOR is the txt file you need to load.

0 Kudos
Message 1 of 10
(2,910 Views)

A latch action switch (e.g. your OK button) turns back to the default state once the terminal is read by the code. If it does not reset, it in in a code section that is bypassed (e.g. a case structure where the other case executes).

Your other switches receive data from local variables, so all bets are off. Why do you read from a local varaible if the terminal is right there?

Also, an "equal FALSE" is just a logical NOT, right? Keep it simple!

 

(I don't have a 10ft computer screen, so I cannot really see what's going on. Sorry.)

0 Kudos
Message 2 of 10
(2,904 Views)
The thing is that both statemets should be true whe I click agregar datos.
0 Kudos
Message 3 of 10
(2,892 Views)
That switch never turns back to its default state.
0 Kudos
Message 4 of 10
(2,885 Views)

From what I see, that architecture is a mess, and there is no way anyone else is going to be able to help you sort it out.

 

You need to use the tools available to you such as break points, probes, conditional probes, and highlight execution to you can progress throught he code and figure out why sections of your code aren't executing like you think, or that boolean values aren't the values you think they should be.

0 Kudos
Message 5 of 10
(2,881 Views)

@Nando88 wrote:
The thing is that both statemets should be true whe I click agregar datos.

You can elimnate the equals, replace the AND with an OR, and swap the cases of the case structure. Much simpler.

 

Still, this has probably nothing to do with your problem. As I said, your code is full of race conditions, so all bets are off. For example in the sequence frame to the left, you are writing a FALSE to "aggregar datos" while you are reading the same boolean in parallel. There is no way to tell what happens first. Most likely the local is written first and the value read from the terminal connected to the case structure is never TRUE.

0 Kudos
Message 6 of 10
(2,878 Views)

Smiley Surprised  Wow, you REALLY need to completely re-factor this before anyone could hope to help you.  There are just too many basic mistakes that need to be corrected.  The HUGE block diagram that stretches wires all over, the local variables and the unbundling clusters without names makes the logic impossible to follow.  You need to at least break down some of the large sections into SubVIs so we have a clue what's going on.  

 

This looks like code that would be easier to re-write than repair.  If you are the one that wrote it, you have the best chance of making it work.  At least you know what it's supposed to do so you can use the debugging tools to follow through the logic.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 7 of 10
(2,874 Views)

I had to try the Clean Up Diagram tool and it actually does wonders in this case.  I still can't figure out what's supposed to be happening but you should try it and see if it helps you get any further...  Good Luck!

 

Edit > Clean Up Diagram

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 8 of 10
(2,864 Views)

@NIquist wrote:

Edit > Clean Up Diagram


Or click on the broom in the toolbar

Or Ctrl+U


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 9 of 10
(2,858 Views)

@crossrulz wrote:

@NIquist wrote:

Edit > Clean Up Diagram


Or click on the broom in the toolbar

Or Ctrl+U


Smiley Indifferent  I never noticed the broom icon before... of course I never notice the broom in my house either, or the vacuum.. the mop. Smiley Sad

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 10 of 10
(2,845 Views)