Skip to content

USB RFC4072s

Hi,

Is it possible to copy files from usb memory stick to the RFC via the USB-port?

I am thinking of using the file copy block from plcnextbase library but I don't know the path to the USB device.

Best regards

/Stefan

Comments

  • Hi Stefan,

    I'll check this and come back to you in this matter.

    cu

    Frank

  • Hello Stefan,

     

    at the moment we do not support the function.

    Can you please describe the use case, so I can make a detailed requirement for a future firmware step.

    Thanks.

    Best Regards,

     

    Alex

  • Hi Alex,

    Thanks for reply.

    To bad that this is not supported. We need to rethink how to make this.

    We are making a system that requires  a file for reading some rules for setting up the system. We thought of making it like a manual operation to load this file to the system so you have to physically be there to save it on the PLC.
    My thought was to mount the USB as external drive and make a function in the PLC to copy the file to PLC file system. Maybe trigger the file copy from web HMI.

    Best regards Stefan

     

     

     

  • Hi Stefan,

    If you are thinking of triggering the file copy from a HMI, then this may give you another option ... most HMI's have a USB port, and you could use this as the source of the file that is transferred to the PLC. This may require some custom web development (e.g. Javascript) to load and transfer the file, but it should be possible using this method.

    There is also the possibility to transfer files from a HMI via OPC UA - as demonstrated in this video:

    https://www.plcnext-community.net/index.php?option=com_content&view=article&id=403:how-to-transfer-a-file-via-opc-ua&catid=84&Itemid=483&lang=en

    I hope this helps!

    Martin.

     

  • Hi Martin, 

    We might have to do it like that.

    The problem is that if you can do it via OPC you can be far away from the actual controller.

    /Stefan

  • Well, that depends on how you set up the OPC UA security. It may be possible to configure the OPC UA server (e.g. using certificates) to only accept connections from a specific client, e.g. the HMI connected to the machine, in addition to user-level security.

    I'm not so familiar with the complete set of security features of our OPC UA server, but if this is a solution you would like to investigte then I can ask someone who knows.

    Martin.

  • Hi Martin,

    Thanks for reply.

    We have different clients that will use the OPC UA so if it is possible to just enable file transfer from one of these clients that would be a possible solution.

    I saw that the next base library has a ftp file transfer block, is it possible to transfer the file from the server to the PLC or is it just from the PLC to the server as described in manual?

    /Stefan

  • Hi Stefan,

    It looks like that library only includes an FB to copy a file to an FTP server ... I guess if you checked the contents of the file /opt/plcnext/ftpCommandFile.sh, you would see an ftp put command. There doesn't seem to be an equivalent FB that generates an FTP get command.

    You might be able to do something similar yourself (via curl, for example), but it may be worth contacting the developer of the Base library (using the "Contact Developer" button in the PLCnext Store) to ask if they can add this feature.

    Martin.

  • Hi,

     

    I am picking up this thread again.

    In the example video  the creation of file and changing file is described but not how to transfer a file from upcua client to opc server.

    Does anyone know how to do that?

    I tried to use the MoveOrCopy method but I can't figure out how to use it.

     

    Br Stefan

     

  • Hi Stefan,

    the creation of file and changing file is described but not how to transfer a file from upcua client to opc server.

    The video does show how to transfer a file - from about 3:00 onwards. This method of file transfer is very low level - first, an empty file is created, then the new (empty) file is opened, then the contents of another file are written to the open file, then the new file is closed. Other OPC UA clients may hide these low-level steps from the user, but in this case (using UA Expert) we must do each of these steps ourselves. If you are writing an OPC UA client for your users, then you should definitely wrap these steps in something more user-friendly.

    Hope this helps.

    ~ Martin.

     

  • Hi Martin,

    Ok, I thought it was possible to transfer a file from the client.

    Then I first have to create the file and then fill that file with information.

    Thanks for the help

    Best regards Stefan

  • Just to clarify - the (standard) OPC UA implementation is just how most operating systems copy files - they create an empty destination file, then write the data from the source file. In this case it's up to each OPC UA client implementation to create a higher-level "copy" function, if needed, that hides all these details from the user, just like the Windows copy or Linux cp commands do for users of those systems.

    ~ Martin.

Sign In or Register to comment.