LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indicator as control (iterationio counter as index number)

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?

 

 

0 Kudos
Message 1 of 20
(2,746 Views)

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).

0 Kudos
Message 2 of 20
(2,725 Views)

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?

0 Kudos
Message 3 of 20
(2,709 Views)

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.

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 4 of 20
(2,704 Views)

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?

0 Kudos
Message 5 of 20
(2,674 Views)

@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.

0 Kudos
Message 6 of 20
(2,658 Views)

You have two different values for the same thing.  The input "index" and the internal for loop index.  If I have 500 as the input on the index when I enter the loop the iteration counter is 0 to 7 for the 8 byte array.  What is the value?  500 or 3?  Your program is using both values for the same wire.

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 7 of 20
(2,637 Views)

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

0 Kudos
Message 8 of 20
(2,626 Views)

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.

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 9 of 20
(2,618 Views)

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?

0 Kudos
Message 10 of 20
(2,612 Views)