Topic: DMD0385

Help File Version: 2.10.0.636

FILENEWFLDR - Make New Folder


 

The Make New Folder (FILENEWFLDR) instruction is used to create a folder on one of the existing file systems.

 

 

File System selects which of the available file systems to use:

@RamFS is the 1 MB file system in the Do-more CPU's system RAM. All Do-more CPUs will have this file system available.

 

@SDCardFS is the file system on the removable media installed in the micro-SD card slot (BRX only). This file system is automatically created when the removable media is inserted into the micro-SD card slot. The $SDCardFS.MediaInstalled and $SDCardFS.MediaMounted structure elements will be ON if there is a functional file system available on media in the micro-SD slot.

Note: All micro-SD media must be formatted in a PC before it can be used in a Do-more CPU. Only micro-SD media which has been formatted as FAT32 is supported. The file system can only access the first 32GB of storage space on the micro-SD media; any micro-SD card that is larger than 32GB must be reformatted to FAT32 before it can be used.

Folder - the name of the folder to create.

The @RAMFS file system is limited to 512 entries (files and folders) in the root folder, and 3000 entries in each sub-folder. This file system supports long file names. Using 8.3 file names will allow the full complement of 512 / 3000 entries, using long file names will allow fewer entries, based on the total length of the file and folder names used.

 

The @SDCardFS file system is limited to 3000 entries (files and folders) per directory. This file system supports long file names. Using 8.3 file names will allow the full complement of 512 / 3000 entries, using long file names will allow fewer entries, based on the total length of the file and folder names used.

 

All folder paths are specified relative to the root folder and must be fully qualified. This means that to make multiple folder levels, the full path to each sub-folder must be specified in the Folder parameter. For example, to create the following folder tree you will need to execute four different Make New Folder calls, one for each branch of the tree.

 

 

Make New Folder "\My Folder 1"

Make New Folder "\My Folder 1\My Folder 2"

Make New Folder "\My Folder 1\My Folder 2\My Folder 3"

Make New Folder "\My Folder 1\My Folder 2\My Folder 4"


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 will be set ON. The specified Bit location is enabled with a SET (Latch) operation (not an OUT operation) meaning that it will remain ON even if this instruction's input logic 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 selectable 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 on the last rung of this Program.

 


Error Codes

Improper use of any FILE instruction or any file system hardware problem will generate a warning message at runtime. When any of these warnings are generated, the On Error parameter in the instruction will be ON and the System ERR variable will contain one of the following text messages. You will also be alerted to this condition by yellow "Warning" text displayed in the Status Bar of Do-more Designer. Clicking that text will open the System Status to display the full text of the warning message.

 

 

Text displayed in the ERR System variable

 

How To Solve / What To Do

SdCard not installed, or has an error

 

On PLC systems that have an SD Card slot, this indicates the SD card is either missing or an error occurred while trying to mount the file system on that media.

 

Note: you can use the File System structure's .MediaInstalled and .MediaMounted in permissive contacts with the input logic of the FILEOPEN instruction to make sure the removable media is properly installed and available before an attempt is made to execute the instruction.

 

File access denied

 

An attempt was made to create a folder that already exists.

 

File system is full

 

An attempt was made to create a folder but there is insufficient space on the specified File System to perform the operation.

 

Unknown error

 

An attempt to create a folder within a folder when that does not exist, for example trying to create \MyFirstFolder\MyOtherFolder when \MyFirstFolder doesn’t exist.

 

 


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

FILECLOSE - Close File

 

FILECOPY - Copy File

 

FILEDEL - Delete File

 

FILELOG - Log to File

 

FILENEWFLDR - Make New Folder

 

FILEOPEN - Open File

 

FILEQUERY - Query File or Folder Information

 

FILEREAD - Read from File

 

FILESEEK - Seek to Position in File

 

FILESYSCMD - Perform File System Command

 

FILETRUNC - Truncate File

 

FILEWRITE - Write to File

 

EMAIL - Send Email (with file attachment)

 


Related Topics

File System Reference

 

Browse PLC File Systems

 


Example