Компилятор модели OPC UA и набор узлов

У меня небольшая проблема при попытке сгенерировать код C для ua-Nodeset-1.04 (https://github.com/OPCFoundation/UA-Nodeset) с использованием UA-ModelCompiler (https://github.com/OPCFoundation/UA-ModelCompiler/tree/v1.04).

Я пытался следовать readme, но я ничего не добился, поэтому я подумал, что попытаюсь опубликовать об этом, кажется, я могу запустить BuildStandarTypes.bat, но я не уверен, где заканчивается выходной стек, и я ' m также не уверен, как его изменить, чтобы он получал файлы из UA-Nodeset-1.04.

Есть ли у кого-нибудь предложения или идеи, как я могу это решить?

Надеюсь, что можно разместить это здесь.

Шаги на данный момент:

  1. Скачал файлы
  2. Открыт в Visual Studio 2019
  3. Встроенный режим выпуска (2 успешных, 0 неудачных)
  4. Запустил. \ BuildStandarTypes.bat в PowerShell, затем я получил
PS C:\Model\UA-ModelCompiler-1.04> .\BuildStandardTypes.bat Building Model "StandardTypes"
Building Model GDS
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaGdsModel.xml" -cg ".\ModelCompiler\Design\OpcUaGdsModel.csv" -o2 ".\Published\GDS\"
Copying Model files to .\Published\GDS\OpcUaGdsModel
1 file(s) copied.
1 file(s) copied.
Building Model DI
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaDiModel.xml" -cg ".\ModelCompiler\Design\OpcUaDiModel.csv" -o2 ".\Published\DI\"
Copying Model files to .\Published\DI\OpcUaDiModel
1 file(s) copied.
1 file(s) copied.
Building Model ADI
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaAdiModel.xml" -cg ".\ModelCompiler\Design\OpcUaAdiModel.csv" -o2 ".\Published\ADI\"
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.xml
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.csv
Copying Model files to .\Published\ADI\OpcUaAdiModel
1 file(s) copied.
1 file(s) copied.
Building Model PLCopen
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaPLCopenModel.xml" -cg ".\ModelCompiler\Design\OpcUaPLCopenModel.csv" -o2 ".\Published\PLCopen\"
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.xml
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.csv
Copying Model files to .\Published\PLCopen\OpcUaPLCopenModel
1 file(s) copied.
1 file(s) copied.
Building Model MTConnect
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\MTConnectModel.xml" -cg ".\ModelCompiler\Design\MTConnectModel.csv" -o2 ".\Published\MTConnect\"
Copying Model files to .\Published\MTConnect\MTConnectModel
1 file(s) copied.
1 file(s) copied.
Building Model FDI
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaFDIPart5Model.xml" -cg ".\ModelCompiler\Design\OpcUaFDIPart5Model.csv" -o2 ".\Published\FDI\"
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.xml
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.csv
Copying Model files to .\Published\FDI\OpcUaFDIPart5Model
1 file(s) copied.
1 file(s) copied.
Building Model FDI
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\OpcUaFDIPart7Model.xml" -cg ".\ModelCompiler\Design\OpcUaFDIPart7Model.csv" -o2 ".\Published\FDI\"
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.xml
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.csv
Copying Model files to .\Published\FDI\OpcUaFDIPart7Model
1 file(s) copied.
1 file(s) copied.
Building Model Sercos
.\Bin\Release\Opc.Ua.ModelCompiler.exe -d2 ".\ModelCompiler\Design\SercosModel.xml" -cg ".\ModelCompiler\Design\SercosModel.csv" -o2 ".\Published\Sercos\"
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.xml
Trying file: C:\Model\UA-ModelCompiler-1.04\ModelCompiler\Design\OpcUaDiModel.csv
Copying Model files to .\Published\Sercos\SercosModel
1 file(s) copied.
1 file(s) copied.
Copying CSV files to .\Published\Schema\

C:\Model\UA-ModelCompiler-1.04>COPY ".\ModelCompiler\Design\StandardTypes.csv" ".\Published\Schema\NodeIds.csv"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\ModelCompiler\Design\UA Attributes.csv" ".\Published\Schema\AttributeIds.csv"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\Published\DotNet\Opc.Ua.StatusCodes.csv" ".\Published\Schema\StatusCode.csv"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\Core\Schema\UANodeSet.xsd" ".\Published\Schema\UANodeSet.xsd"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\Core\Schema\SecuredApplication.xsd" ".\Published\Schema\SecuredApplication.xsd"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\Core\Types\Schemas\OPCBinarySchema.xsd" ".\Published\Schema\OPCBinarySchema.xsd"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\Core\Schema\ServerCapabilities.csv" ".\Published\Schema\ServerCapabilities.csv"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\ModelCompiler\Design\rec20_latest.csv" ".\Published\Schema\rec20_latest.csv"
1 file(s) copied.

C:\Model\UA-ModelCompiler-1.04>COPY ".\ModelCompiler\Design\UNECE_to_OPCUA.csv" ".\Published\Schema\UNECE_to_OPCUA.csv"
1 file(s) copied.
Updating License

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.xml -license MITXML -silent
Updating 38 files.

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.xsd -license MITXML -silent
Updating 12 files.

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.bsd -license MITXML -silent
Updating 9 files.

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.cs -license MIT -silent
Updating 35 files.

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.h -license MIT -silent
Updating 8 files.

C:\Model\UA-ModelCompiler-1.04>.\Bin\Release\Opc.Ua.ModelCompiler.exe -input .\Published -pattern *.c -license MIT -silent
Updating 3 files.

У кого-нибудь есть такой опыт автоматического создания набора узлов OPC UA?


person Parko    schedule 10.12.2020    source источник


Ответы (1)


Opc.Ua.ModelCompiler.exe имеет необязательный параметр для определения версии -version v104, пример можно найти в Пример типов данных OPC Foundation.

person koepalex    schedule 10.12.2020
comment
Не уверен, что следую, поэтому я могу использовать Opc.Ua.ModelCompiler.exe, а затем указать на xml и csv, а затем он выведет его в \ Types? - person Parko; 10.12.2020
comment
да, он будет генерировать вывод в папку, указанную параметром -o2. По этому пути вы найдете все файлы для создания V104. файлы (bsd, xsd, NodeSet2, ...) - person koepalex; 10.12.2020
comment
Я попытался создать папку под названием Типы в папке C: \ Model \ UA-ModelCompiler-1.04 \ Bin \ Release, затем скопировал файлы POWERLINK xml и csv из UA-Nodeset и запустил команду, но я получаю `Opc.Ua .ModelCompiler.exe: термин «Opc.Ua.ModelCompiler.exe» не распознается как имя командлета, функции, файла сценария или работающей программы. Проверьте написание имени или, если был включен путь, убедитесь, что путь правильный, и повторите попытку. В строке: 1 символ: 1 + Opc.Ua.ModelCompiler.exe -version v104 -d2. \ Types \ Opc.Ua.POWERLINK ... `Есть идеи? - person Parko; 11.12.2020