Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert 80000 bytes of data received via serial port into 10000 sets each having 8 bytes

Highlighted

Hi

  I am having a serious problem, We have a gas chromatogram(GC). It supports serial communication.

 

Before going into the problem, I want to tell you that I'm using crio 9012 controller. I having NI 9870 serial port module.

 

So getting to the problem, I have connected the GC to the serial port. If I write "BS" command to the serial port, the GC will respond to it by Sending around 80,048 bytes of data.

 

Now what I need to do is Skip the first 10 bytes and divide the rest of the bytes(80,040) into sets of 8. ie., I need to have 10,000 sets of data each having 8 bytes in it.

 

The reason why I need to do this is because after the first 10 bytes, I need only the 4th,5th & 6th byte of the next 8 bytes to follow. I have to collect this data from all the 10000 sets.

 

Also I need to know whether it is a good idea to store the data in 10000 sets and then process it is possible,If so how to implement it or what are the other ideas i can use.

 

Kindly help me out..

 

Regards

Temin

0 Kudos
Message 1 of 2
(2,426 Views)
Highlighted

Hi Temin:

 

What do you have working so far?  Do you have code written to at least read data from the module?  If so, how are you doing it and are you just reading to the FPGA or are you transferring the data to the Real-Time (RT) controller through a DMA FIFO?

 

My recommendation would be to write your FPGA code to discard the first few bytes of data (just don't pass these first few bytes into the DMA FIFO).  Once you have read the data on your RT controller using the DMA FIFO, use array manipulation to split the data as needed.  There are a lot of array functions that should make this pretty easy once you have all of the data.

 

Again, let us know where you are currently and we'll try to help you out.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,397 Views)