Support Forums
Historian and JSON

Hello,

How do you integrate JSON history into the a JSON tag...the video and examples, don't dig much into it.

thanks

Hello, How do you integrate JSON history into the a JSON tag...the video and examples, don't dig much into it. thanks

Once you connect your I/O tags to the JSON driver, all the history will be recorded per the tag configuration. This is the same as the I/O tags within any of the drivers.

Does that make sense?

Once you connect your I/O tags to the JSON driver, all the history will be recorded per the tag configuration. This is the same as the I/O tags within any of the drivers. Does that make sense?

Trihedral Engineering Ltd.

For the live Json data, that is true. I have a seperate URL for more refined history data, which I wish to backfill into the original data.

URL 1 .. hourly data
URL 2 .. minute by minute data, updated on the hour (not live). with an array of values and timestamps.

I suppose I could just import 60 data points every hour, but how would I go about setting up the tags for that.

thanks

For the live Json data, that is true. I have a seperate URL for more refined history data, which I wish to backfill into the original data. URL 1 .. hourly data URL 2 .. minute by minute data, updated on the hour (not live). with an array of values and timestamps. I suppose I could just import 60 data points every hour, but how would I go about setting up the tags for that. thanks

For that, you will need to do some custom work however the bulk of that is laid out for you in the help files here: https://www.vtscada.com/help/Content/D_Tags/Dev_JSONDriver.htm

See the processor section and you will find nearly everything you need in the custom processor link.

For that, you will need to do some custom work however the bulk of that is laid out for you in the help files here: https://www.vtscada.com/help/Content/D_Tags/Dev_JSONDriver.htm See the processor section and you will find nearly everything you need in the custom processor link.

Trihedral Engineering Ltd.

I followed the instructions and wrote the JSON Processor, I just don't see how I bring that to work with a tag. Do you have a complete example. It seems I have a lot of pieces, but I am just missing a simple thing to bring it all together. Baring you having a complete example, I can send my test changeset for you to look at.

thanks

I followed the instructions and wrote the JSON Processor, I just don't see how I bring that to work with a tag. Do you have a complete example. It seems I have a lot of pieces, but I am just missing a simple thing to bring it all together. Baring you having a complete example, I can send my test changeset for you to look at. thanks

If you could show an example of using historical Json data into the tag, or something similar that would be great.

If you could show an example of using historical Json data into the tag, or something similar that would be great.

From the Example Code in VTScada Help.

 NewData = Dictionary();
NewData["J1"] = TimeValuePair(Data.DataValues.T1, Data.DataValues.V1);
NewData["J2"] = TimeValuePair(Data.DataValues.T2, Data.DataValues.V2);
NewData["J3"] = TimeValuePair(Data.DataValues.T3, Data.DataValues.V3);
NewData["History"] = TimeValuePair(New(3), New(3));
NewData["History"].Timestamp[0] = Data.DataValues.T1;
NewData["History"].Timestamp[1] = Data.DataValues.T2;
NewData["History"].Timestamp[2] = Data.DataValues.T3;
NewData["History"].Value[0]     = Data.DataValues.V1;
NewData["History"].Value[1]     = Data.DataValues.V2;
NewData["History"].Value[2]     = Data.DataValues.V3;
NewData["UniqueID"]             = UniqueID;
NewData["Timestamp"]            = "Not a timestamp";
Return(NewData);

If this was An Analog status tag, would I put J1, in the current value, and History[0] in the tag?

From the Example Code in VTScada Help. NewData = Dictionary(); NewData["J1"] = TimeValuePair(Data.DataValues.T1, Data.DataValues.V1); NewData["J2"] = TimeValuePair(Data.DataValues.T2, Data.DataValues.V2); NewData["J3"] = TimeValuePair(Data.DataValues.T3, Data.DataValues.V3); NewData["History"] = TimeValuePair(New(3), New(3)); NewData["History"].Timestamp[0] = Data.DataValues.T1; NewData["History"].Timestamp[1] = Data.DataValues.T2; NewData["History"].Timestamp[2] = Data.DataValues.T3; NewData["History"].Value[0] = Data.DataValues.V1; NewData["History"].Value[1] = Data.DataValues.V2; NewData["History"].Value[2] = Data.DataValues.V3; NewData["UniqueID"] = UniqueID; NewData["Timestamp"] = "Not a timestamp"; Return(NewData); If this was An Analog status tag, would I put J1, in the current value, and History[0] in the tag?
140
6
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft