02-20-2013 07:57 AM
Hello all..
i am working on a GUI, that will accept a packet of serial data and display the data on various gauges...
Its working properly when i use a single GUI window...
But i want to do the same with TABS in my GUI...
Like pressure tab can only show gauges with pressure... temperatur tab can only show temperature...
I first accept the serial data using event detect a char function...
But then what to do???
how to route the data to proper tab panels??
Regards
Salman
02-20-2013 08:35 AM - edited 02-20-2013 08:38 AM
I really don't understand the question...
Once you have read the message from the serial port, it's up to you to properly decode it and drive results to the proper indicators. If your user interface is structured with tabbed pages, you will need to use the proper panel handle (see GetPanelHandleFromTabPage function) in SetCtrlVal functions.
If you are not fami,liar with tab controls, you can take a look at tabpanels.prj example in samples\userint folder and to the online help. There are also several posts in the forum about them.
02-20-2013 08:52 AM
Thanks for the reply...
i decoded the data properly...
Now im facing difficulties in routing data to various indicators in different tabs.....
can u give me a sample code for doing so??
like my main gui name is serial and 2 tabs i placed with names TAB1 and TAB2.,,
my data is in variables temp1, temp2 and presure1 and presure2...
i want to show temp1 and temp2 in indicators placed in TAB1 and presure1 and presure2 in indicators placed in TAB2..
all these temp1, temp2 and presure1 and presure2 are float values...
in short i want to do following things...
1. open comport
2. accept serial packet of 20 bytes..
3. decode serial packet and place values in variables temp1, temp2 and presure1 and presure2...
4. show temp1 and temp2 in indicators placed in TAB1 and presure1 and presure2 in indicators placed in TAB2..
02-20-2013 09:27 AM
Take a look at the example in this page: inside PlotButton function you will find functions to retrieve the panel handles associated to the tab pages and to manipulate controls on the tabs (specifically graph some data on a graph control, but the concepl applies to every control).
There is really nothing difficult in programming woth tab control, provided you understand the basic concept that each tab page behaves as a stand-alone panel (i.e. has its own panel handle that you must use to gest/set values on control on the tab page).
02-23-2013 03:21 AM
02-24-2013 05:25 AM
Nope, I can't help you this way! I'm not that kind of magician that can guess what's in your project without looking at it!
Please post some code or better a small sample project so that we can revise it and point you to the right way to address your goal.
What I can tell you in this moment is to add some error checking: trap the return code from both GetPanelHandleFromTabPage and from SetCtrlVal functions and if negative pass it to GetGeneralErrorString to get a description of the error. It may help you to solve your problem.
02-25-2013 08:55 AM
Hello salmankhalid16,
When does your CVICALLBACK display get called? Have you set up any break points in that section to make sure you are entering it?