LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using shift registers in a while loop that never loops

Solved!
Go to solution

Below is an image from "syslog_Device Function Engine.vi". This isn't really a question specifically about this vi, but rather a technique I see here.

 

First thing I noticed was a while loop that always exits, never loops. And shift registers. Is this used so that the VI can retain values between calls, almost like what I would consider local variable that are persistent between function calls in another language? This is an interesting way to accomplish this that I haven't considered.

 

Please tell me if I'm missing what's going on here.

 

While loop shift registers.JPG

Message 1 of 5
(2,569 Views)
Solution
Accepted by topic author Xooch

That is an Action Engine.

 

It is a code construct that allows encapsulating data and functionality that can be accessed in multiple threads.

 

The nugget I linked above explains their operation the theory behind them and the follow-up discusion talks about how to exploit them.

 

Good questin by the way!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 5
(2,567 Views)

One thing to note- just because a true is wired to the stop terminal, the while loop will actually iterate one time. You may already know this but its a little hard to tell from your wording so I just wanted to clarify. I'm fairly impressed though that you caught on to the purpose of this action engine or functional global technique by just looking at the code. It can often go right over the head of many a new LabVIEW developer

0 Kudos
Message 3 of 5
(2,560 Views)

for(imstuck) wrote:
One thing to note- just because a true is wired to the stop terminal, the while loop will actually iterate one time. I'm fairly impressed though that you caught on to the purpose of this action engine or functional global technique by just looking at the code. It can often go right over the head of many a new LabVIEW developer


 

Ditto that.

 

The first time I saw that construct I called the developer and read him the riot act  "...and you didn't even bother to initialize the shift registers!"

 

Smiley Wink

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,555 Views)

@Ben wrote:

@for(imstuck) wrote:
One thing to note- just because a true is wired to the stop terminal, the while loop will actually iterate one time. I'm fairly impressed though that you caught on to the purpose of this action engine or functional global technique by just looking at the code. It can often go right over the head of many a new LabVIEW developer


 

Ditto that.

 

The first time I saw that construct I called the developer and read him the riot act  "...and you didn't even bother to initialize the shift registers!"

 

Smiley Wink

 

Ben

 


 

Where's the foot-in-mouth smiley when you need it 🙂
Message 5 of 5
(2,550 Views)