Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write local file to FileType object #593

Open
2 of 5 tasks
BrunoTrevisani opened this issue Feb 14, 2024 · 0 comments
Open
2 of 5 tasks

Write local file to FileType object #593

BrunoTrevisani opened this issue Feb 14, 2024 · 0 comments

Comments

@BrunoTrevisani
Copy link

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

Hello,

I'm trying to write a local file to a FileType object in my AddressSpace, but it always returns a BadNotImplemented error.

I also tried using the create file method to create the file object with a local file loaded, but without success.

Below is the code I used to create the objects. Does anyone know what it needs to write a local file to a FileType object and/or load a file via the Create File method?

private ServiceResult OnCreateFileMethodCall(ISystemContext _context, MethodState _method, NodeId _objectId, string fileName, bool requestFileOpen, ref NodeId fileNodeId, ref uint fileHandle)
{
    NodeState parent = _method.Parent;

    FileState fileState = new FileState(parent);
    fileState.SymbolicName = fileName;
    fileState.ReferenceTypeId = ReferenceTypes.Organizes;

    fileState.Create(SystemContext,
                     null,
                     new QualifiedName(fileName, NamespaceIndex),
                     new LocalizedText("en", fileName),
                     true);

    fileNodeId = fileState.NodeId;
    fileHandle = fileState.NumericId;

    parent.AddChild(fileState);
    opcServer_.AddNode(fileState);
    AddPredefinedNode(SystemContext, parent);

    return ServiceResult.Good;
}

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

No response

@BrunoTrevisani BrunoTrevisani changed the title <title> Write local file to FileType object Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant