I am using Labwindows CVI to use a experimental equipment. And I made a code but there is a error.
treadbuff value is 0x06818A30 "" However, strtok function returns NULL value so error happens in the last row.
I don't know what is wrong here.
#define MAX_COMM_LEN 128
char *tbuff;
char *treadbuff;
double tcurrent;
treadbuff = (char*)malloc(MAX_COMM_LEN*sizeof(char));
memset(treadbuff, 0x0, MAX_COMM_LEN);
tbuff = (char*)malloc(MAX_COMM_LEN*sizeof(char));
memset(tbuff, 0x0, MAX_COMM_LEN);
tbuff = strtok (treadbuff, "A,");
tcurrent = atof(tbuff);