From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it any way to show the number of elements of array before run?

Solved!
Go to solution

Hi there,

  In runtime, I can use the array size function to check the number of elements in an array.But is it any way to show the size of array in edit mode (i.e. before turn the vi)? Thanks.

0 Kudos
Message 1 of 7
(2,765 Views)

Where does the array data come from?

 

You can always right-click the array control and do "advanced...show last element" the index display will give you a hint on the array size. 

0 Kudos
Message 2 of 7
(2,750 Views)

@altenbach wrote:

Where does the array data come from?

 

You can always right-click the array control and do "advanced...show last element" the index display will give you a hint on the array size. 


The array contains for some complicate culster. Yes, you are right, using show last element will give a hint. But what I am looking for is that anyway to show an indicator on the front panel to show the dimension when user change the size on the fly.

0 Kudos
Message 3 of 7
(2,747 Views)
Solution
Accepted by topic author dragondriver

@dragondriver wrote:
The array contains for some complicate culster. Yes, you are right, using show last element will give a hint. But what I am looking for is that anyway to show an indicator on the front panel to show the dimension when user change the size on the fly.

You can implement the entire thing (array control and size indicator) as an X-control. They are fully operational in edit mode.

 

I still don't quite see what you are trying to do? Why would it matter what happens in edit mode? A finalized VI should always be runnning during use. Use a state machine architecture.

0 Kudos
Message 4 of 7
(2,737 Views)

@altenbach wrote:

@dragondriver wrote:
The array contains for some complicate culster. Yes, you are right, using show last element will give a hint. But what I am looking for is that anyway to show an indicator on the front panel to show the dimension when user change the size on the fly.

You can implement the entire thing (array control and size indicator) as an X-control. They are fully operational in edit mode.

 

I still don't quite see what you are trying to do? Why would it matter what happens in edit mode? A finalized VI should always be runnning during use. Use a state machine architecture.


The array's element is a cluster containing the information of harmonics wave generated, so 3 elements mean 3 harmonics and 5 means 5 harmonics. This is required by client. I am writing some code for the client so they will know ahead of running how many elements of the array (i.e. how many harmonics wave) there will be.

0 Kudos
Message 5 of 7
(2,731 Views)

@dragondriver wrote:

The array's element is a cluster containing the information of harmonics wave generated, so 3 elements mean 3 harmonics and 5 means 5 harmonics. This is required by client. I am writing some code for the client so they will know ahead of running how many elements of the array (i.e. how many harmonics wave) there will be.

It still does not make a lot of practical sense. Why would an end user even have a VI in edit mode??? How does the data get into the control in the first place?

 

If they are just 3-5 elements, make the array container big enough so all elements show.

 

Can you attach a simplified version of your VI?

0 Kudos
Message 6 of 7
(2,724 Views)

@altenbach wrote:

@dragondriver wrote:

The array's element is a cluster containing the information of harmonics wave generated, so 3 elements mean 3 harmonics and 5 means 5 harmonics. This is required by client. I am writing some code for the client so they will know ahead of running how many elements of the array (i.e. how many harmonics wave) there will be.

It still does not make a lot of practical sense. Why would an end user even have a VI in edit mode??? How does the data get into the control in the first place?

 

If they are just 3-5 elements, make the array container big enough so all elements show.

 

Can you attach a simplified version of your VI?


The code is not written for end user but they need to use that code for other development. However, for some reasons, they want to see the change of size on the fly during their coding. Since there are so many code not developed by myself so I am not allowed to shown them on the forum. But you mention the X-control and I look at the description, I think that's the thing I am looking for so I can control the behavor even in edit mode. Thanks.

0 Kudos
Message 7 of 7
(2,713 Views)