LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

maximum data read through serial port

How many maximum data can be receive through serial port using labview??
As I using basic serial read write, i only received back 4092bytes. How am I going to collect data bytes which more 4092bytes, let say 48KB ??
Any advice?? Thx 
0 Kudos
Message 1 of 19
(6,509 Views)
You can try something like the image attatched.

A case when no data is at port
A case to append received data when there is something at port.

Hope it helps,
Aitortxo.
Message 2 of 19
(6,500 Views)
hello Simon,

In spite of using the Basic Serial, try to analyse the example "advanced serial write and read". I think that it anwsers your question.
Software developer
www.mcm-electronics.com





PORTUGAL
Message 3 of 19
(6,491 Views)

Hi guys,

Thank you for your response and help. I do able to collect the data more than 4096bytes. Just a Question to ask here, how am i going to set my buffer size??

Attach with test.jpg. Please correct me if make a mistake in my vi.

BTW, i going to collect those raw data in hex format, remove the marker and save data as .bin format. Any idea where can i get the info and links???

Thx and Regards,

Simon76

0 Kudos
Message 4 of 19
(6,459 Views)
Hey Simon,
 
Something I was curious about, is if you can specify how much you read in the basic serial write and read VI, can you just read twice at 30K to get a total of 60K of data?
 
Regards,
 
Nick D.
0 Kudos
Message 5 of 19
(6,377 Views)
Hi Nick,
From Basic Serial Write and Read vi, I only able to capture maximum data bytes of 4096 instead of 30K, so i need to modify as show in ni example, advanced serial read and write to capture data more than 4096 bytes.
Since my device return back me around 50Kbytes of audio data (based on 2 sec recording), and process data faster, i no need to read twice.
However, i still checking why i get back distorted signal.
 
Regards,
Simon
0 Kudos
Message 6 of 19
(6,364 Views)
Hey Simon,
 
To see what's going on behind the scenes, you can use NI-SPY. Just go to Start->Programs->National Instruments->NI-SPY. This will show everything going on behind the scenes. If the NI-SPY shows noise in the signal, there's a good chance it's your instrument. The reason I say that is because the signal sent across is a string of numbers. With it being a string of numbers, it shouldn't have any added noise from after your instruments taken the data.
 
Regards,
 
Nick D.
0 Kudos
Message 7 of 19
(6,344 Views)
Hi Nick,
 
I received back my hex data from serial port. From there, i need to remove out the markers and get back my raw audio data, add a audio header format and then save it as wave file or display into graph.
The problem here is i not sure whether my vi is correct to collect such a huge incoming data 48Kb (although it passing back me 48Kb of data) as i discover some missing marker/data in between causing signal distorted. The baud rate setting between my device and com port is set as 260kps.
Can i check with you, the hex audio data from port after marker removal can be direct wired to graph as shown in my attach pic??
 
0 Kudos
Message 8 of 19
(6,315 Views)
I didn't see anything wrong with your code that was obvious. Something I would recommend for troubleshooting sake. You could use NI-SPY. This is a program that monitors what is being sent to the driver. If ever your curious if information is being missing, it's good to check the driver calls, and see what information is actually being received. You can find NI-SPY at Start->Programs->National Instruments->NI-SPY
 
You may also compare your data with Port sniffer programs. There are some 3rd party programs that may be able to read what's being read on the port, and you can see if your data is missing information?
 
Regards,
 
Nick D.
0 Kudos
Message 9 of 19
(6,273 Views)

Hi Nic,

Thanks for you info. 

It's pretty hard to judge data missing or not for audio data although i see signal distorted at my final output. It really can be data loss or wrong handling data of my vi.

I have few questions here:

1) How am i going to set my buffer size, as i increase to 48000, nothing will read back.

2) Can i just wired out the data after remove marker directly to the waveform chart to get the signal?? Actually, what's the different between waveform chart and waveform graph (timing related??? ),  as i link it also to waveform graph, i see nothing.  

3) Do Labview support static library, not dll. I do have third party software (in exe and partially sourcecode) that able to handle raw data to generate audio wav file. Based on the sourcecode, i come out with own vi.  

I still in learning stage of LV, so appreciated if can show some guidance here.

Thanks and Regards,

Simon

 

0 Kudos
Message 10 of 19
(6,255 Views)