Handling array from scripting
Posted: Tue Aug 04, 2020 11:20 am
Hello, I am trying to initialize an array into my PLC by means of a script using the following code, launched by a button:
public partial class ScriptModule1
{
public void InitTags()
{
int i;
Globals.Tags.Tag2.Value = 10;
for (i=0; i<10; i++)
Globals.Tags.Tag1.Values.Value = i;
}
}
Tag2 gets intialized with 10, nothing happens to the Tag1 array. Any idea on what I am doing wrong?
Project is attached.
Thanks,
Federico [/i][/i]
public partial class ScriptModule1
{
public void InitTags()
{
int i;
Globals.Tags.Tag2.Value = 10;
for (i=0; i<10; i++)
Globals.Tags.Tag1.Values.Value = i;
}
}
Tag2 gets intialized with 10, nothing happens to the Tag1 array. Any idea on what I am doing wrong?
Project is attached.
Thanks,
Federico [/i][/i]