I am working with dataset memory tags with four columns, the first of which is a date type with the index “DATE” storing a date. When I restart my machine, I have noticed that the values allocated in this column are blank. I have no idea what could be causing this. I will share the script I am using to write this data to my columns.
def onScheduledEvent():
# Caminho do tag
pathDataset = "[edge]Plant/Prod_Data/TAG_B_TESTE"
# Ler o dataset atual
datasetAtual = system.tag.readBlocking([pathDataset])[0].value
pyDataset = system.dataset.toPyDataSet(datasetAtual)
# Leitura dos valores dos tags
wt01 = system.tag.readBlocking(["[edge]Ramp/Ramp1"])[0].value
wt02 = system.tag.readBlocking(["[edge]Ramp/Ramp4"])[0].value
wt03 = system.tag.readBlocking(["[edge]Ramp/Ramp7"])[0].value
dataAtual = system.date.now()
# Criar lista de linhas
linhas = []
for linha in pyDataset:
linhas.append([linha["DATE"], linha["WT01"], linha["WT02"], linha["WT03"]])
# Adicionar nova linha com data válida
linhas.append([dataAtual, wt01, wt02, wt03])
# Cabeçalhos
colunas = ["DATE", "WT01", "WT02", "WT03"]
# Criar novo dataset
novoDataset = system.dataset.toDataSet(colunas, linhas)
# Escrever no tag
system.tag.writeBlocking([pathDataset], [novoDataset])
I condenced your code. I also changed it to use the addRow function. Try it and see if you have better results.
def onScheduledEvent():
# Caminhos de tag
caminhos = ["[edge]Plant/Prod_Data/TAG_B_TESTE","[edge]Ramp/Ramp1","[edge]Ramp/Ramp4","[edge]Ramp/Ramp7"]
# Leia todos os valores de tags em uma única chamada
datasetAtual,wt01,wt02,wt03 = [qv.value for qv in system.tag.readBlocking(caminhos)]
# Obtenha a data atual
dataAtual = system.date.now()
# adicionar linha ao conjunto de dados
novoDataset = system.dataset.addRow(datasetAtual,[dataAtual,wt01,wt02,wt03])
# Escrever para marcar
system.tag.writeBlocking([pathDataset], [novoDataset])
There must be something about that column’s type, since the other one are just fine.
Can you try adding a new column of type datetime and see if it does the same thing ?
Due to restrictions at the company where I work, it seems that the gateway reset commands are disabled. I was denied access when executing the commands.
Except that values don’t seem to be making it to the internal DB.
I’m not sure what registering the gateway has to do with your issue. That was not the question that Paul asked.
Something appears to be interfearing with a memory tag persisting its value, so I at least would expect there to be some type of error, even if it’s only listed in the wrapper log.
Upload a copy of your wrapper log. If you don’t know where to get that, then ask that question.
Edit: If you are running into the bug I think you are then the workaround would be to set the gateway’s language to English by adding this additional parameter to the ignition.conf file. Just make sure you replace the X with the next available integer according to your .conf file.