<< Click to Display Table of Contents > 

Client Control Interface Manual > Implementation > ASCII (plain text)

ASCII (plain text)
Previous pageReturn to chapter overviewNext page

CCI ASCII commands via TCP

 

CCI_Overview_TCP-ASCII

SAMLight can be controlled by a CCI application running on a different system which does not need to be a Windows PC.

The system and the Windows PC are connected via TCP (Ethernet)

SAMLight → Settings → System → Remote:

oTCP must be enabled.

oASCII Communication Mode must be enabled.

oIP Address must be one of the available IP addresses of the PC on which SAMLight is running and is independent of the IP of the sender of the CCI commands. Use 0.0.0.0 to allow remote control from any IP or 127.0.0.1 for local host.

oPort can be freely chosen. Use 23 for standard Telnet port.

oASCII mode code page can be set to an ASCII or Unicode code page.

The client application can use all ASCII Commands.

 

Steps for the custom program to use ASCII (plain text) CCI:

Open TCP connection to configured IP and Port

Send commands in the configured code page, with end character <LF>

Wait for end character <LF> in return data, interpret return string

ASCII character

Name

Dec

Hex

Description

<LF>

(one character)

Line Feed

10

0A

The end character is the <LF> character. Example:

Cmd to SAMLight:

ScCciShowApp(1)<LF>

Return from SAMLight:

1<LF>

,

Comma

44

2C

Commas are used as separator between parameters. Example: ScCciGetEntityStringData("a", 2)<LF>

"

Quotation Mark

34

22

Strings must be enclosed by Quotation Marks. A Quotation Mark in a string must be escaped by an other Quotation Mark. Example: ScCciSetEntityStringData("a", 2, "She said, ""Yes""!"<LF>

.

Full Stop

46

2E

Full Stop is used as decimal separator.

Example: ScCciRotateEntity(string "a", 0.0, 0.0, 12.733)<LF>

\n

(as text, two chars)

Backslash + n

92 110

5C 6E

Sending \n as text in a non path string parameter to SAMLight will be replaced with <LF>. Example: ScCciSetEntityStringData("a", 2, "first line\r\nsecond line")<LF>

\r

(as text, two chars)

Backslash + r

92 114

5C 72

Sending \r as text in a non path string parameter to SAMLight will be replaced with <CR>. Example: ScCciSetEntityStringData("a", 2, "first line\r\nsecond line")<LF>

Table 393: Control characters for ASCII CCI

ASCII CCI

Command to SAMLight

Return from SAMLight

New line

End of command

New line

End of return

\r\n [a]

<LF>

<CR><LF> [b]

<LF>

Table 394: ASCII CCI new line, end of command and end of return control characters.

[a]: \r\n as text, four ASCII chars: 0x5C 0x72 0x5C 0x6E

[b]: For ASCII CCI: It is possible to receive multi-line strings, but only if you wait a certain time until all lines are received.

The maximum size of a command is 20000 bytes, since version 4.2.5 build 0026.