LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric array position

Solved!
Go to solution

Hi.

I have done one program where I want to write first the number 58 and then number 2 and I want to see both numbers. When I execute the program it writes okey first the number 58, but then, to put the number 2 it deletes the number 58 and I don´t want to delete the number 58. How can I do it to see both numbers, without deleting anyone?

 

 

0 Kudos
Message 11 of 20
(1,266 Views)
Solution
Accepted by topic author labview99

Hi 99,

 

you still miss basic LabVIEW knowledge: why do you try to insert elements in an empty array?

Why do you need a sequence structure and local variables???

 

Why don't you start with Training (as suggested several times before) and very basic testing VIs to learn LabVIEW?

check.png

 


@labview99 wrote:

When I execute the program it writes okey first the number 58, but then, to put the number 2 it deletes the number 58 and I don´t want to delete the number 58.


Because you even miss that basic "THINK DATAFLOW!" mantra due to your mis-use of local variables!

Do yourself a favor and start with those Training resources offered in the header of the LabVIEW board…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 20
(1,257 Views)

Yes, you are right, i have not noticed.

Thank you for your help

Best regards

0 Kudos
Message 13 of 20
(1,249 Views)

Hi,

I have done a program in which I have to insert to different numbers in one array, and I don´t know why, but it inserts one number and when it has to insert the other one it eliminates the previous number. I attach one picture to see more clear.

insert number.PNG

The blue line is connected to the array where I want to insert the two numbers.

Best regards

0 Kudos
Message 14 of 20
(1,220 Views)

You branch the wire (blue, thick array wire) and so you have two different arrays.

You need to pass the array through continuously.

You probably also want to read about Shift Registers.

 

I will also suggest the learning materials at the top of the forum 😉

 

Here's a quick example for Replace Array Subset (which may or may not be what you want - consider also Build Array or Insert Into Array).

Example_VI.png


GCentral
0 Kudos
Message 15 of 20
(1,208 Views)

Hi 99,

 

why do you still start new threads for the very same old problem? Stick with your threads!

 


@labview99 wrote:

I don´t know why, but it inserts one number and when it has to insert the other one it eliminates the previous number.


You still miss the very basic "THINK DATAFLOW!" paradigm…

 


@labview99 wrote:

The blue line is connected to the array where I want to insert the two numbers.

 


No, the blue "line" (LabVIEW term "wire") is NOT connected to the array. You write the result of both array operations to two individual "value" property nodes of the same (?) FP element: a classical race condition

What about "THINK DATAFLOW!" to avoid race conditions?

Why don't you follow my suggestions?

 

When do you start to take those Training resources offered several times before?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 20
(1,205 Views)

I ask again because it is not clear to me. Sorry for asking again

0 Kudos
Message 17 of 20
(1,200 Views)

Hi LabVIEW99,

 

I suspect that as GerdW (and others) have said, although people here are happy to help, you might find it more productive to take some of the free training materials available first.

This will allow you to do more by yourself quickly, and then you can ask questions about things you still find problematic.

 

There are both videos and text-based tutorials, depending on which you find more useful, or I believe (I haven't searched) that there are also now several possible sources on Youtube for LabVIEW videos and tutorials (I make no claims about their quality, either high or low).


GCentral
0 Kudos
Message 18 of 20
(1,195 Views)

I have reviewed the labview manual several times and l have also reviewed different examples, but, I still can not get the way to add to an array (that I have defined as a controller), the number that I want in the position that I choose.

 

0 Kudos
Message 19 of 20
(1,177 Views)

@labview99 wrote:

I have reviewed the labview manual several times and l have also reviewed different examples, but, I still can not get the way to add to an array (that I have defined as a controller), the number that I want in the position that I choose.

 


Despite all of that it appears that you still are fighting against the basic tenet of LabVIEW - dataflow (unless, of course, you have an updated vi that you have not shared). The last picture that you posted had branched wires and race conditions. You had already at that point been given suggestions that you ignored. Then cbutcher gave you an example that you have also ignored. Have you done anything to try to implement these suggestions? What you are struggling with is basic, easy stuff to do in LabVIEW. You should really take some time and do more than review the manual and review examples. You really should complete the free training material (notice I said complete, not review). You've probably already wasted more of your time struggling with this than it would have taken to complete the training material. There are many people here who are willing to help when you struggle, but it becomes difficult when you continue to ignore the help that is given.

 

 

Message 20 of 20
(1,171 Views)