LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Button help please

Solved!
Go to solution

Hello I am developing a VI that gathers data with a thermocouple( USB-TC). I am having trouble writing software. I want 8 bottons on the front panel that start the data logging and then when you press it again it starts a timer. After a while I want to press it again to stop data logging. I want the front panel to indicate when the highest temperature was read durring data logging time. Is this possible?

 

0 Kudos
Message 1 of 22
(4,766 Views)

You probably need to add a few more explanations.

You are only mentioning very few functions (start data logging, start timer, stop logging, etc.) So why do you need 8 buttons?


nicholas03 wrote:

 Is this possible?


Everything is possible! 😄

Message 2 of 22
(4,761 Views)
The eight buttons are for eight different thermocouples. I would like each one of the buttons to toggle from an idle state, to a logging state, to a waiting for maximum temp state and a test completed state. Some of these states will be based on user input and others from the code.  
0 Kudos
Message 3 of 22
(4,708 Views)

Based on that last post by you, I'd say a state machine would be your best option :smileyvery-happy:

It sounds like you don't have any idea where to start so I'd look up stuff about using VISA in labview seeing as your connection is USB, using XY graphs/arrays, the write to spreadsheet file VI. If you try to code something up, even if its a hack job, people can help you a lot more as I've learned. Also, trying it on your own helps a lot and helps you remember how to do stuff in the future (at least thats what i've learned). Theres lots of info on this site that you can use and should look at for examples and you'd be surprised how far you can get. 

0 Kudos
Message 4 of 22
(4,703 Views)

I am just trying to build a control that toggles the buttons through four cases not just on and off.

0 Kudos
Message 5 of 22
(4,684 Views)
I dont have labview on this computer and have only been using it for a few months so I'm not sure if this is the best solution. And I'm sorry I can't show you an example but what about this. You have 3 States in a state machine. You start in the idle state. The first time the button is pressed it takes you to the logging state. In the logging state you read data and when the new point read is less than the one before, you know your max temp was reached on the prior point. You can record that value, graph it etc, whatever you need to do. Once the max temp is reached (i.e. true) it sends you  to your test completed state(i only count three states here but I think it does what you need it to). Again im sorry that I cant actually code this but hopefully you understand, someone else can draw it up, or someone can give you a better solution.
0 Kudos
Message 6 of 22
(4,666 Views)

My last post was messed, I tried to edit it and ran outta time so here goes again..  

 

You have 4 States in a state machine inside an event structure. Each time you enter the event structure it should be set up to check the previous state you were in (idle, data logging, etc). You start in the idle state. The first time the button is pressed it notes a value change in the event structure and takes you to the logging state. In the logging state you read data. When this is done you click the button again so another value change is noted and you enter the event structure.  Because you were in the data logging state, your state machine should be set up to pass you to the check for max value.  You can record that value, graph it etc, whatever you need to do. Press the button again, another value change is noted and it checks your previous state(check max value). It then passes you  to the next and final state (test completed). This way you only have to hit the button once at the beginning. Again im sorry that I cant actually code this but hopefully you understand, someone else can draw it up, or someone can give you a better solution. Shiznit that was confusing. Like is said on here a block diagram is worth 1000 words. Sorry if i failed 😕

Message 7 of 22
(4,663 Views)
I will try the state machine as you describe, but do you know how to change the text and appearance of the buttons so that each state is different on the user interface (front panel)?
0 Kudos
Message 8 of 22
(4,650 Views)

nicholas03 wrote:
I will try the state machine as you describe, but do you know how to change the text and appearance of the buttons so that each state is different on the user interface (front panel)?
Instead of 4 buttons for each thermocouple, how about a text ring control?
Since only one of the states will be occurring at any 1 time, you could just select the state from a text ring control. 

 

Message Edited by Cory K on 12-31-2008 10:02 AM
Cory K
Message 9 of 22
(4,639 Views)

use cory's idea... 🙂

 

http://www.kaczurba.pl/?current_page=5,4,0, 

  

Message Edited by for(imstuck) on 12-31-2008 10:46 AM
0 Kudos
Message 10 of 22
(4,631 Views)