LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the benefit of passing variables to Vi's instead of Refs?


@Ben wrote:

Think about performance at design time, ID where the loads will be and "worry about the performance in the large data set vis" while developing and watch the CPU uses like a hawk while doing unit testing.


Be careful about taking this too far; it's been said that "premature optimization is the root of all evil" (attributed, so far as I can tell, to Donald Knuth, a well-regarded computer scientist).

0 Kudos
Message 21 of 32
(1,126 Views)

@nathand wrote:

@Ben wrote:

Think about performance at design time, ID where the loads will be and "worry about the performance in the large data set vis" while developing and watch the CPU uses like a hawk while doing unit testing.


Be careful about taking this too far; it's been said that "premature optimization is the root of all evil" (attributed, so far as I can tell, to Donald Knuth, a well-regarded computer scientist).


Agrred but ignoring it unitl after the code is developed is at best wishful thinking.

 

Paraphrasing a quote from one of my customer's Grandmother;

 

"All things in moderation, especially moderation."

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 22 of 32
(1,121 Views)

Thank you for all of your comments thus far, I asked the original question as part of the process for controlling a single VI from two separate VI's.  The single VI is the controller for an spi port expander that simply controls some switches.

 

I would like to know how to link 2 seperate and indepedant VIs' Controls to a single VI.  I thought a reference made sense, but not quite right yet.  Here is an example and some temp Vi's.  Any help?

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 23 of 32
(1,103 Views)

additional attachment

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 24 of 32
(1,102 Views)

You need two queues.

one multiple procucer single consumer of type

Cluster of

<Source as string

cluster <your cluster>

>

enqueue at VI1 and VI2 on your cluster value change dequeue in VI3 and update Cluster indicator in VI3 with new value via terminal

the other queue of type

Cluster of

<Destination as string

Cluster <Your cluster>

>

Enqueue at VI3 to destination that is not source with updated value of your cluster

 

Preview in VI1 and VI2 Dequeue if Destination is this vi and update your cluster control through a local variable

 

 

 


"Should be" isn't "Is" -Jay
Message 25 of 32
(1,091 Views)

If it's not too much trouble could you show me using the files I provided?  I have used queues, but i'm not sure what it is you are suggesting.  If you can make this work, you are brilliant!

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 26 of 32
(1,089 Views)

here you are

This VI and That VI are the two independant VIs each will update the indicator in Coordinator.vi  Coordinator then flashes the data back to the vi that was not the source to update the control with the new state.

 

Stopping either This or that creates a cascade stopping everyone-  Adapt it to your needs

 

Be careful I should have chosen better names since the logic is odd when this vi is that vi


"Should be" isn't "Is" -Jay
Download All
Message 27 of 32
(1,077 Views)

Absolutly BRILLIANT!!! I tried it out and it works just as described.  I have to examine the code to make sure it's compatible with my programs.  THANK YOU SO MUCH!

 

 

there was some broken wires and such when I opened it, did you save it like that?  or did something disappear when i opened it?  all the dependencies had to be re-linked

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 28 of 32
(1,070 Views)

I never had the type def of the cluster. So, yes the vi.s were saved broken  whoohooo... Glad they worked I never got to test it  (But that would have meant I had actually coded a bug not me- not everSmiley LOL)


"Should be" isn't "Is" -Jay
0 Kudos
Message 29 of 32
(1,068 Views)

even cooler, that you never got to run it.  LOL.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
Message 30 of 32
(1,065 Views)