01/07/2022
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
1 Guest(s)