Loading NodeSet2 XML file error|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Loading NodeSet2 XML file error
Avatar
prabhakaran prabs
Member
Members
Forum Posts: 42
Member Since:
01/07/2022
sp_UserOfflineSmall Offline
1
06/10/2024 - 06:38
sp_Permalink sp_Print

Hi,

I have developed OPC UA SERVER application using CSharp(C#) language.

I am using NodeSet2 XML file to create address space in OPC UA server.

Loading NodeSet2 XML file in local windows machine is working fine

But in Linux machine, it is getting bellow error,

Read-only file system at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode 

 

I have used following code to import NodeSet2 XML file.

private void ImportXml(IDictionary<NodeId, IList<IReference>> externalReferences, string resourcepath)
{
NodeStateCollection predefinedNodes = new NodeStateCollection();

Stream stream = new FileStream(resourcepath, FileMode.Open);
Opc.Ua.Export.UANodeSet nodeSet = Opc.Ua.Export.UANodeSet.Read(stream); //error is at this line

SystemContext.NamespaceUris.Append(nodeSet.NamespaceUris.ToString());
nodeSet.Import(SystemContext, predefinedNodes);

for (int ii = 0; ii < predefinedNodes.Count; ii++)
{
predefinedNodes[ii].DisplayName = new LocalizedText("en", predefinedNodes[ii].DisplayName.Text);
predefinedNodes[ii].WriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description;
predefinedNodes[ii].UserWriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description;
AddPredefinedNode(SystemContext, predefinedNodes[ii]);
}
// ensure the reverse refernces exist.
AddReverseReferences(externalReferences);
}

 

Please help me to solve this issue

Avatar
Randy Armstrong
Admin
Forum Posts: 1511
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
06/11/2024 - 00:22
sp_Permalink sp_Print

You are opening a file for writing on a read-only file system.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 91
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1395
Posts: 4715