08-25-2010 01:11 PM
I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering.
Solved! Go to Solution.
08-25-2010 01:12 PM
I would not use a global fo that. Tell us what you are trying to do and I think there will be a better answer. Do you have code of what you are trying to accomplish?
08-25-2010 01:13 PM
Your question is WAY TOO VAGUE and too confusing. A "start button of global variable" makes no sense. What is this sequence that you're talking about? Is this some sort of test sequence? Please provide more details. We are not mind readers.
Do you have code that you've created? If so, post it and tell us what you're trying to do.
08-25-2010 01:17 PM
Thanks for answering. I attached the code below.
What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
08-25-2010 01:21 PM
Get rid of your timeout event. Make an event on the Value Change of the stop button, and another event on the value change of the start button. No need to use a mouse down event and a timeout event.
08-25-2010 01:23 PM
I do not see the buttons that you had in the last respnce. I would suggest that you use the event structure in the same loop as your state machine. This will eliminate the need for what I think you are trying to do. Then you can set up event to key off of multipule buttons.
08-25-2010 01:30 PM
Your top loop is useless. Delete it. Put the start button in place of the local variable in the Wait for Start case. If you make the mechanical action of your start button to Latch When Released, you won't have to write false constants to it, like you are doing with the global start. In fact, you don't even need the global at all. Same for stop button, It is already set to latch type. You have several choices on how to stop the program. You could put the stop button inside the Wait for Start case and wire it to the loop stop sign. Or you could create a stop case and have the stop button send a stop enum to the case selector. In here you wire a true constant to the stop sign and put whatever clean up code you would have.
08-25-2010 01:31 PM
@Perry Liu wrote:
Thanks for answering. I attached the code below.
What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
There is no "Get Voc/Isc" or "GO" button anywhere on the front panel, and I have no idea what you mean by "Setup Linear Stair Sweep" and "start sweep". Are you sure you uploaded the correct code?
Other VI comments:
08-25-2010 01:40 PM
I am so sorry that I upload a wrong code, this is the right one. Sorry
08-25-2010 03:19 PM
Ok I am looking at your code. How do you want to combine the "setup DCV and Outp ON OFF" as one when they have different code? Which code do you want to accomplish? Which button do you want to keep?
Same with the other two buttons?
Have you ever worked with an arrrayed state machine?