LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bidirectional connection between array and controls

Solved!
Go to solution

Hi dear all members

I want to get a bunch of data (about 300 long integers) from visa serial read function and display them on the front panel and then change some of the values and again send them back with write visa function. For this I made 300 control displays and connect them to an array with array build function and so the visa functions are connected to the array.I need to point out that as I have to positioned the values in different places in Vi front panel so I couldn't do it all just by one unique array which the elements are in specific cells and not be separated and located differently.
But now for getting values from visa serial and sending them from array to my 300  control displays I have to create local variables from each 300 control displays and again connect them to my array which is really  time-consuming. Is there any suggestions to help me get rid of this I mean is it possible to make any kind of bidirectional connection between controls and related elements in the array which any change to any of them causes change to the other simultaneously?

Thanks in advance

0 Kudos
Message 1 of 40
(3,860 Views)

Hi Laian,

 

creating and placing 300 individual controls on your frontpanel sounds wrong…

 


@Laian wrote:

I want to get a bunch of data (about 300 long integers) from visa serial read function


Are those 300 values related to each other in any way?

Are there some smaller groups of values, which could be collected by using arrays or clusters?

 


@Laian wrote:

Is there any suggestions to help me get rid of this I mean is it possible to make any kind of bidirectional connection between controls and related elements in the array which any change to any of them causes change to the other simultaneously?


Use clusters to group related values.

Use arrays to handle values of the same kind.

Minimize the number of frontpanel elements before starting any further improvements…

 

You could use control references to set values.

You could use an event structure to handle user inputs on your controls.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 40
(3,829 Views)

How about using Single array to display all Integer data?

 

Please do share the code for better Understanding.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 3 of 40
(3,825 Views)

Hi thanks for ur answre 

I have a code in a micro chip and I want to know that my code working well so with serial port I send all variables data flags to LabVIEW and then change the values with LabVIEW and again send back to micro for another cycle 

And I have 300 hundred variables

 I want to see them sometimes as boolian value sometimes as number to see how my code works

0 Kudos
Message 4 of 40
(3,814 Views)

Hi Laian,

 


@Laian wrote:

I want to see them sometimes as boolian value sometimes as number to see how my code works


So you could group those values! Atleast you could separate "numbers" from booleans…

Most often there are also related values(like parameters of a PID controller), which could be grouped in clusters…

 

Again: minimize the number of frontpanel elements!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 40
(3,808 Views)

Thanks again

So if I use cluster then how can I send data from visa read/write functions to cluster?

Again I need cluster to array function ☹️

0 Kudos
Message 6 of 40
(3,802 Views)

Hi

array force me to set values in an array indicator and I can't move cells to any locations on the front panel


@PalanivelThiruvenkadam wrote:

How about using Single array to display all Integer data?

 

Please do share the code for better Understanding.


 

0 Kudos
Message 7 of 40
(3,801 Views)

Hi Laian,

 


@Laian wrote:

So if I use cluster then how can I send data from visa read/write functions to cluster?

Again I need cluster to array function ☹️


You don't need the ClusterToArray function to read/write data from/to a cluster. You need (Un)Bundle(ByName)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 40
(3,798 Views)

Thanks I will try it

0 Kudos
Message 9 of 40
(3,787 Views)

All I can say is I would not want to work with any front panel that had 300 controls. There has got to be better ways of handling your data.  Working with a front panel with 300 controls would be a nightmare, both for the programmer and the user.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 10 of 40
(3,727 Views)