08-06-2007 05:37 PM
08-07-2007 05:53 AM
Hi Verdulken,
try to put your cvi dll call into a subsequence and calls them as a new Thread or a new Execution...
@Verdulken wrote:
I need to be able to update and process system events from a user interface that is in a CVI DLL, this DLL is called from TestStand and the problem is that if I use the RunUserInterface () call inside my DLL then I can't continue to run my test sequence because TestStand is waiting for this module to come back. I need to be able to see this user interface trough the test sequence execution.
08-07-2007 10:53 AM
08-08-2007 02:20 AM
08-08-2007 12:34 PM
08-09-2007 08:17 AM
I'm pleased to helped you.
We have already encountered this kind of "troubles" starting from TS 1.1 on 2001...
Are you from Germany?
08-09-2007 11:13 AM
08-09-2007 11:35 AM
Dear Jose,
I'm from Italy I was in US several time the last was in 2005 in Austin for NiWeek for my company that is an Alliance in Italy.
We use TS from 2001 either with LV and CVI in order to optimize code and share tasks.
Just for curiosity, but I also know German language (I have made some part of my engineering study also in Austria) and I know the word "Verdunkeln" (that means to darken or to mask) but no "Verdulken" as you wrote as user name...
Regards
@Verdulken wrote:
I'm actually from the US (well, originally from Mexico) but I have used this user name in a lot of instances for a long time, I read it from a world war II sign when I was in Germany. My real name is Jose.This is the first time I use CVI with TestStand, I used CVI for years now but never with TestStand, only LabVIEW.R U in the US ?
08-09-2007 11:48 AM
Cool !!! I was in Italy in 1999 for 2 weeks, beautiful place. I think I just misspelled the name. I have another big problem now, maybe you could help me which I would really appreciate.
I need to load a comma delimited file to use in my program so I'm calling a function on my CVI DLL that loads the file and parses it, the problem is that when I call the function TestStand crashes and the problem seems to be the size of the arrays (due to stack size I think) because if I lower the arrays size and file size it works fine, the file is around 800Kbytes in size. Here is the function I wrote to do this:
int Load_Param_File (char *fileName)
{
int paramFile;
int no_args;
int i,j;
int error;
char *ptr;
//char *tmpstr;
//char *arg;
char tmpstr[PARAM_FILESIZE];
char arg[MAX_PARAM_ROWS+1][4000];
//arg = (char*)malloc((MAX_PARAM_ROWS+1)*4000*sizeof(char));
//tmpstr = (char*)malloc(PARAM_FILESIZE*sizeof(char));
/* Open file for read only purposes */
paramFile = OpenFile (fileName, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
/* read file and place contents into tmpstr */
error = ReadFile (paramFile, tmpstr, PARAM_FILESIZE);
/* Close file */
CloseFile (paramFile);
if (error > 0) {
/* Parse String */
ptr = strtok(tmpstr, "\n"); // separate rows first
for (i=0;i<=MAX_PARAM_ROWS && (ptr != NULL); i++) {
strcpy(arg[i],ptr);
ptr = strtok(NULL, "\n");
}
/* Parse into table */
for (i=0;i<=MAX_PARAM_ROWS; i++) {
ptr = strtok(arg[i],","); // separate columns
for (j=0;j<=MAX_PARAM_COLS && (ptr != NULL); j++) {
strcpy(parameters[i][j],ptr);
ptr = strtok(NULL, ",");
}
}
}
return error;
}
The array parameters is a global in my DLL. The code that is commented is another thing I tried, I didn't get the error but I don't get any data in the parameters array after it runs.
I really appreciate your help and thanks in advance.
Jose
08-13-2007 02:38 AM
Dear Jose,
your CVI code is plenty of possible error cause you don't make a boundary check of your array allocations so you can incour in buffer overflow... First of all is a good idea to use dynamic buffer but remember to free them at the end (also in case of error)...
Could be usefull if you read the file size (GetFileSize) before doing the allocation of the main file buffer 'tmpstr' in order to size them...
After that use 'strncpy' instead of 'strcpy' in order to assure that you limit the copy to your buffer size dim...
Last do an accurate debug session in order to discover your code failure...
Sincerely