LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to I take measurements of a laser array with only one sensor and dynamically displaying power level?

I have thought from the start shift register was the way to go, but, the proposed solution provides a similar response to my previous attempts. See below.

 

Proposed vi.png

 

Initial Run

  • Does not take measurement
  • Does not continuously monitor

Selection of Ch2

  • Ch1 updates

Selection of Ch3

  • Ch2 updates

Re-Select Ch1

  • Ch12 update

Re-Select Ch2

  • Data in element 1 shifts to element 2, 2 shifts to 3 and so on
0 Kudos
Message 11 of 17
(1,287 Views)

Ok, so I found one mistake I made; insert into array vs replace element into array. Next step is to figure out why array is not initialized when .vi is first started and get the .vi to continually monitor the selected channel.

0 Kudos
Message 12 of 17
(1,278 Views)

What other events to you have?  Your event structure tunnel shows it is set for "Use Default if Unwired".  That means you have some unwired cases.  If one of those other event cases runs, the default value of an empty array is put out of the tunnel.

 

Make sure you wire you array through all of your event cases.

 

Another problem is that you used Insert into Array, while Blokks snippet used Replace Array Subset.

 

Also, the way your are unbundling your cluster just looks wrong.  But it is hard to say because you didn't post your VI, I can't see how you have that cluster set up.  You want to see which of those buttons became true since the last time, and use that as the index to the Replace Array Subset.

0 Kudos
Message 13 of 17
(1,275 Views)

It is only the "Stop" case so didn't think it much matter becuase the array should be re-initialized when started again.

Stop Case.PNG

0 Kudos
Message 14 of 17
(1,272 Views)

RavensFan explained why you see what you see. Try to use the replace array subset, and post your VI. Otherwise it is difficult to help.

0 Kudos
Message 15 of 17
(1,228 Views)

Thanks for the response Blokk, please see previous posts. There is nothing new to post; screenshots of .vi is posted in previous posts. I did find an issue with it when I originally posted it. I had been using the "Insert into Array" when I should have been using the "Replace Array".

 

What I am trying to work out now is how to continually monitor the channel selected and still be able to change channels.

0 Kudos
Message 16 of 17
(1,202 Views)

@jeb3078 wrote:

Thanks for the response Blokk, please see previous posts. There is nothing new to post; screenshots of .vi is posted in previous posts. I did find an issue with it when I originally posted it. I had been using the "Insert into Array" when I should have been using the "Replace Array".

 

What I am trying to work out now is how to continually monitor the channel selected and still be able to change channels.


Set a timeout case for your event loop. Set an appropriate timeout value. Use an additional shift register where you store the info about which is the current selected channel. And put a data read into this timeout case of your Event structure.

 

Try to make your VI, if you get difficulties, please post your VI (not screenshot) so we can help you faster.

Regards,

0 Kudos
Message 17 of 17
(1,196 Views)