Topic: DMD0483

Help File Version: 2.9.4.37

FTPGET - Retrieve File From Remote


Note: this instruction can only be used with a BRX CPU !

 

The Retrieve File From Remote (FTPGET) instruction is used to download a copy of a file on a remote FTP server to one of the local BRX file systems.

 

Note: remember the Network Message Viewer (Do-more Logger) utility is a great tool to help diagnose FTP connection problems.

 

 


Parameters:

Note: Use the F9 key to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

FTP Device selects which FTP Client device to use:

Use the drop-down list to select an existing FTP Client device.

 

Selecting create device will open a dialog where a new FTP Client device can be created.

 

no devices available indicates that there are no preconfigured Devices that can execute this instruction; either none have been configured or the CPU does not have an on-board Ethernet port.

 


Local File System is the file system (SD Card file system or RAM file system) to store the retrieved file.

 

File Name is the name of the file on the remote FTP server - this is only the file name, do not include any folder names; folders must be entered in the Remote Directory below. This can be a String Literal (text enclosed with double quotes), or any user-defined string (1024 characters max), or system-defined string ( SS0-SS127 (64 characters max) / SL0-SL63 (256 characters max) ).

 

Enable the Remote Directory option and enter the folder name if the file is located in a sub-folder on the remote server and enter the sub-folder path using forward slashes. This can be a String Literal (text enclosed with double quotes), or any user-defined string (1024 characters max), or system-defined string ( SS0-SS127 (64 characters max) / SL0-SL63 (256 characters max) ).

 

Enable the Local File System Directory option to store the file in a sub-folder on the local file system and enter the sub-folder path using backslashes. This can be a String Literal (text enclosed with double quotes), or any user-defined string (1024 characters max), or system-defined string ( SS0-SS127 (64 characters max) / SL0-SL63 (256 characters max) ).

 


The On Success and On Error parameters specify what action to perform when this instruction completes. You do not have to use the same type of selection for both On Success and On Error.

 

If the Set Bit selection is used for either On Success or On Error, the specified BIT location will be SET OFF when the instruction is first enabled and will remain OFF until the instruction completes. Once complete, the appropriate Success or Error bit location ON. The specified Bit location is enabled with a SET (Latch) operation meaning that it will remain ON even if the input logic for the instruction goes OFF.

 

If the JMP to Stage selection is used for either On Success or On Error the target Stage must be in the same Program code-block as this instruction, you cannot specify a target Stage that exists in a different Program code-block. When the operation finishes, the target Stage will be enabled the same way as a standalone Jump to Stage (JMP) instruction would do it. The JMP to Stage option will only be available if this instruction is placed in a Program code-block.

 

On Success selects which of the following actions to perform if the operation is successful:

  • Enable SET Bit then specify any writable bit location.
  • Enable JMP to Stage then specify any Stage number from S0 to S127 in the current Program code-block.

 

On Error selects which of the following actions to perform if the operation is unsuccessful:
 

  • Enable SET Bit then specify writable bit location.
  • Enable JMP to Stage then specify any Stage number from S0 to S127 in the current Program code-block.

 

If either the On Success or On Error selections are set to JMP to Stage, Automatically create the SG box for any NEW stage number will be enabled which will automatically create any target stage that does not already exist.

  • Below this rung will create the new target stage on a new rung following this instruction.
  • At end of code-block will create the new target stage as the last rung of this Program.

 


Status Display:

 

The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.

 

The gray triangle at the right end of the input leg indicates the input is edge-triggered, meaning this instruction will execute each time the input logic transitions from OFF to ON.

 


See Also:

FTP Client Device

 

FTPGET - Retrieve File From Remote

 

FTPPUT - Store File to Remote



Related Topics:

HTTPCMD - Process HTTP Command

 

MQTTPUB - IoT Publish MQTT Topics

 

MQTTSUB - IoT Subscribe to MQTT Topics

 


Example: