01-24-2013 12:31 PM
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
01-24-2013
01:42 PM
- last edited on
05-09-2025
02:03 PM
by
Content Cleaner
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.
01-24-2013 01:59 PM
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
Is it simple to achieve?
Where do i start
Thanks for your help
01-24-2013 02:25 PM
What programming language are you using? That's pretty important information to include in any question. What serial API? That too is important.
01-24-2013 02:26 PM
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?
01-24-2013 02:27 PM
@Dennis_Knutson wrote:
What programming language are you using?
Oh, Dennis...constantly reminding me there's more than LabVIEW...