Array does not store value

C. Drouaud 6 years ago in IQANdesign updated by Gustav Widén (System support) 2 years ago 4

Hello everyone,

I have some issues with arrays which don't store the value. 

I use a digital trigger to store some data in 6 different arrays. 2 of them correctly store the data so I can get them after, but the 4 others don't store the values, they stay at 0. Stored values are real. 

Here is the Qcode i use to store the values. Expect the name of the channel, it is the same Qcode for each array : 

Image 1305

When New hole in is true, Hole number is incremented and I want to store the values related to the previous hole number. I have a 1000ms tempo on resetting datas (X axis corrected for example). Example I gave is the one working.
Thanks in advance for your ideas about this issue.

Hello Drouaud.

You have done a strange line of code there.

Is this all the code?

Do you have a grey square to the right of this line that say 'Expression not used' if you hover the pointer over it?

What you are doing here is calculating the value from 'drilling data - the value you have in the array at position hole - 1'.

You are at the same time setting the value of the array at position hole - 1 to be equal to X axis corrected.


Actually, the full name of my array is "Drilling data - X axis". I want to store the value of "X axis corrected" everytime "New hole in" is true. I store this value in row "Hole number" -1 because array are 0 based. 

Here is another example, with the following code :

if Reset hole number = true then
elseif PositiveFlank(New hole in) then
Drilling data - depth MET[Hole number-1] := Depth MET

This one is note working. I have no error message.

Ok, then the code makes much more sense.

I can not see anything else wrong with the code.

But the first one works and this second does not?

Does it not do anything?

If you simulate and look in the code is there any number to the left of the code line when the "new hole" is triggered?

You can pause the simulation and step if forward one cycle at a time to make it easier to see.

Yes, I have 6 arrays, 2 are working and 4 don't work. The first example I gave is working, the second isn't.

When I simulate, I have the value I want to store displayed next to the code line. 

See example :

Despite that, I can still not extract the value from the array. 

I'm going to re-check my function extracting the data from the array, maybe the problem come from there.

Thanks for the help.