LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create array in a VFG

Hello,

I would like to know how to create a array into VFG optimally. I know how to do but I don't think I have the right method. Do you have an example Do you have any examples that I can use as inspiration ?

 

Thank you for your helps

Regards

0 Kudos
Message 1 of 17
(1,951 Views)

Just for my curiosity: what does VFG mean?

Message 2 of 17
(1,928 Views)

@MaSta wrote:

Just for my curiosity: what does VFG mean?


Some possible acronyms:

 

Victorian Frog Group

Vista Financial Group

Virtual Facility Group

Versuchsanstalt Für Getreideverarbeitung

Very fast-growing

Visual Flight Guide

Virtual Fighter Group

Voice Frequency Generator

Valley Fig Growers

Virtual Facility Groups

Virtual Focus Groups

 

My bet is however on:

Variable Frequency Generator

 

But even if I'm right I would have no ideas what the OP wants exactly. It depends a lot on the type, make and model of such an instrument, to know what would need to be done. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 17
(1,911 Views)

Sorry,

 

VFG it's in French, I think it's FGV in english (Function Variable Fonctional).  

0 Kudos
Message 4 of 17
(1,907 Views)

Maybe a Functional Global Variable?

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 5 of 17
(1,859 Views)

@GSXR100038 wrote:

Hello,

I would like to know how to create a array into VFG optimally. I know how to do but I don't think I have the right method.


Show us how you currently do it (whatever it is!) and if there is a better way, we will tell you.

What's wrong with your current way (performance? convoluted code? incorrect result? does not always work? something else?)

0 Kudos
Message 6 of 17
(1,841 Views)

@GovBob  a écrit :

Maybe a Functional Global Variable?


Sorry, of course yes that's it.

 

 

 

 

 

 

 

 

 

0 Kudos
Message 7 of 17
(1,822 Views)

@altenbach  a écrit :

Show us how you currently do it (whatever it is!) and if there is a better way, we will tell you.


Hi,

Thank you,  Finally I managed to do something. I don't know if it's correct but it works for me (see in this attached). I use to synchronize 2 loops which do not have the same sampling frequency.

 

0 Kudos
Message 8 of 17
(1,816 Views)
  • You did not include the typedef, so I had to disconnect it
  • Since the stored array is always size=3, you can wire the "Value_in" directly to the replace array subset. No need to index and build a new array. The array will always be size=3, no matter the array size of "Value_in".
  • If Value_in is guaranteed to be size=3, you don't even need the "replace array subset".
  • You don't need to wire the index=0 for the replace array subset, it's the default.
  • I would recommend a feedback node because you can globally initialize it and also eliminate the while loop. This will guarantee that the size is 3 and all zeroes on first call, even if you forget to initialize. (In your code: If you write before init, the array will be size=0 on first run. You cannot replace elements that are not there.
  • I would make the "read" state the default, so you typically don't even need to wire it when reading.
  • Most of your output tunnels can be configured to use default if unwired, eliminating all these stray zero constants.
  • Not sure why your VI has an icon that depicts a matrix. Not intuitive and confusing!

It could look similar to the following:

 

altenbach_0-1668548263061.png

 

0 Kudos
Message 9 of 17
(1,805 Views)

@altenbach  a écrit :
  • You did not include the typedef, so I had to disconnect it
  • Since the stored array is always size=3, you can wire the "Value_in" directly to the replace array subset. No need to index and build a new array. The array will always be size=3, no matter the array size of "Value_in".

Thank you, let me a little time to watch please, after I'll be back. 

0 Kudos
Message 10 of 17
(1,755 Views)