IgnitionModuleDevelopmentCommunity / IgnitionNode-RED

Adds support for Node-RED
Apache License 2.0
31 stars 7 forks source link

How to write and read datasets #36

Closed shaqaruden closed 7 months ago

shaqaruden commented 1 year ago

Is it possible to read and write datasets to ignition? I have attempted this but what I have tried has just tried to create child tags of my dataset. When I manually set some data and attempt to read the tag I just get Dataset [1R x 5C] and not the actual data.

[
    {
        "id": "743a7ee75905daab",
        "type": "debug",
        "z": "a351c7e1b554b7db",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 620,
        "wires": []
    },
    {
        "id": "865e6da58d35ebaa",
        "type": "ignition-tag-write",
        "z": "a351c7e1b554b7db",
        "server": "8abdf627c1464d3e",
        "value": "",
        "valueType": "msg.payload",
        "tagPath": "",
        "tagValue": "",
        "name": "",
        "x": 390,
        "y": 620,
        "wires": [
            [
                "743a7ee75905daab"
            ]
        ]
    },
    {
        "id": "8b2306060bedc8ed",
        "type": "inject",
        "z": "a351c7e1b554b7db",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"tagPath\":\"[edge]BOM\",\"tagValue\":[{\"Item\":\"B144230014\",\"Quantity\":\"1.588000\",\"Unit of Measure\":\"LB\",\"Operation\":\"10\",\"Type\":\"RESN\"}]}",
        "payloadType": "json",
        "x": 190,
        "y": 620,
        "wires": [
            [
                "865e6da58d35ebaa"
            ]
        ]
    },
]
iatraviscox commented 1 year ago

I added support for this in 1.5.14.

https://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/releases/tag/1.5.14

shaqaruden commented 1 year ago

I had kind of forgotten about this issue submission, Thanks!

Is writing to a dataset still a work in progress?

iatraviscox commented 1 year ago

I now have full support for Datasets in 1.5.15. You need to update the module and Ignition nodes in NodeRED to the same version.

https://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/releases/tag/1.5.15

When writing to a Dataset you just need an object that contains rows and columns, just like the object you see when you read. Let me know if you have any questions.

iatraviscox commented 7 months ago

Closing due to inactivity.