From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with my code (VI Attached)

Solved!
Go to solution

hello,

 

I would be happy to receive help with the simple interface I prepared.
If you can tell me how I can arrange the code so that the data will remain on the screen and will not disappear after each press of a button or switch.

feels like it cleans the buffer like the command flushall();.

I attached the VI.

 

 

0 Kudos
Message 1 of 8
(2,911 Views)

There are some strange constructs in there.  What does True greater than a boolean control supposed to mean?   I had to test it out to find out the result is the same as using a NOT function.

 

And the code doesn't seem to do much.  You have stuff going to a Command string indicator, sometimes.  But it doesn't go anywhere else.  I would expect it to to be sent to some instrument.

 

The problem is that you have number of tunnels in the case structures and event structure set to "Use Default if Unwired" and a number of cases where they are unwired.  So numbers return zero, and strings return empty strings.

 

If you want values to maintain between iterations of the while loop, put the values on a shift register and wire the shift register through to the tunnels in any case where you don't want the value in the indicator to change.

0 Kudos
Message 2 of 8
(2,908 Views)

At the end of the interface will call with a generator signal.

Regarding your question, this shift is made in order to prevent "working" with two frequencies, I want to avoid this possibility.
I understood what you are saying and just do not understand how to fix this issue because I know that you are using a shift register in loops

0 Kudos
Message 3 of 8
(2,882 Views)

ok i found what to do thanks!

0 Kudos
Message 4 of 8
(2,876 Views)

@Matanlaza wrote:

 

Regarding your question, this shift is made in order to prevent "working" with two frequencies, I want to avoid this possibility.


What are you talking about in this sentence when you talk about "this shift"?

0 Kudos
Message 5 of 8
(2,871 Views)

Comparison

0 Kudos
Message 6 of 8
(2,867 Views)
Solution
Accepted by topic author Matanlaza

Since True greater than a boolean is the same result as NOT, it would make more sense and be cleaner code to replace it with a NOT.

 

Since it looks like you are trying to make sure only one button is pressed,  (This AND NOT button 2  AND NOT button 3 AND NOT ....), it would make more sense if you used a radio button control.  Then when you press one button, any other button returns to False automatically.  Right now it seems like you have to manually unclick one button and then click the button you want.  Very user unfriendly.

 

If you do that, you don't need so many comparisons and case structures, you can have the radio button control drive a case structure directly.

 

 

0 Kudos
Message 7 of 8
(2,830 Views)

You are absolutely right, I got your comment and it is very important to think about the user. I thought more about how to do the software itself to learn and I did not take into account the user.

Thanks!

0 Kudos
Message 8 of 8
(2,798 Views)