How can I Control V16Pro, V4Pro or VCore with a TCP Client? (Putty Terminal)

You can control the V16Pro using any TCP Client (such as Putty Terminal Client) by setting up a "TCP Server" Type device on your V16Pro. 


The example "PuttyTerminal" can be found under the "Concepts" section of the "Examples" in WinScriptLive. This includes the file PuttyTerminal.ami which will be referenced in this article. 


Setup a TCP Server Device

This is already done in the "PuttyTerminal.ami" example. Steps below to add the device are shown below.

1. Click on "Resources-->Devices"

2. Click on "New" to add a new device

3. Enter any name (such as "puttyTerm")

4. Click "Add Custom Device" button, Click "Next"

5. Select "ethernet" connection type and "tcp_server"

6. Use "Destination Port 1000" (Note: This can be any port, but we'll pick this one for simplicity. Picking lower numbers can often overlap existing special use TCP ports.)

The result should look similar to the image below:

Add Triggers to Start Sequences

Triggers can be used to start a sequence that performs any action. 

In the "PuttyExample.ami", the sequences "OutputOn" and "OutputOff" turn on and off Output1. 

The triggers have already been added in the example. Steps below can be used to add new triggers. 

1. Click on the Sequence you wish to start to highlight it. 

2. Click the "Triggers" button

3. Click the "+" to add a new trigger

4. Select "an incoming message" from the drop down as the trigger reason

5. select the Device Name "PuttyTerm" (or whatever your device name is)

6. Select "Use a custom regular expression

7. In the regular expression text box, enter the text that you will use from the Putty terminal to start the trigger (for example, the word "on")

Note: Regular expressions do not require any quotes. Wildcards such as a period '.' can be used to partially match text. Unprintable characters such as carriage returns can use '\r' or '\x0D'  (no quotes needed). Click on the "?" button for a list of more characters you can use. 

Launch TCP Client and Send Strings

Launch any TCP Client and send strings. In this example, we should send the words "on" or "off". 

In putty, be sure to select connection type of "Raw" and enter the port number of "1000" that we specified when we setup the device.

Have more questions? Submit a request