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

Update variable description dynamically #1284

Closed
ptorrent opened this issue Jun 26, 2023 · 5 comments
Closed

Update variable description dynamically #1284

ptorrent opened this issue Jun 26, 2023 · 5 comments

Comments

@ptorrent
Copy link

Hello there !

Just a simple question, is there a way to update dynamically the description of a variable ?

var variable = namespace.addVariable({
		description 	: description || '',
})

THanks for your support !

@erossignon
Copy link
Member

In javascript:

variable.setDescription(coerceLocalizedText("Hello World"));

However I realized that the setDescription method was not yet exposed in the public typescript interface. Let me fix this.

erossignon added a commit that referenced this issue Jun 29, 2023
@erossignon
Copy link
Member

typescript definition file has been fixed in 2.106.0

@ptorrent
Copy link
Author

Thanks a lot ! Other question about displayName and description properties:

Do I've to use coerceLocalizedText("Hello World") for both property, actually I'm not ?

I'm using Matrikon as OPC client and I'm not able to read them. On some others clients it's work

@erossignon
Copy link
Member

Both should work

setDescription takes a LocalizedTextLike argument

LocalizedTextLike could be string | { text: string, locale: string } | LocalizedText

@erossignon
Copy link
Member

node-opcua@2.109.0 now exposes BaseNode#setDiplayName and BaseNode#setDescription methods.

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

2 participants