idl program for calling c program [message #70049] |
Sun, 07 March 2010 07:54  |
ngg2424
Messages: 1 Registered: March 2010
|
Junior Member |
|
|
hi.....
im new to idl but im supposed to do project based on image
processing.Hence this question--
my project is a simple security monitoring system which controls a
door by authenticating a persons image.
my problem is that i have to send a signal from the pc to the
microcontroller through uart( for it to recognise and open the
door).the signal can be generated by the c program it seems...i
require the codings for this....pls help.....
|
|
|
Re: idl program for calling c program [message #70098 is a reply to message #70049] |
Thu, 11 March 2010 14:46  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Mar 7, 10:54 am, ngg2424 <ngg2...@gmail.com> wrote:
> hi.....
> im new to idl but im supposed to do project based on image
> processing.Hence this question--
> my project is a simple security monitoring system which controls a
> door by authenticating a persons image.
Simple? If identifying a person from an image taken
by a camera is "simple" I wonder what a "complex"
problem is to you...
Ciao,
Paolo
> my problem is that i have to send a signal from the pc to the
> microcontroller through uart( for it to recognise and open the
> door).the signal can be generated by the c program it seems...i
> require the codings for this....pls help.....
|
|
|
Re: idl program for calling c program [message #70100 is a reply to message #70049] |
Thu, 11 March 2010 14:28  |
rogass
Messages: 200 Registered: April 2008
|
Senior Member |
|
|
On 7 Mrz., 16:54, ngg2424 <ngg2...@gmail.com> wrote:
> hi.....
> im new to idl but im supposed to do project based on image
> processing.Hence this question--
> my project is a simple security monitoring system which controls a
> door by authenticating a persons image.
> my problem is that i have to send a signal from the pc to the
> microcontroller through uart( for it to recognise and open the
> door).the signal can be generated by the c program it seems...i
> require the codings for this....pls help.....
Hi,
on Windows it may be like this:
pro
cr_test_c_capabilties,routinename=routinename,sampleparamete r=sampleparameter,routinepath=routinepath
routinename = keyword_set(routinename)?
routinename : 'my_greatest_c_programm_ever'
sampleparameter = keyword_set(sampleparameter) ? sampleparameter : 10.
routinepath = keyword_set(routinepath)? routinepath : 'c:\'
PRINT, 'Compiler: ',!MAKE_DLL.COMPILER_NAME
;correct make_dll settings
!make_dll.cc = 'cl %X -D_DLL -DMSWIN -DWIN32 -D_MT /nologo /I"C:
\Program Files\ITT\IDL64\external\include" /c %C /Fo%O'
if !version.os_family eq 'Windows' then begin
filename = routinename+'.c'
;creating source code within IDL
GET_LUN, u
OPENW, u, routinepath+filename
printf,u,'#include <stdio.h>'
printf,u,'#include <stdlib.h>'
printf,u,'int main(int argc, char* argv[])'
printf,u,'{return 5+atoi(argv[1]);}'
free_lun,u
;set environment variables in both windows and idl
SETENV, 'INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
\Include;%INCLUDE%'
SETENV, 'LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib;
%LIB%'
SETENV, 'PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
\bin;%PATH%'
spawn, 'Set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
\bin;%PATH%'
spawn, 'Set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\Include;%INCLUDE%'
spawn, 'Set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
\lib;%LIB%'
;compile .c and make binary and dll
spawn, '%systemroot%\system32\cmd.exe /c C:\Progra~2\MICROS~1.0\VC\bin
\cl.exe /LD /Gd -nologo '+routinepath+filename
spawn, '%systemroot%\system32\cmd.exe /c C:\Progra~2\MICROS~1.0\VC\bin
\cl.exe '+routinepath+filename
make_dll,routinename,routinename, input_directory=routinepath,/
nocleanup
;execute script
spawn, routinename+'
'+strcompress(sampleparameter),result,exit_status=a
endif else begin
endelse
print,'Result: ',a
end
As you can see, 'my' cl comes from VisualC.
Hope it helps somehow.
Cheers
CR
|
|
|