Adjusting Dataports: exporting and uploading historical data


#1

Hi everyone. I have a device with a few dataports that are currently set up as integer types. I have determined that I would prefer those dataports to be set up as floats in the future. I am assuming that I cannot not simply change the format of a dataport. Is that correct?

With that assumption, my current plan is to export the historical data from my integer dataports to a .csv, create a new float dataport in my device, then use Exoline to record my historical data to the new dataport. That way, I will have the historical integer values in my dataport, but I will be able to write float values moving forward.

Is this the best process or is there a more efficient method you can recommend to me? I plan to update each dataport one at a time. Are there any tricks I should use or any potential hazards I should avoid? I would appreciate any support or recommendations you can provide. Thanks.


#2

Hi John, congrats on your first post.

I am assuming that I cannot not simply change the format of a dataport. Is that correct?

You are right, the ‘type’ of a dataport cannot be changed once it has been created. If you find yourself carrying out this operation often, we would suggest making a script to handle this operation. You would find these RPCs invaluable:

The payload of read already meets the [[<timestamp>, <value>], ...] that record batch expects. So you shouldn’t have to do any funny handling.

Of course being familiar with your application John, you may find that copying the information via Exoline, creating the dataports through the web interface, and then sending the old data – may take less time. I remember that you have only a few devices and dataports to update.