LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save data from COM port to file?

Solved!
Go to solution

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

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 11 of 38
(1,518 Views)

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??

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 12 of 38
(1,507 Views)

does anyone has a solution to this yet?? 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 13 of 38
(1,488 Views)

A couple different methods have been posted in the past. Here is one.

0 Kudos
Message 14 of 38
(1,482 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 15 of 38
(1,480 Views)

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,

 

  1. when i write this time-string into the RXBUF of my uC, i observe 'M' in the RXBUF(probably "M for month").
  2. However, when i echo the contents of my RXBUF to TXBUF, i see the time-string correctly into the VISA-Read.vi.

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

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 16 of 38
(1,477 Views)

hello everyone, i still haven't figured out how to get my job done!! can any1 please help?

:mansad:

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 17 of 38
(1,459 Views)

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.

0 Kudos
Message 18 of 38
(1,445 Views)

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.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 19 of 38
(1,443 Views)

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

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 20 of 38
(1,420 Views)