LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using tab control

Hi everybody,
first of all I have to say I'm pretty new to LabVIEW.
I am working with LV PDA 7.1, a pocket PC 2003 device and a NI-DAQ6062E
I have to develop an application for my thesis, which acquire data through the DAQ6062e connected to the PPC and to use the wifi to send this data over TCP to a desktop PC.
So let us say I have a client running on the PPC and a server on a remote machine.

Now the problem. On PPC the screen is rather little so I thought to use tabs to overcome this problem. I want that my application acquires data and display it on a Chart on the PPC and if chosen by the user, that it sends data over TCP.
So I've put netwprk settings on a tab and acquisition settings and chart on a second tab.

But if I start acquisition, I can't change tab anymore.

So, is there a way to make this possible? Something like it was multitasking

I hope I've explained myself, sorry for my bad english and thanks in advance for answers!

G.Paolo Mazzola
0 Kudos
Message 1 of 8
(3,812 Views)
There can be any number of reasons for why your tab control doesn't respond: It's disabled, there isn't enough spare time in the program to allow for user interaction and also a bug in the program. Does the tab stop working only after you start the acquisition? Does the application stop responding completely or is just the tab?
I suggest you post your code so it can be reviewed.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(3,789 Views)
Often when a program becomes unresponsive to user events, the data acquisition is hogging the CPU. Multithreading can alleviate this problem and is very easy to do in labview (relative to traditional c/c++ languages). If you want to have GUI events and data acquisition at the same time place each in its own while loop, then each will run in its own thread. It is very important that the data acquisition has more priority so data is not lost. Inter-Thread communiactions can be accomplished via synchronization objects such as a shared queue or (easy but not suggested) a global variable. To make sure that the GUI is using the minimal CPU time use an event structure or implicit wait statements inside the loop. I have only had to do such programming on a traditional PC so I dont know if there are any additional complications with your situation. Good Luck!
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 8
(3,782 Views)
Hi, thanks for your answers!
I followed your advice and putting two different while loops, now it works (better than before)
Now it let me change the tab while executing acquisition. However after some time of running, it gets less responsive and takes a while to catch the click (on tabs and switches).
Another problem is that on the server I don't tdisplay the same thing I display on the client (as I wish)
I'm attaching the 2 VIs. I removed the part of DAQ cause not everybody have that card, and I replaced it with a random/sine generation

Thanks again.
G.Paolo
0 Kudos
Message 4 of 8
(3,775 Views)
There was a missing VI called Query IP Subvi, but I did notice one thing. In the client vi, after pushing the connect button, the case structure goes to the true case only once and then is false thereafter, so your disconnect button which is in the true case cannot be used. The tabs seem to work fine.
0 Kudos
Message 5 of 8
(3,758 Views)
Ops sorry. Yes you are right MedMike, I forgot the subVI. Here it is (it does just a chek on the local IP).
Howevere I can not find what you are saying. When I run the client it connects and disconnects.

@falkpl:
I think global variables should be bad in LabVIEW as in other languages, isn'it?
So you were talking about shared queues, and in fact I need to communicate from thread to thread and syncronize them.
Where could I find examples about how create such queues?

Thanks,
G.Paolo
0 Kudos
Message 6 of 8
(3,745 Views)
Yes Globals are bad, and I only suggested them as a method of getting a sloppy version functional, with globals and multithreads, race conditions can occur and are a real pain to debug. To use message passing between threads is simple, create 2 loops, and pass the result of an "obtain queue" to both loops. now we have a reference to a common synchronization object which will allow us to communicate between threads. This is a simple consumer producer model, one thread will enqueue data (each quque is created with a specific data type, any labview data types including custom clusters) and the other thread can wait on the queue usind dequeue and an infinite or set timout or even periodically check the queue to see if it has any elements in it. I have attached a simple example. I hav not had to send data bi dirrectional in labview, this case is harder than the producer consumer model. I have included a LV 7.0 simple example of passing strings between threads. You can change that rate (period in ms) of the read write and timouts to see how it affects the queue.

-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 7 of 8
(3,732 Views)
Thanks for the example VI, now I'll try to figure out how it works!
I attach my solution, but I think that probably it is not very elegant
0 Kudos
Message 8 of 8
(3,719 Views)