02-09-2006 04:21 AM
02-09-2006 05:14 AM
1). Select the "LabWindows/CVI" adaptor from the adaptor drop-down and insert an action step
2). Right-Click on the action step and select "Specify Module..."
3). Under "Module Pathname" select your dll.
4). Under Function Name select your function, ie Read_SerialPort
5). It should pop-up with This function has parameter information. Would you like to use it?". Click YES.
6). It may pop-up with a message stating there is not enough information to determine if the function returns an array or a single item. Select Pointer to single item and click ok.
7). Fill in the value expressions for port and return string. Click Ok.
Hope this helps.
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
02-09-2006 09:19 AM
Hai,
Thanks for the reply.
The trouble is I do not have any parameter information in DLL.When I select/load the function from DLL, it pop appears "This function doesn't have parameter information in the DLL. Do you wan to use the code template to specify the function prototype".
Any clues....
02-10-2006 03:45 AM
02-10-2006 08:27 AM
You cannot return a string as the return value of a function to TestStand, but you can return a string as a char buffer parameter.
Declare your function as follows. In C, you cannot assign a string to an array, you must use a function like strcpy() to copy the string:
void __declspec(dllexport) Read_SerialPort(char data[])
{
strcpy(data, "Hello");
}
If you are using CVI 7.1 or greater and TestStand 3.1 or greater, TestStand will get the type information directly from the DLL. Otherwise, you can either create a type library using CVI (see http://digital.ni.com/public.nsf/websearch/BCB57B5F7E0D292486256BFA005DAD92?OpenDocument), or you can just define the parameter types manually in TestStand. For this function, you would declare a String parameter with a type of C String Buffer. Set the buffer size to the largest size string you will return.
02-13-2006 06:50 AM
Hai,
I did created the function panel with function prototype and created the DLL. But When I loaded the DLL into TestStand I get am message that "The parameter information for this function could not be read. Return value is of an unsupported type"
Attached is the code I used in CVI....
02-13-2006 10:00 AM
05-16-2006 10:28 AM
05-16-2006 10:55 AM
05-16-2006 11:03 AM