LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems of DataSocket and EasyTab

HI!
I am programming on a application, which can fetch data files from remote Ftp servers and plot the data on a graph .
One graph must be placed on one panel,and the amount of panels is decided by the user(less than20 but not fixed ),
each panel has the same kind of controls but so many controls. 
I am using DataSocket and EasyTab on winxp sp2 running CVI 6.0
 
Problems are
1.Can I Use DataSocket to connect serverals servers at same time? If can, how to design the CallBacks?
2.How to copy the panels and the controls , must i duplicate them one after one? Can you offer me some examples ?
 
thanks 
 
r0c
06-06-06(a good date *_^)
0 Kudos
Message 1 of 17
(5,654 Views)

Regarding your second question, you don't need to duplicate your panel in the UIR file: a panel can be loaded more times in memory, each time is a new instance indipendent from previous one(s) and identified by a different handle; this handle is received by all callbacks for controls in the panel so in the callbacks you can distinguish which panel is operated on; the same handle is to be passed to all functions manipulating controls on the panels so that you can access individual controls on a specific panel independently from the other panels.

So, to load multiple times a panel in a EasyTab control you can do the following:

EasyTab_LoadPanels (panelHandle, theEasyTabControlID, 1, "myFile.UIR", __CVIUserHInst,
                    PANEL, &ph1, PANEL, &ph2, PANEL, &ph3, 0);

or, alternatively,

ph1 = LoadPanel (0, "myFile.uir", PANEL);
ph2 = LoadPanel (0, "myFile.uir", PANEL);
ph3 = LoadPanel (0, "myFile.uir", PANEL);
EasyTab_AddPanels (panelHandle, theEasyTabControlID, 1, ph1, ph2, ph3, 0);



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 17
(5,650 Views)
I see. Is to say when i duplicate  a panel and it's controls , such as buttons etc.  And I press the "New" button , CVI will go to the
original CallBack Fuction of the button , and process the event with new panel handle and new control ID
 
AM I right? 
 
thanks
0 Kudos
Message 3 of 17
(5,640 Views)


@Coding wrote:
I see. Is to say when i duplicate  a panel and it's controls , such as buttons etc.  And I press the "New" button , CVI will go to the
original CallBack Fuction of the button , and process the event with new panel handle and new control ID
 
AM I right? 
 
thanks



You're almost right: only the panel handle changes between various instances of the same panel. Control IDs do not change since they are related to the individual panel: if you look at the .H file associated to a UIR file, you will see that control IDs are used as macros (that is you find a row like for example  #define PANEL_NUMERIC  3   for every control in your UIR); when you are addressing a control on the panel, the control ID is pre-processed by the compilator and translated into its corresponding number, which is unique throughout the panel, so that what you are really doing is address the i-th control on the panel identified by the handle [said in other way: using SetCtrlVal (panelHandle, PANEL_NUMERIC...) is equivalent to use SetCtrlVal (panelHandle, 3, ...) ]. With such a mechanism, control IDs can remain the same for all copies of the panel since you operate on the panel actually addressed by the panelHandle you are using.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 17
(5,635 Views)
Hi i want to ask related question.  I have seen example of TCP/IP sever/Client program. But in my application FTP server is running on server PC and from my client PC i want to read particular data file from serverPC. At client side i am plotting graph my data file.Do you have such example program?
0 Kudos
Message 5 of 17
(5,369 Views)
Hi Vishnu, starting from version 7 CVI comes with an Internet library that includes a set of functions to access FTP servers. There is also a sample FTP client in samples\internet\ftpclnt folder: have you already looked at it?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 17
(5,353 Views)
Dear Roberto, I have LabWindows/CVI 6.0 and i couldn't find such sample program in that. Is FTP Client is posible in LabWindows/CVI 6.0. Do you have such sample example.
--Vishnu
0 Kudos
Message 7 of 17
(5,352 Views)
FTP is possible in CVI 6.0 either using SDK function to access the server or using DataSocket: a quick search in the forum returned this thread that may be of some help to you. I suggest you make an extensive search for old posts related to these arguments.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 17
(5,345 Views)
What type of SDK functions--is it TCP functions? or DataSocket functions?
0 Kudos
Message 9 of 17
(5,325 Views)
I have developed in the past a small CVI6 application to update an ftp server using sdk: I am attaching my code for this. It's just a skeleton since it was only a test but has successfully run for some weeks without major problems: even if it's been a long time since I have used it, it may be of some help to you.


Message Edited by Roberto Bozzolo on 07-02-2008 08:50 AM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 10 of 17
(5,319 Views)