12-22-2014 05:12 AM
hello,
Here i have a trouble when passing an element from an array to a serial port.
What should the VI do?
1. Firstly tha values are stored in an array.
2. So, now the array have the data that has to be send serially through serial port(RS232).
3. Now, the data in the array has to be send in a sequence (one by one), and once an element is send serially it has to w8 till it recieves the acknowledgment that it is recieved and then the other element has to be sent.
Here, i'm able to store the elements in an array, but while retreiving the data from array serially i'm facing a trouble.
So, please suggest me with a solution how to retreive data from an array in a sequence.
12-22-2014 07:58 AM - edited 12-22-2014 07:59 AM
How are you sending the data to the serial port? The screen shot does nothing to help us. We need to see that part before any of us can make any reasonable suggestions.
Also, load your VI, not a screen shot.
12-22-2014 09:22 AM
Just sounds like a second FOR loop to me. The real question is how should the data be formatted. You are currently making an array of I32, which has 4 bytes per element. Are each of those bytes supposed to be sent one at time?
12-22-2014 09:30 AM - edited 12-22-2014 09:31 AM
You have one issue with your code.
You have a race condition. The Numeric control is read before you write anything to it.
This means that you numbers that you store in the array might not be what you think or hope.
And while we are at it, why do you have 2 x Wait(ms)?
I can't see the reason for having the for loop.
And for the multiple boolean controls, can the use select more than one at the same time?
If not, then use a radio button and place that into an array. Then you can make 6 selections before runing the code, and you will get the array you need.
12-22-2014 12:53 PM
Looks like you are trying to accomplish this.
12-22-2014 09:18 PM
@tejaphani wrote:
it has to w8 till it
You've recieved a lot of good advice already. Normally I wouldn't post. But, I wanted to point out you're on a big kid forum. Please use your big kid words here. "Wait" isn't a difficult word to spell out rather than use obnoxious texting shorthand.