How do you link to the pert3 dll, Test scripts, How do you run a script – Teledyne LeCroy PeRT3 Software Interface User Manual
Page 5: Table 2 c example for running a script

support an arbitrary number of driver DLL's for different devices which you don't know about at compile
time.
Statically linking doesn't require any extra code, but it does require you have the DLL in advance. The
simplest way to statically link to a DLL is to include the corresponding .lib file when you link. The .lib
file is created by the linker when the DLL is created.
In order to work with PeRT
3
add LCPeRT.lib as an additional library to the linker and it should link
without an error. In Visual Studio, right click on the project, select properties, go to the Linker/Input add
LCPeRT.lib to the Additional Dependencies property. Make sure LCPeRT.lib is in the linker search path.
You can add to that path by modifying the Additional Library Directories property under Linker/General.
To run your application, you'll need LCPeRT.dll in the path - simplest thing is to put it in the same
directory with your executable.
How do you link to the PeRT3 DLL?
LCPeRT.dll is a standard C interface DLL. The installer installs the DLL along with “.h” header file and
a “.lib” file you can use to statically link to the DLL (earlier versions of the installer don't include the
“.lib” file).
It is recommended that in your production code, you dynamically link to the DLL or delay load it so that
your code is not tied to a specific version of the DLL. Whenever the PeRT
3
software, hardware or
firmware is changed a new DLL will accompany the installation software. Generally new versions will
be backward compatible so that your software will not need to be recompiled.
Note:
o It depends on KERNEL32.dll and WS2_32.dll which are typically already in the windows system
directory.
o If you are running in a 64-bit environment, use the LCPeRT64.dll and LCPeRT64.lib.
Any breaking changes will be noted at the top of the readme file in future installations.
Test Scripts
How do you run a script?
Here is the simplest example (in C) using the LCPeRT API:
#define FALSE 0
int SessionId;
int rc = LCPeRT_init(“127.0.0.1”, FALSE, FALSE, &SessionId);
if (rc != 0)
// DO ERROR HANDLING HERE
rc = LCPeRT_RunTestScript(SessionId, “My Test Script”, FALSE);
if (rc != 0)
// DO ERROR HANDLING HERE
Table 1 C Example for Running a Script