Using OpcCmd Utility for OPC UA File Transfer: Difference between revisions

From OPC Labs Knowledge Base
Line 8: Line 8:
# Start the Unified Automation UA .NET SDK Bundle server, by typing {{Style=keyboard|start UaServerNET.exe}} at the operating system command prompt, when in the 'bin' directory of the Unified Automation UA .NET SDK Bundle.<br/><br/>
# Start the Unified Automation UA .NET SDK Bundle server, by typing {{Style=keyboard|start UaServerNET.exe}} at the operating system command prompt, when in the 'bin' directory of the Unified Automation UA .NET SDK Bundle.<br/><br/>
# Start the OpcCmd utility in interactive mode. The interactive mode is always in effect e.g. when you use ClickOnce, or when running the utility from QuickOPC Launcher/Start menu. In other cases, you need to use the <code>-i</code> (or <code>--interactive</code>) option on the command line.<br/><br/>
# Start the OpcCmd utility in interactive mode. The interactive mode is always in effect e.g. when you use ClickOnce, or when running the utility from QuickOPC Launcher/Start menu. In other cases, you need to use the <code>-i</code> (or <code>--interactive</code>) option on the command line.<br/><br/>
# {{Style=keyboard|1=uaFileTransferClient getFileInfo opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/; s=Demo.Files.TextFile" --EndpointUser root:secret}}<br/><br/>
# {{Style=keyboard|1=uaFileTransferClient getFileInfo opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/; s=Demo.Files.TextFile"}}<br/><br/>
# {{Style=keyboard|get}}<br/><br/>
# {{Style=keyboard|get}}<br/><br/>
# ''(establish trust)''<br/><br/>
# ''(establish trust)''<br/><br/>
Line 14: Line 14:
# {{Style=keyboard|exit}}<br/><br/>
# {{Style=keyboard|exit}}<br/><br/>
# {{Style=keyboard|1=uaFileTransferClient getDirectoryContents opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/ ;s=Demo.Files.FileSystem" --EndpointUser root:secret}}<br/><br/>
# {{Style=keyboard|1=uaFileTransferClient getDirectoryContents opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/ ;s=Demo.Files.FileSystem" --EndpointUser root:secret}}<br/><br/>
# {{Style=keyboard|clear}}<br/><br/>
# {{Style=keyboard|fileInfo MyTestFile.txt loadFrom --osFilePath c:\work\file1.txt}}<br/><br/>
# {{Style=keyboard|fileInfo MyTestFile.txt loadFrom --osFilePath c:\work\file1.txt}}<br/><br/>
# {{Style=keyboard|fileInfos?}}<br/><br/>
# {{Style=keyboard|fileInfos?}}<br/><br/>

Revision as of 17:31, 16 May 2021

For general information about the OpcCmd tool, see Category:OpcCmd Utility.

Tutorial

If you execute the commands listed in the tutorial below, you will get an overview of basic operations that can be made with an OPC UA Server that provides OPC UA File Transfer model.

This tutorial works with Unified Automation UA .NET SDK Bundle server. You should be able to use the principles explained in this tutorial with other OPC UA servers that provide the File Transfer model, by modifying the relevant parameters used in the commands.

  1. Start the Unified Automation UA .NET SDK Bundle server, by typing start UaServerNET.exe at the operating system command prompt, when in the 'bin' directory of the Unified Automation UA .NET SDK Bundle.

  2. Start the OpcCmd utility in interactive mode. The interactive mode is always in effect e.g. when you use ClickOnce, or when running the utility from QuickOPC Launcher/Start menu. In other cases, you need to use the -i (or --interactive) option on the command line.

  3. uaFileTransferClient getFileInfo opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/; s=Demo.Files.TextFile"

  4. get

  5. (establish trust)

  6. saveTo --osFilePath c:\work\file1.txt

  7. exit

  8. uaFileTransferClient getDirectoryContents opc.tcp://localhost:48030 "nsu=http://www.unifiedautomation.com/DemoServer/ ;s=Demo.Files.FileSystem" --EndpointUser root:secret

  9. clear

  10. fileInfo MyTestFile.txt loadFrom --osFilePath c:\work\file1.txt

  11. fileInfos?

  12. createSubdirectory MyTestDirectory

  13. fileInfo MyTestFile.txt copyTo MyTestDirectory/CopyOfMyTestFile.txt

  14. browseTree

  15. fileInfo MyTestDirectory/CopyOfMyTestFile.txt delete

  16. browseTree