rQx
Lifetime Supporting Member
Hi!
I have no experience at all with VB script but I think I might need something here.
The issue is that we mainly have the WinCC Flexible to LOG values. But since you can't log values that are in an array the tags eat up quickly. So my thought was to make a VBscript that copy the array to seperate internal tags and then I can log the tags as usual.
I have to come up with a solution myself but I only got halfway. From what I read on siemens I shouldn't use arrays from external because it will read the whole array everytime, so in a loop that will take time. So my first script is here:
DIM i, i2, local_array(29)
For i = 0 To 29
local_array(i) = SmartTags("CPU_Array")(i)
Next
I think that this script will loop throu the PLC array and copy it to my internal temporary array in the script right?
In my tag editor I will make tags LOG0, LOG1, LOG2, LOG3, LOG4 etc etc etc and then I want to copy the local_array(0-29) to my seperate LOGs.
For i2 = 0 To 29
SmartTags(LOG & i2) = local_array(i2)
Next
So my problem is: How do I access the seperate internal tags (LOG0 etc) in the smart tag expression? As you see I have made a foolish example to let you know how Im thinking.
/tim
I have no experience at all with VB script but I think I might need something here.
The issue is that we mainly have the WinCC Flexible to LOG values. But since you can't log values that are in an array the tags eat up quickly. So my thought was to make a VBscript that copy the array to seperate internal tags and then I can log the tags as usual.
I have to come up with a solution myself but I only got halfway. From what I read on siemens I shouldn't use arrays from external because it will read the whole array everytime, so in a loop that will take time. So my first script is here:
DIM i, i2, local_array(29)
For i = 0 To 29
local_array(i) = SmartTags("CPU_Array")(i)
Next
I think that this script will loop throu the PLC array and copy it to my internal temporary array in the script right?
In my tag editor I will make tags LOG0, LOG1, LOG2, LOG3, LOG4 etc etc etc and then I want to copy the local_array(0-29) to my seperate LOGs.
For i2 = 0 To 29
SmartTags(LOG & i2) = local_array(i2)
Next
So my problem is: How do I access the seperate internal tags (LOG0 etc) in the smart tag expression? As you see I have made a foolish example to let you know how Im thinking.
/tim