LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

building arrays

And now that we can see the code, we can see what the problem is right away: no shift register:



Also, by looking at the code we can see that we can replace the while loop with a for-loop. Inside the while loop you have a "Number to Boolean Array". Use this to auto-index a for-loop, and you don't need to check for a "done". I don't know what the rest of the code is doing, but just based on what I now see I don't see the point of the Replace Array business in the first place:


Message Edited by smercurio_fc on 06-01-2007 04:34 PM

Download All
Message 11 of 21
(1,780 Views)
Actually, you could embed it in the body of the text instead. (or link directly http://img530.imageshack.us/img530/403/democodeve4.gif).
 
Getting rid of these annoying popups:
 

('hope it works. Some sites block direct linking. Looks OK for me so far....).

Message 12 of 21
(1,769 Views)

Hello,

  Thanks for the quick response, so I have decided that before I go home on a Friday evening that I would rate the responses as high as possible, gave all of "labview wizards" a high 5!   So, I think on that note all of us will go home smiling for the weekend. But be prepared on Monday morning for any more posts to this thread if I get hosed up anymore.

 

Thank again!

 

Kaspar

Smiley Happy

 

Regards,


Kaspar
Message 13 of 21
(1,760 Views)
You can make shots of part of your code with the Starware-screenshot maker, select the part you want to save and do the magic.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 14 of 21
(1,744 Views)

Hello,

 

 Ok, its Monday morning and I have questions. I have tweaked my code to use a for loop instead of a while loop. here is the latest picture from imageshack      (for some reason when I insert the thumbnail for forums link, I cannot see the picture).  The purpose of the code is to go thru a loop 8 times (because I want to update a unsigned byte) and do the following each time thru the loop...

  1. Read a binary value (logic 0 or a logic 1) from a hardware device.
  2. Update an array with the current value of the hardware value each time thru the loop.

 I have initialized the a 8 element array of zeroes and intended to use the "replace array) each time I go thru the loop to update array with the current hardware value.

Regards,

 

 Kaspar

 

 

Regards,


Kaspar
0 Kudos
Message 15 of 21
(1,705 Views)
Hi Kaspar,

your picture...

why don't you implement what smercurio has proposed? It does what you need...
You still don't use a shift register to keep values from one iteration to the next!

And my 2 cents:
1) You don't need this sequence structure - dataflow is ensured by the visa resource name (there should be an error cluster to use as well!).
2) Loop Counter should be an I32 - use right-click -> Create control/indicator on terminals to get indicators with correct datatype!

Message Edited by GerdW on 06-04-2007 03:24 PM

Message Edited by GerdW on 06-04-2007 03:25 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 21
(1,698 Views)
You still forgot the shift registers! Put them on the loop and put the updated array outside the loop.
Message 17 of 21
(1,691 Views)

Hello,

  Sorry for not using the shift register, I have added them and have moved the updated array outside of the for loop. I have enabled highlighted execution and have used probes to observe the data coming from the hardware and the loop counter. The hardware data is always high and the updated array after the loop is zeros.  Here is the updated code

 

 

  

Regards,


Kaspar
0 Kudos
Message 18 of 21
(1,679 Views)
Clean up your wiring around the replace array subset just to make sure the output of replace array subset is going to the shift register on the right side of the loop. I can't tell if it is, and if it isn't you will still have a problem.
Message 19 of 21
(1,677 Views)

Hello,

  I hosed it up, I updated my code very quickly and had the wrong connection to the updated array. I have tried it out and in the first test case it appears to work the way I want it to. Thanks for the help!  Here is the update code picture

 

Have a great day! The Labview wizards on the forum are great...I always rate their answers with a 5 every time I get a response to something I have posted on the forum

  

Regards,


Kaspar
0 Kudos
Message 20 of 21
(1,664 Views)