Telnet allows users to log in to another machine to perform file operations. File Transfer Protocol (FTP) allows file transfer from one machine to another. In this example, we will demonstrate how to use telnet to log in to a Unix machine and create a folder. With the folder created, FTP is used for transferring a file to that folder.
We will create a state machine to use telnet and ftp for transferring files using the following steps:
Create the state machine, as shown in the following screenshot. The first state is "User input". It waits for the user to click on start and populate a cluster with values from the front panel controls.
The next state is "Initialize". It creates a telnet session with user input IP address of the Unix machine:
The next state is "Wait for login". The state waits for the string login: to appear. If it does, the program transits to the Send Login state. If not, after the user-specified timeout has expired, the program transits...