thanks for all replies..i think im not explaining enough on what im doing..sorry for that
actually, i want to create vi which will read the data from another program using serial port..means my input here come from another write program
so here im just assign my tags as 1111,2222,3333... but i'll change it after this according to what is needed..for example maybe 00FE,00AF,01FE or something else and definitely it is in hex..then the value for each of this will also come in hex and be sort in the table as a decimal value like what have been done
other thing is i want to remove the add button so that every read data will automatically put into the table..this mean if i write continuously and sent it to this vi. it will read the data continuously and update the value in my table until i stop it..is it clear enough?
Well, by now you should have enough information to do all that.
Here's a quick draft how you could built the table in a subVI. First we initialize the tags then we generate fake data and write it to the existing table data as it is received. (Note that you can write to, and read form the subVI from different places if needed).
It definitely needs work, but should give you some ideas.... Good luck!
How much data are we talking about here? How big does the table typically get?
thanks altenbach..i'll keep it as my reference =)
for now i use your 1st vi. and make some minor change to it
btw, is there any way to remove the add function so that my input will automatically insert into table as the program run and the input is inserted?
my motor controler will send this kind of data continuously through serial port..so i want this vi to grab it and store it accordingly in table continuously too until the program stop
Quick and dirty solution:
Can we assume that the size of the received string is quantized into multiples of four bytes? In this case:
No, not a local variable. A value(sgnl) property node.
Your left loop spins millions of times per second, even if it executes the FALSE case, doing nothing but burning CPU cycles. Thus you need a small wait to slow it down to a resonable loop rate and thus allow other processes a fair chance to run too.
Most likely you need to buffer the arriving bytes and only hand them to the processing loop in multiples of four. Try it.