05-18-2014 02:36 PM
Hello!
Please don't eat me all,its my first post and i am verry beginner in LV
I want to build a test station for pcb boarb, but i tryinng to solve problems on projecting stage, so this part of VI is responsible for receive data from rs232 (8 bytes) and what i want to do as a next step is interpretaion of it. So i configure that i will connect iteration counter to index from array and then i will read element which iteration (indexing) will show, but i cant do it this way, propably because one is indicator and other control, what is easiest solution for it?
05-18-2014 03:35 PM
If you want a random index, you don't need a FOR loop. (you already do that in the upper part.
If you want to process one element at a time, autoindex the array at the for loop boundary and it will show one element per iteration in order until you run out of elements. Place a small wait inside the loop to see them in succession (without wait, things happen too fast to see).
05-18-2014 04:19 PM
I need to check all bytes from that 8byte data, becouse first one is adrees of device secound and third i value o measured value and so on so how to that? I have some expirience from C and i tought that for loop will be the best solution but how to conect it?
05-18-2014 04:37 PM
Take the 8 byte array and just wire it into the for loop. The array will "auto index" on the boundary and just be a single byte to do your interpretation inside the for loop.
or you can do it manually and right click were the data enters the for loop and disable the auto indexing. Then use index array and wire the iteration counter to the index terminal of the index array.
05-19-2014 02:41 AM
I tryied to do exacly te same but with unsigned array and it failed (as i show on attachment) but when i come backe from work i will try to do it with 8byte array,when you say connect it with for loop you mean iteration sign inside the loop or just the edge of loop?
05-19-2014 03:26 AM
@kozaczi wrote:
(as i show on attachment)
Where?
I really recommend to first get familiar with the basics of LabVIEW. Start with a few tutorials.
05-19-2014 07:15 AM
05-19-2014 08:46 AM
Yeay i know that, that picture is not correct (two index imputs) but if i connect only internal iteration value from loop as a index to array, wire is still broken as it is on picture below
05-19-2014 09:16 AM
Of course. Open the help window and then move your cursor onto the broken wire. It will tell you that you have a mismatched data type.
Coming out of your for loop is an array of 0 to 7. You are sending this in as an index to the array index function. Making an array as your index makes no sense.
As Christian and I said. GET RID OF THE INDEX ARRAY FUNCTION. Wire your array into the for loop. Have the for loop auto index the arrary. Do NOT connect the for loop index to anything.
Inside the for loop do what ever you need to each byte of the array.
05-19-2014 09:27 AM
I know that this is not proffesional way to do that, but pararell solution as it is on the picture below is ok for me, so how it should looks wit for loop exacly?