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: 

Passing initial values via shift register into an event structure

Hi guys,

 

So I am having a little bit of difficulty passing my voltage output value to the VI (case structure) above. How can I pass data from the while loop below to the case structure on top? 

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

Hi Alex,

 

your thread title is quite misleading: there is no event structure visible in your image…

 

"Quick and dirty" answer 1: use a local variable.

"Quick and dirty" answer 2: put all code inside the while loop inside the upper case structure.

 

Better approach:

Create that VI again from scratch and implement a better code architecture! (Using something like state machines, producer-consumer-schemes, and the like…)

 

Btw. there are better ways to create screenshots. 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,389 Views)

@GerdW wrote:

Btw. there are better ways to create screenshots. 😄


And as long as you're attaching an image, you might as well put it in the message:

Insert Photo.PNG

1

 

Saves us a download, and gets you more answers...

0 Kudos
Message 3 of 7
(2,360 Views)

wiebe@CARYA wrote:

@GerdW wrote:

Btw. there are better ways to create screenshots. 😄


And as long as you're attaching an image, you might as well put it in the message:

Insert Photo.PNG

 

 

Saves us a download, and gets you more answers...


Yeah, including a lot of complaints!  What I think GerdW would advise you to do is to create a "Snippet" (look at the Edit Menu when looking at the Block Diagram) -- this created a .PNG file of the selected Code and doesn't require a camera!

 

Even better than a Picture, of course, is the VI itself.  With a VI, we can poke around, see all of the code (not just what "fits" in the picture), can see any Errors that might be flagged by LabVIEW, can inspect the values on the Front Panel, can actually run and test the code, etc.

 

Which would you prefer if I was asking you for help with a 300-line C++ program, a picture of (part of, or all of) the code, or the code itself?  Attach your VI.

 

Bob Schor

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

I assumed there is a good reason to post a photograph (although I can't thing of any good ones myself).

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

Sorry, here is my VI. I need to pass the data from my PID code to my driver code.

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

Hi Alex,

 

which of the 3 options I suggested in message #2 is a problem for you?

check.png

 

Btw. do you really need to read a type-K thermocouple at a samplerate of 1kHz?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(2,263 Views)