I am following the DataPort example from ilogix to read out a StateMate project. I copied & pasted the given example, but it does not work. The source looks like this:
FONT=Courier New#include "C:/I-Logix/stmm/4.1/include/dataport.h"
int status, success;
printf ("Enter name of Statemate project: ");
scanf ("%s", name);
printf ("Enter directory pathname for your Workarea: ");
scanf ("%s", dir);
success = COLOR=Redstm_init_uad (name, dir, automatic_transaction, &status);[/COLOR]
printf ("Init function failed. Reason: status code %d", status);
The compiler error is:
FONT=Courier Newmain.c(14): error C2197: 'stm_init_uad' : too many arguments for call through pointer-to-function[/FONT]
Does anyone have an idea? I would really appreciate it!
Have you defined the required environment variable DLL_LINK
to use the right function declaration under WINDOWS?
Pinned topic Compiling DataPort Example with MS Visual Studio
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2010-06-20T20:09:06Z at 2010-06-20T20:09:06Z by GertW
Bondbest 27000386AG1 Post
Re: Compiling DataPort Example with MS Visual Studio2010-06-05T07:26:14ZThis is the accepted answer. This is the accepted answer.I too am facing the same problem.Can you describe more about the environment settings and the detailed procedure of how to go about the compiling and linking.
GertW 2700020C7Y30 Posts
Re: Compiling DataPort Example with MS Visual Studio2010-06-20T20:09:06ZThis is the accepted answer. This is the accepted answer.I do not have a problem running this sample, using Visual Studio 6.0 and .Net 2003 on WinXP. Other compilers are not supported by Statemate.
cl -Zi -c my_prog.c /DDLL_LINK
link my_prog.obj dataport.lib /out:my_prog.exe
I set all environment variables in a batch file that are defined in run_stmm.bat and vcvars32.bat.
Then I compile and run the dataport program from command line.
Just type in
nmake -f makefile
It generates a my_prog.exe.