Dataport with count = 1


#1

Hi,

I’ ve a problem creating a data port with count equal to 1; I need only last value for this data port, no logging.
In retention I’ve set count = 1 and duration = infinity, i’ve created a JSON Viwer widget with record editing enabled.
Now I’ve two problems:

  • The widget doesn’t show last value but an old one
  • The widget shows the menu for scrolling through records even if count is set to 1

Thanks

Giacomo


#2

Hi Giacomo,

Your use of this example widget may be a little outside of its original intended purpose. That widget has a narrow purpose for interacting with data, and for the best results I would recommend creating a custom widget. The JSON Viewer is not robust enough to know the properties of the dataport given to it; You will not be able to get rid of the menu to scroll through multiple entries.

Additionally, what is the value of the refresh timer you have set? You may be updating the value, but the code is never asked to re-execute, and thus still display the old value.

What are you trying to accomplish with the use of this widget? If you can tell me what you are trying to do, I might be able to point you at some other example code, or maybe another widget.

Thanks,
-Martin


#3

Hi Martin,

I’m trying to make a panel for setting properties of the I/O on my board, base JSON is something like this:

{“DIGITALIN”:{“setting”:{“digitalInput1”:{“state”:1,“logic_filter”:1,“enabled”:1},“digitalInput2”:{“state”:0,“logic_filter”:1,“enabled”:1}}}}

The widget should display two section (digitalInput1 and digitalInput2) with its properties. The user should be able to visualize and modify parameters of each section (state, logic_filter, enabled).

On JSON Viewer i’ve set refresh rate to 10 sec.

Thanks
Giacomo


#4

Hi Martin,

I’ve written a custom widget, now I’m able to read and write my data port!
Is there something that explain how to create a domain level widget?

Giacomo


#5

Hi @giacomo.pastore,

Glad to hear that your custom widget is doing what you need!

Is there something that explain how to create a domain level widget?

This article is a bit old with respect to the changes we made to the admin interface, but additional details on how to create a Domain Widget are available here: https://support.exosite.com/hc/en-us/articles/200398006-Domain-Widgets.

Let me know if you have questions about how to create a Domain Widget,
-Martin