06-18-2015 02:30 AM - edited 06-18-2015 02:30 AM
Dear all,
I have to read 2 number from an rs232 and everything is working, but what i wanna do is to put the 2 numbers next
to each ohter when i press a button, the numbers appaer in the table the first time the are in the good positio but
than no more:
should be like that:
12 13
28 41
ech time i press the button the numbers should appearon te next line
i made something but is does not work correctly, can someone help me
to find the solution.
Many thanks in advantage
Solved! Go to Solution.
06-18-2015 07:07 AM - edited 06-18-2015 07:07 AM
1. Get rid of that FOR loop. It is not doing anything for you.
2. You should create a 1D array of your two numbers and then append that to your table data.
3. I highly recommend keeping your table data in a shift register. It will make your process A LOT more efficient.
06-18-2015 08:12 AM
thx a lot its working great !!!!!!!
06-18-2015 08:29 AM
@drek1234 wrote:
thx a lot its working great !!!!!!!
I don't see any thanks! Thanks should be given with Kudos and Marked Solutions.
06-19-2015 03:10 AM
damn 🙂 still something wrong, the numbers are next to each other but they keeps coming
first it should be like:
when a pusch a button
12 80
then if i pusch the button again the new numbers might appaer:
100 120
and so on
dont be to hard im a beginner 🙂
greeting and thanks
06-19-2015 05:51 AM
06-19-2015 06:11 AM
ok going to read about event structures, mihgt be a good tip
if im trying something and it does not work ill post my block daigram here
thanks
06-22-2015 01:35 AM
So i tried the event structure, and this is what i made, it works might be not as others do but im new to it.
While running the program an do empty table and import new values the old values after empty table
appaers again ( strange), what i also tried is data operations make current value default but does not work,
can someone help me ?
06-22-2015 03:01 AM
06-22-2015 07:35 AM - edited 06-22-2015 07:36 AM
Your code should look something like this. Remember that the event structure will keep your loop from iterating until it handles an event. So you want everything you want to happen when you press that button to be in that event case. You cant' see it directly in this snippet, but I am also handling the Stop button's value change event and using that to tell the loop to stop. You alos need to make sure your array is passed through all of your cases or you can lose your table data.