LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case

Hi

Can someone please show me how to see/use the results in my array (initialised array) in the next case ie case number 2 in my state machine.

Many Thanks 

David

0 Kudos
Message 1 of 7
(3,359 Views)

Hi David,

 

use shift registers! (THINK DATAFLOW!)

 

And please don't use "default if unwired" tunnels with references. Never ever! 😉

Best regards,
GerdW


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

Hello David,

A local variable of the array read in the state 2 should be the simplest way to fit your need, but as a general guideline local and global variables don't give high performance with arrays when they grow large. So I suggest you to pass the array through the various states using a shift register, exactly as you do with the numeric constant that sets the state.

0 Kudos
Message 3 of 7
(3,326 Views)

Hi GerdW

I have attached my vi. in case 1 bottom right hand corner of my case statement I cant make it a shift register it wont let me if you also look at case 2 I cant connect my initialised array to it .

 

I want to be able to display the data in case 2? can you please advise

 

Best regards

David

 

 

0 Kudos
Message 4 of 7
(3,298 Views)

Hi David,

 

in case 1 bottom right hand corner of my case statement I cant make it a shift register it wont let me

Shift registers belong to loops, but not case structures!

There already is a shift register in this loop, all you need to do is create another one!

(This is pretty basic LabVIEW stuff - I guess you noticed the "Getting Started" on top of the LabVIEW board already!?)

 

Unfortunately I cannot open your VI, I'm stuck with LV2014 right now.

 

What's the point of the innermost FOR loop in your image? Why don't you use BuildArray in concatenation mode?

Best regards,
GerdW


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

Hi GerdW

 

I have attached 2 screen shots i am trying to pass an array  in case 1 (100 bytes) to work on in case 2 I have only put in initialized array in case 2 to check I can view them for testing purposes I have tried a shift register but it did not display any data in my array in case 2?

 

Best Regards

David

 

Download All
0 Kudos
Message 6 of 7
(3,286 Views)

Hi David,

 

i am trying to pass an array  in case 1 (100 bytes) to work on in case 2

Repeating the previous suggestion: use a shift register to keep data from one iteration of your statemachine to the next!

 

I have only put in initialized array in case 2

Well, did you read the error messages you get by your wiring?

Repeating the very basic LabVIEW mantra: THINK DATAFLOW!

 

I have tried a shift register but it did not display any data in my array in case 2?

There is no corresponding shift register in your images…

Best regards,
GerdW


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