03-08-2016 10:48 PM
Hi,
I need a help to "process the serial Hex data" serial data rate is 250ms.
I am able to read the serial data and right now, we have the Concatenated Hex string but not able to Spit this string the modify and write again.
Each 250ms i get new data frame,data frame length is 1st frame 13bytes, 2nd frame 17bytes and 3rd frame 17bytes * no of module.We are develope the application to change the perticular bytes of each frame and send it again.
Mach pattern,Replace pattern all string find and replace fundamental tried not working.
Please help.
03-09-2016 04:49 AM
Where is the data coming from? Is there anything in the frame to indicate what the frame is? Is there a start character (often 0x2)? Is there a checksum to make sure you read the frame right?
03-09-2016 09:42 PM
Hi,
Yes,each frame having multiple CRC and Total frame also having stating and end frames and each frame having the start & end bytes.Please look into the attached Description.
03-10-2016 05:23 AM
The way I see it, we first need to synch up to the 7F18. Once you find the 7F18, you know how many characters are in a line and you know how many lines are to follow. So you can just read that number of bytes once you get synched up. You could do the synching in a simple loop that just reads 1 byte at a time. Compare the previous byte and the current byte to 7F18. Once you have a match, read 11 more bytes to complete that line. If you want to make sure, you should also perform the CRC check in that line.
03-10-2016 08:44 PM
Hi,
Thanks for your valuable suggestion but we are tried all possible scanrios with "Match & Replace string" Or "Replace string" Or "Split String" but data from serial port is so fast replace,match loop is not able to execute.Output of all is showing blank.We get the 1 frame of 250ms,in that 1st subframe 7F18 to 7F22 then no. of 7F22 to 7F22 subframe and last frame is 7F20.Please find the attached different VI.
03-11-2016 04:45 AM
I immediately see 2 really big issues.
1. Since you are dealing with binary data, turn the Termination Character off. There is a boolean input on the Configure Serial Port to do so. It is on by default.
2. Your VI is running slow because you have a constantly growing string. Once you find a frame, remove it from the string that you are storing in the shift register.
03-11-2016 04:50 AM
Hi,
Would you please make the chnages and share to me?
03-11-2016 05:33 AM
I thought about this way too much...
This should get you started for getting the frame itself. I have not tested it at all.