Skip to content

Commit

Permalink
fix: invalid Index in BrowseName of Identification
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHeine committed Jan 2, 2025
1 parent 690149e commit a70c1d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/machines/MyControledMachine/jobcontrol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ import assert from "node:assert";
export const createJobContolLogic = async (
addressSpace: AddressSpace,
): Promise<void> => {
const diIdx = addressSpace?.getNamespaceIndex(
"http://opcfoundation.org/UA/DI/",
);
const machineryIdx = addressSpace?.getNamespaceIndex(
"http://opcfoundation.org/UA/Machinery/",
);
Expand Down Expand Up @@ -83,7 +86,7 @@ export const createJobContolLogic = async (
const myMachineIdentification = machineryIdentificationType?.instantiate({
browseName: {
name: "Identification",
namespaceIndex: machineryIdx,
namespaceIndex: diIdx,
},
namespace: namespace,
optionals: [], // array of string
Expand Down
5 changes: 4 additions & 1 deletion src/machines/mymachine/mymachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import { initializeFakeDataSource, variableGetter } from "./datasource";
export const createMyMachineLogic = async (
addressSpace: AddressSpace,
): Promise<void> => {
const diIdx = addressSpace?.getNamespaceIndex(
"http://opcfoundation.org/UA/DI/",
);
// Add a machine manually:
const machineryIdx = addressSpace?.getNamespaceIndex(
"http://opcfoundation.org/UA/Machinery/",
Expand All @@ -52,7 +55,7 @@ export const createMyMachineLogic = async (
const myMachineIdentification = machineryIdentificationType?.instantiate({
browseName: {
name: "Identification",
namespaceIndex: machineryIdx,
namespaceIndex: diIdx,
},
namespace: namespace,
optionals: ["Model"], // array of string
Expand Down

0 comments on commit a70c1d1

Please sign in to comment.