LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset button

Hi guys,

 

I need to reinitialize or like reset my counter to zero. I am using a counter that counts the revolution, looking at some examples I can send a command and preset a number of revolution I wanted. I want to have a Reset button that can reset it to and then I can send a new command. Any ideas? here is what the block diagram looks like.

 

thanks all

 

0 Kudos
Message 1 of 11
(3,156 Views)

I'm a little confused... is this a sub-VI or a main application?

 

It looks like you:

 

1) Open a serial connection.

 

2) Optionally send "string to write" over the VISA.

 

3) Wait, no matter what, some number of ms.

 

4) Optionally perform a read.

 

5) Close out and check for errors.

 

What is your end-goal? Do you want to read repeated values? Do you want to be able to send commands over and over again?

0 Kudos
Message 2 of 11
(3,148 Views)

Your post doesn't make any sense.  What does the bd have to do with your question.  You simply need to reset a counter, is this correct?  Are you sending the command to reset serially?  I would have to assume so.  Choose whatever command you want to send at the press of a button.  Does it really matter?  Please provide more specifics about what you are trying to accomplish.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 11
(3,132 Views)

The counter has two things preset and counter. From the program that I have I can send a command set the values of the preset and counter. Instead of writing this command; is there  anyway I can just set this two values? My goal is to have two displays and two buttons for both preset and counter. After each iteration I want to reset the values just by pressing a button instead of writing command after each iteration. I hope this is clear.

 

Thank you

0 Kudos
Message 4 of 11
(3,098 Views)

You haven't stated exactly what you are doing.  Are you communicating between two PCs?  One sends a command to reset a counter on the other? It sounds like you may need a shared variable if your controls are running from another PC. Can you post your code for the controls so we can get a clearer picture of what it is you are trying to do?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 5 of 11
(3,092 Views)

I am communicating between counter and PC. Look at the code in the attachment thats how I set the value of preset if I want to read I just write N0ta*

0 Kudos
Message 6 of 11
(3,084 Views)

You need to post your VI. Just posting pictures of the code / front panel is not sufficient. The actual ".vi" file you are using needs to be posted.

0 Kudos
Message 7 of 11
(3,053 Views)

He's using the Basic Serial Write and Read example. What he needs to do is actually write a new VI with the buttons and VISA Writes with the necessary constants.

0 Kudos
Message 8 of 11
(3,043 Views)

Is it a good idea to use a state machine for this. Creating two cases instead of using a button??????

0 Kudos
Message 9 of 11
(3,034 Views)

You can use a state machine for read/write or two separate VIs.  Either would be fine, but I would not try to control visa using a boolean.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 10 of 11
(3,019 Views)