Can I delete or move files stored on a USB drive connected to a cMT2078x?

Can I delete or move files stored on a USB drive connected to a cMT2078x?
none 0.0 0
  • HMI Model: cMT2078X
  • EasyBuilder Pro Version:
  • Serial Number or supplier: 2301407054

I have a Keyence IV camera sending images to display via FTP to a USB disk on the HMI. My original idea was to let the camera provide the folder structure and dynamically change the folder for the picture viewer each day as the camera makes a directory structure based on date. Unfortunately it uses a subfolder (IV000x) that is indexed each time the camera is power cycled.

Can I detect this change in subfolder via a macro or other alternatives (JS?)

As an alternative I can set the camera to send everything into a single folder but then I would need to be able to move or delete older images. Is is possible via macro or javascript to manipulate files on the usb?

Hi @Omegaplex,

When the Keyence IV camera is powered down, is the HMI powered off as well? If so, a simple solution would be to prompt the user to select the current folder using a “File Browser” when the HMI is powered on.
If this solution will work within your application I can provide instructions that will help you add this feature to your project.

Hi @Brendon.S,

I’ve considered doing just that and changing that part of my string but was hoping there might be a way to manipulate files on the USB directly. If that’s not a possibility what I may do is set the camera to upload into a single directory then just go purge the folder every 6 months when I do system backups.

This would also allow an older model camera to show it’s NG images in the same folder. It’s really just so the operator has a better understanding of why the product failed the vision test. This machine is solely QA testing at the end of an assembly line so it’s a set it and forget it type of machine.

Hi @Omegaplex,

Although it may be possible to determine what folders exist within the USB and dynamically change the file path without operator interaction, the only solutions for this request are complex and involve the use of FTP and loopback. Unfortunately, this method is not reliable.

I would recommend that you use the alternative solution, in which you upload files to a single directory and “purge” the folder every 6 months during system backups. I am so sorry that we don’t have a feature suitable for this process, but perhaps one will be created within the near future. To delete files within a USB, you may perform the following:

  1. Within EasyBuilder Pro select the “Common Window”:

  2. Select the “Object” tab and create a “File Browser”:

  3. Within the “File Browser” define the “Folder path”, “File name”, and “Control” address according to the image below:

  4. Click “Ok” when finished and place this object in the upper left corner outside of the work area:

  5. Then, to delete a file enter the “Folder path” and “File name” within the addresses defined in step 3. Set a value of ‘3’ within the “Control” address to select the specified folder or file. Once selected, set a value of ‘1’ within the “Control” address to delete the selected item:
    Note: The file browser is visible within this example.

Thank you for the explanation and the setup example.