AnsweredAssumed Answered

DataLink read, write values SMT DataArquive

Question asked by Douglas on May 10, 2019
Latest reply on May 29, 2019 by Douglas

Hello All


The pitulval function code, I noticed that before WRITE for the SMT DataArchive, we need to first READ the TAGs to confirm whether or not SMT DataArchive exists values for such TAGs in their timestamps.


I made a code for the macro READ the SMART DataArchive using the DataLink function Data with Timestamp in the auxiliary array (AK6: AV30) and the LER macro returns the values for the array (E6: O30), however from what I perceived the customers who must first meet (Conditions 1 and 2) and Condition 3.


The vba READ is simple, it needs to improve its security, in the sense that the READ values when WRITE in the Data Archive do not override values that already exist in the SMT, okay ?


Attach the figures for understanding and the vba code READ.


Sub READ()

Dim i As Integer
Dim j As Integer
Dim sTagname As String
Dim valueCell As Range
' Dim stime As String
' Range("AL7:AV30").Select
For i = 1 To 24
'Range("E7:O30").Cells(i, j) = Range("AL7:AV30").Cells(i, j)
For j = 1 To 11
Range("E7:O30").Cells(i, j) = Range("AL7:AV30").Cells(i, j)
sTagname = Range("E7:O30").Cells(1, j + 1) 'celula com nome da tag
Range("E6:O30").Cells(1, j + 1).Select '(PARA SABER qual TAG é)
Set valueCell = Range("E6:O30").Cells(i + 1, j + 1) 'celula com valor
Range("E6:O30").Cells(i + 1, j + 1).Select '(PARA SABER A CÉLULA valor)
Next j
Next i
End Sub


Regards the All...