LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

STDIO WINDOW

Hi,
    I have developed a system to acquire data from headtracker using the serial port in labwindows . The system works fine while acquiring the data but there are a few issues.
  The data i acquire from the serial port is in streamed mode(continuously flowing). I save the data to a file and also display it continuously on the STDIO window. Now when the data is flowing on the STDIO window i cannot use any of the buttons on the main panel to control data flow. I would like to stop the data flow in between at desired points. I try pressing buttons on the front panel but nothing happens( i cannot press them). i would like to see the data on the screen continuously and at the same time control it using the stop data and resynchronise data buttons on the uir. Also when i close the STDIO window the program closes(terminates) instead of going back to the panel. I have attached that particular section of my code.
 
Also are there executable files in labwindows that can be saved and used on other computers that dont have labwindows however u can run ur program on that.There is something like that in labview 8.  If yes they how do i do that.
Waiting for a reply
Thanking you
Kunal Chaniary
 
0 Kudos
Message 1 of 5
(3,851 Views)

1) It may be that when the data is flowing to the STDIO, that it is so intensive it is taking all the CPU time and not allowing for other servicing.  You may want to look into spawning a thread (CMTSchedulethread) to make this time share more.

2) If you made your program a DOS type application and this is what created your window, then when you kill it, you kill your program.  I think I put out IO to a window also and closing that window closes your program.  It  may be because it is part of your executable so when you kill part, you kill all.  Just don't close the STDIO window.

3) to distribute an executable(in CVI8.0 paralnce), go under Build-Distributions-Manage distributions  to create a distribution file.  You can then go to Build-distributions-Build xxx (where xxx is the name of your project).  This will build a directory called cvidistkit which will contain a directory called build1 (and maybe build2....buildN depending on size).  Copy the files in build1 onto a CD, memory stick, or any media and you can take that to any other computer (running proper OS) and run the Setup.exe file that is in the build1 directory.  this installs everything you need onto the target computer.  Any ancilliary files (input files, password files, etc.) will need to be managed when you do the "manage distribution" function.

0 Kudos
Message 2 of 5
(3,839 Views)

I looked at the sample code you posted here: http://forums.ni.com/attachments/ni/180/22741/1/headtracker1.txt.  There is a way to capture windows events to prevent the stdio window from closing your application, but I can not remember what it is at the moment.  Have you considered putting numeric indicators on your panel and using them to display the bird_data information.  This brings the data display into the cvi environment and eliminates the much slower stdio output along with the related issues.

What you would do is simply replace the printf with SetCtrlAttribute(panel, control, ATTR_CTRL_VAL, pos[0])... etc.  where control is the ID for each of the numeric indicators you create on the user interface.  You would create one for each value you wish to display.  This also opens up a number of other options to display the position and angles on a graph or image format.

As scomack pointed out, you will create a distribution kit to install your application on PCs that do not have CVI installed.  Once this has been run the first time, the CVI runtime library will have been installed along with your application.  At this point when you need to make updates you can change just the .exe/uir file, or issue a new distribution kit, your choice.  Uir files can also be embedded within the exe, so only the exe has to be updated.  Distributing only an exe (and not the entire runtime) can be usefull when distributing applications where small distribution size is important.

Good Luck. 

 

0 Kudos
Message 3 of 5
(3,820 Views)
Hi,
    I am currently integrating a headtracker to the computer using labwindows via serial port..
Now i have calculated the values of pos[0],pos[1]ang[0]....using
pos[0] = bird_data->position.nX * 36 / 32767.;
 
Each time pos[0] is calculated the setCtrlAttribute updates the value of pos[0] on a numeric indicator on .uir named XDATA. Similar is the case for pos1,pos2,ang1...
 
SetCtrlAttribute (mpanel,MPANEL_XDATA , ATTR_CTRL_VAL, pos[0]);
SetCtrlAttribute (mpanel,MPANEL_YDATA , ATTR_CTRL_VAL, pos[1]);
SetCtrlAttribute (mpanel,MPANEL_ZDATA , ATTR_CTRL_VAL, pos[2]);
SetCtrlAttribute (mpanel,MPANEL_YAWDATA , ATTR_CTRL_VAL,   ang[0]);
SetCtrlAttribute (mpanel,MPANEL_PITCHDATA , ATTR_CTRL_VAL, ang[1]);
 
However on debugging i get  error messages
 NEW1.c - 6 errors
  230, 26   Undeclared identifier 'MPANEL_XDATA'.
  231, 26   Undeclared identifier 'MPANEL_YDATA'.
  232, 26   Undeclared identifier 'MPANEL_ZDATA'.
  233, 26   Undeclared identifier 'MPANEL_YAWDATA'.
  234, 26   Undeclared identifier 'MPANEL_PITCHDATA'.
 
I checked the header file(.h) and it already has these indicators named. What could be wrong?
 
Kunal Chaniary

 
0 Kudos
Message 4 of 5
(3,752 Views)
It looks as if the .h file associated to your user interface file is not included in new1.c: you must esplicitly include it in all source files that access user interface controls in order for the compiler to run without errors.


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 5 of 5
(3,735 Views)