Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

rs232 stream analysing/conversion - i think

Hi

 

New to the forum but all my google searches kept pointing me to this forum. so i hope someone can help me on here.

 

Outline

 

I have a piece of hardware/software sending data streams below

 


SB       MT    MST    SN    BN    DN    FN    AN    WN    SB    SB    
    
{STX}    02    01    01    02    00    00    44    1    0000    {EOT}
{STX}    02    01    01    01    00    00    43    1    0000    {EOT}

 

What i need to do is capture these data streams and then convert and spit them back out of another serial port without the FN value in the string.

 

The SN & BN string as upto 18variables but the FN string when times by the amount of other variables would leave us with 9000 combinations of strings.

I need to be able to truncate this as the recieving software/hardware only supports capturing 1500 combinations.

 

If any one as any ideas it would be a great help

 

Thanks

0 Kudos
Message 1 of 6
(3,470 Views)

This can be a very interesting problem.  I would use multiple loops to handle this.

 

First loop:  Read the data from serial port 1 or wherever it is coming from.  Take this data and put it into a queue for processing.

 

Second loop: Read data from the queue from loop 1.  Append data to data already have.  Search for the STX.  If not found, throw it all away.  If found, grab the number of bytes needed, delete the unwanted byte, and send the new command into another queue.  Save any data you still have after the command to be appended to the next iteration.

 

Third loop:  Read the command queue from loop 2 and write out of serial port 2.

 

I broke this out because you need that data processing to go as fast as possible.  This is a variation of the Producer/Consumer architecture.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,461 Views)

Hi

 

Thanks for the quick response, i have had a read through the white paper, ive never used labview and i think it might be to complicated Smiley Frustrated

 

Is it simple to achieve?
 Where do i start Smiley Very Happy

 

Thanks for your help

0 Kudos
Message 3 of 6
(3,457 Views)

What programming language are you using? That's pretty important information to include in any question. What serial API? That too is important.

0 Kudos
Message 4 of 6
(3,452 Views)

This can be complicated.  I guess the first place to start is do you know how to communicate over the serial bus with the VISA functions?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,450 Views)

@Dennis_Knutson wrote:

What programming language are you using?


Oh, Dennis...constantly reminding me there's more than LabVIEW...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,447 Views)