Initial values Crimson 3

secs

Member
Join Date
Aug 2015
Location
Office
Posts
65
Hi all.

I have an array of tags (10) that I store number of seconds in to get an average but I cant work out how to store a default value in them or run a program on start up so that they have a value to do the first calc? I simply need to store 16 in each or initialise them with a 16



Regards, Peter
 
Hi all.

I have an array of tags (10) that I store number of seconds in to get an average but I cant work out how to store a default value in them or run a program on start up so that they have a value to do the first calc? I simply need to store 16 in each or initialise them with a 16



Regards, Peter

One way to do it.

Assume your Tag is named ArrayTag. Run a Program from your OnStartup Global Action

ArrayTag[0] := 16;
ArrayTag[1] := 16;
...
ArrayTag[9] := 16;


Another way...

int I;

for (I=0; I < 10; I++) {

ArrayTag := 16;

}

Check they Syntax, but either way should work
 
I had been looking for a startup type event but couldnt see one. Where would I find that? I assume under some properties somewhere but not having luck as yet :-(
 

Similar Topics

I'm getting frustrated creating arrays of variables in Machine edition. I need to make 2 variable arrays that are 102x2 in size, with varying...
Replies
3
Views
103
Hi everyone, I have a DL06 I'm trying to get some historical info off of. I don't have access to the actual PLC, but I have the program. I'm...
Replies
0
Views
1,160
Hi there, Interesting problem today... I have been using the same code for sometime and all of a sudden my initial values are not being...
Replies
0
Views
1,022
Hi, What do you guys do when you have situation like this: After leaving commisioning some variables(Tags inside DBs) I want to be fixed even...
Replies
5
Views
2,076
I'm working usually with s7-300 cpu or ET200S. Going on commisioning for hydropower plants. Let's say program is quite huge. A lot of DBs.Initial...
Replies
12
Views
5,482
Back
Top Bottom