Tags stop updating after adding tags via csv import

I am starting to have some issues with all of my tags not updating once I add new tags via csv file. I have to restart the gateway to get the tags to start updating again. I have about 28k tags in a single internal sql tags provider. What can I check to see what is going on? are there any best practices to do when importing new tags via csv? I sometimes import a hundred or so csv files with 36 tags in each csv file. I usually do 7 csv imports at a time and then wait for the import to finish then do another 7.

not sure if this is related, but I have also noticed that it takes quite a while to browse my tags in the designer. If I try and expand a folder that has tags in it sometimes it takes a minute or two for it to actually show the tags in that folder.

I am running version 7.2.6.

I’m not sure we have the exact issue you are having since but I’ve run into similar behavior with external database driver and the import.

The CSV Import will basically delete existing tags found in the csv and import the tags again as new rows with new ids. I think that when the internal java classes rebind to the database after the import it sometimes does not get it quite right all of the time. If you used an external database driver you could try setting the configchange column to now() or current_time() if you use and that might fix things. I dont think you can do that with internal db driver though. It also does some things with scan class specifications I dont expect but seems to usually work anyway.

In projects where I actually use the CSV importer I tend to try to create the CSV file with only new tags and no existing tags unless the existing tags need a significant change. This also helps with the speed since it will only load the new tags and not everything all over again.

We basically wrote our own importer (for the external database driver) because we needed to programatically add tags and change scanclasses and developed a policy of only inserting new rows and updating existing rows in the database because of strange behavior like incorrect permissions in one tag out of 40K even though the database has correct settings.

Are the tags subscribed against OPC-UA? If so, this likely has been fixed in 7.3. After doing the imports, you might notice in your gateway logs that you’re getting errors on the server side- there was a bug that seemed to be caused by this type of importing.

I suspect that importing should be more stable in 7.3 in general. The way tags are stored has been modified for both the internal and external providers, and should be a bit quicker now.

In regards to the external providers- due to how the polling system works, we’ve seen problems (for both configchange and valuechange) when the queries to set those values take too much time. That is, imagine you’re importing tags, and it sets the configchange to “current_timestamp”. The poll occurs ever second, and uses the last time in the query, so if the query to update the timestamp takes over a second (or depending on how they line up), they might get missed. To solve this, you can insert in smaller batches, or maybe set the poll rate to be a bit slower.

Regards,

yeah, we are using opc-ua.

how about the sqltags browser taking quite a while to load the tags. I have a bunch of folders and if I drop one down it takes at least a few minutes to load the tags. now once they are loaded I dont have an issue, just on the first time I expand something.

noticed after importing 295 csv files that if I keep all of the tag folders collapsed this doesnt seem to be an issue. not a problem, just wondering why it would make a difference if the tag folders are expanded?

Keep in mind you only subscribe to tags if the folder is open in the SQLTags Browser of the designer. So if the tags are leased expanding the folder or using a tag on the screen will cause it to start updating.