取消
显示结果 
搜索替代 
您的意思是: 

Help with my code (VI Attached)

已解决!
转到解答

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 项奖励
1 条消息(共 8 条)
3,908 次查看

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 项奖励
2 条消息(共 8 条)
3,905 次查看

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 项奖励
3 条消息(共 8 条)
3,879 次查看

ok i found what to do thanks!

0 项奖励
4 条消息(共 8 条)
3,873 次查看

@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 项奖励
5 条消息(共 8 条)
3,868 次查看

Comparison

0 项奖励
6 条消息(共 8 条)
3,864 次查看
解答
已被主题作者 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 项奖励
7 条消息(共 8 条)
3,827 次查看

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 项奖励
8 条消息(共 8 条)
3,795 次查看