How to Use Virtual Table Server in TruClient

  • KM00515338
  • 29-Aug-2013
  • 23-Oct-2013

Summary

How to Use VTS in TruClient

Question

How to Use Virtual Table Server in TruClient

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 action 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 fname . 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");