03-30-2017 04:13 AM
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
03-30-2017 04:45 AM - edited 03-30-2017 04:46 AM
03-30-2017 04:50 AM
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.
03-30-2017 07:51 AM
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
03-30-2017 07:56 AM - edited 03-30-2017 07:57 AM
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?
03-30-2017 08:10 AM
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
03-30-2017 09:17 AM
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…