06-21-2011 03:38 PM
At all,
thanks for the help, some more questions, like i saved byte by byte data to the file, how do I write BYTE-BYTE into the uC?
The uC that I have has a recieve buffer of only 1 byte, so I have to make sure that I send only 1 byte from my labview program.
Can anyone please help on this/?
Thanks again
06-21-2011 04:40 PM
I think i have to explain more about this,.. suppose i am sending time string to uC. Now, The time string is what 16-17 bytes long??? how do i
send this string byte by byte to a 1-byte long uC buffer??
06-22-2011 11:13 AM
does anyone has a solution to this yet??
06-22-2011 11:20 AM
A couple different methods have been posted in the past. Here is one.
06-22-2011 11:21 AM
What are you hoping to do with the LabVIEW time string at the uC end? As to the string's length, it would depend on the format of the string, but you can determine the string length easily, there is a function in the string pallette for that. If you can describe exactly what you are trying to do with the time string it will help, and in my case explaining to another frequently gives me the answer.
06-22-2011 11:36 AM
LV_Pro, i would like to tell the uC what the current time is from my Labview UI, so that once i disconnect the uC from my serial port, the uC prog has a track of the REAL-WORLD time.
I noticed that the time string is 21 bytes long (just read from the "return count" option in the VISA Write.vi
some more observations,
Same thing is happening when I send the "AB" string. I read only 'A' in my RXBUF and the overrun error flag is high.
Basically, my problem NOW is sending BYTE by BYTE data to the uC through labview. I tried the 'for' loop approach, but that is not working out...
06-22-2011 05:10 PM
hello everyone, i still haven't figured out how to get my job done!! can any1 please help?
:mansad:
06-22-2011 05:36 PM
No place in that image are you sending one byte at a time and no place in that image is the example I linked to. You appear to be just making things up as you go instead of trying a proven solution. The for loop you have is not correct at all. You are converting to multiple bytes and each byte is incorrect.
06-22-2011 05:38 PM
It makes sense that you are only seeing the first character since it is only a 1 byte buffer; however, could your problem be with handshaking? How is the data being transferred? You may need to enable handshaking since you don't have an infinite buffer to work with. The serial port is going to burst out those 23 bytes of data to your uC without care whether it receives it or not. With most systems, this is not a problem with small bursts, but in your case, it may be. You stated you can echo the characters back. That shouldn't be a problem since your uC is acting in loop-back, so handshaking won't be necessary. But in standard receive mode, you can only send one character at a time.
You should revisit the For loop idea which was suggested earlier I believe and try to implement some form of handshaking from your DCE to your PC. You may be able to get away without using handshaking if you slow it down a bit to ensure no over-runs. Just some thoughts.
06-23-2011 03:18 PM
@All, I figured out what the problem was.. it was not in the LABVIEW program, but in the uC code which I wrote...
Everything is sorted out except one... When I send data from Labview, there is not a fixed no. of string length which I would liek to send... So, i think the optimized way to write the software in uC would be to recognize if Labview is sending any more bytes in the buffer or not...
so, my question is, is there a way though which I can mark an "end of data" stream byte or send such a byte in labview?
thanks,...