LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can not change the page of tab control


I have a quite big LV program with Tab control VIs.
Tab control has two pages and the 1st page contains the initial settings for data acquisition.
page 2 contains the acquisition data visualized in realtime ( data acquired in a while loop.)

The problem in  this is, I can not change the pages of Tab control while acquistion. Its kind of stucked.
No button on the page 2 also seems not working. Only way to stop the program is through the abort button.

I attached a simple program simulating the same problem. It shows my basic software flow chart of the acquistion.

How can I correct this? Pls help me in this matter.

Rg

Naushica

0 Kudos
Message 1 of 8
(8,142 Views)

Oops this is the correct program.

It seems this program sometime stucks, but sometimes works fine. that means I can control the buttons while acquistion.
But some time it doesnt..

What is the matter with this program.

I experience the same trouble with my data acquiring program.


Rg

Naushica
0 Kudos
Message 2 of 8
(8,140 Views)
I don't understand what you are trying to do. With the way you have it coded, the while loop in the third frame runs and you can't exit until you hit the 'OK' button. You can switch tabs but the stop button will not do anything. Once the 'OK' button is clicked, then you have another while loop that only monitors the stop button. You can go back to page 1 but you can't change the values because frame 2 is not active and you are reading from local variables (why?) in frame 4 that don't get changed. Your program is doing exactly what you've written it to do but I don't know what you really intended it to do.
0 Kudos
Message 3 of 8
(8,117 Views)
Ok Dennis,
Actually i am relatively new to programming. SO may be u can show some bugs in this program if you can identify any.
Anyway this is what I want to do. I want to do some acquisition with a board.
Before an acquistion I want to set the initial parameters for the acquistion.(I used events for this)
When you said ok ( 1st page of tab), the acquisition starts and it will lasts until user wants to exit the program.
While acquisition I dont want to change the acquistion parameters. So I used local variables.
Only what is read in the event structure will be used for the acquistion .

The problem is some times the programs doesnt simply respond to any mouse clicks while acquisition. I simply have to abort the program to exit.
I can not confirm what are the parameters I set once the acquisition is on the fly.
Exit button or tab page changes doesnt seem to work. Why is this? What is the bug in this program?

Program flow explanantion

I have number variables in my program they are declared in the 1st frame.  I dont want any variables to declare in any other frames.
This is may be my practice I am using since c programming.  I dunno whether this is good for LV.

2nd frame simply sets the tab control to the 1st page as u can see.

What 3rd fram does is, I want certain acquisition parameters to be set using events.  User will set these parameters and when he clicks ok,
the acquistion parameters will be read and they will be used to do the acquisition. I read that events should be used inside a while loop and I used so.


5th frame will do the acquistion using the parameters read in the 3rd frame. I want to continue this until I hit exit button.


0 Kudos
Message 4 of 8
(8,098 Views)
Here's something that will work a little better I think.
Message 5 of 8
(8,072 Views)

Hello,

The reason why your front panel elements are becoming unresponsive is because in your event structure options you have the option 'Lock front panel until event case for this event completes' checked.  If you uncheck this you'll find the tab control will be accessable during acquisition. Also, when you click the OK button after the original click there is no part of the code that can handle that again, so it may be worth having a while loop around the sequence so it can be picked up.

In general it is a bad idea to use event structures within sequence structures. This is because, in the frames that dont contain the event structure, front panel objects will still be polled by the event structure, not letting any user interface interaction to be processed.

In addition, if you simply remove the events structure from the code submitted (right click the event structure and select 'Remove event Structure' ) which will leave everything inside that event inside the housing while loop, then the program works in the same way.

All of this information is listed in the LabVIEW help files found by clicking 'Help' on the toolbar inside LabVIEW.

Hope this is of use.

 

Tom
NIUK

Message 6 of 8
(8,047 Views)

Tom,
   Thank you very much. Tom It worked. Thank you very much for your valuable tip. All I had to do is uncheck the item you told.
It was a headache why the program locks sometimes and sometimes not. I was making small mockup programmes to simulate
the big one i am writing it all gave me the same trouble. i couldnot see the trouble.

Anyway I have one question about the polling..  So what do you mean by not letting anyother user interface to be processed?
I used exit button to stop the acquisition and it worked isnt it.

 The reason I am using event is, in my program I will have different buttons such as "OK", "save Settings", "Load Settings"
etc. They will be handled in the same event structure in different cases.  but the mock up program I sent  you, I didnt mention it.
Is still not using event structure is better idea?


BTW,Dennis thanks for the program. I will try to see on it  whether I can use it or not....Smiley Wink







0 Kudos
Message 7 of 8
(8,025 Views)
 

http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/using_events_in_labview/ 

Everything you'll need to know should be contained in this online manual help file. It contians different approaches on event driven programming and will probably benfit you with your current application and in the future.

Enjoy.

Tom
NIUK

 

0 Kudos
Message 8 of 8
(8,013 Views)