Summary
Question
Answer
1. Prerequisites
This tasks assumes that the VTS already is installed and you are accessing the data using
TruClient functions.
2. Include VTS functions in the C-functions.c file
a. From the Solution Explorer > Extra Files, open the C-functions.c file and insert clanguage
code. The following is an example of how to send data to VTS:
#include "SharedParameter.h"
void main()
{
}
void connectVTS()
{
PVCI2 pvci = 0;
lr_load_dll("SharedParameter.dll");
pvci = lrvtc_connect(<server name> ,<port>,VTOPT_KEEP_
ALIVE);
}
void sendData()
{
int rc = 0;
rc = lrvtc_send_message("A", "TC-FF data");
}
void disconnectVTS()
{
lrvtc_disconnect();
}
b. Specify the server name and port in the code where VTS is installed. The server name and
port are marked in red.
3. Insert an Evaluate C step in the Init, Action and End sections.
a. Open TruClient in interactive mode by clicking the Develop Script button.
b. From the TruClient Side Bar select Init from the dropdown list. Repeat for Action and End.
c. From the Toolbox > Miscellaneous drag an Evaluate C step to the left side bar.
d. Click on . Name the function using quotes. For example, "ConnectVTS
4. Results
The following steps will be displayed in script-view:
truclient_step("Evaluate C function 'connectVTS'",
"snapshot=Action_1.inf");
truclient_step("Evaluate C function 'sendData'", "snapshot=Action_
2.inf");
truclient_step("Evaluate C function 'disconnectVTS'",
"snapshot=Action_3.inf");