From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-26-2009 04:31 AM
I'm writing a vi that is parsing a fram read from the serial port in order to remove some "forbidden" characters.
It works like this: 0xC0 and 0xC1 represents BOF and EOF respectively, but might show up on other occasions.
If they do, they should be preceeded by 0x7D and have bit no 5 complemented. The same applies for the
character 7D.
This means:
C0 -> 7DE0
C1 -> 7DE1
7D -> 7D5D
The vi I'm trying to make is supposed to decode this. It's created from a for loop going through the string character
by character. For every character it reads two bytes into an array. If the first byte is not equal to 0x7D it is simply
passed on as outdata. If it is equal to 0x7D the second byte is complemented and passed on.
The problem is this: When an escape character is removed I'd like the for loop to skip ahead one step, or there
will be a missplaced extra character in the outdata. This isn't done easily
Pictures of the vi, in it's two different cases is provided.
01-26-2009 04:35 AM - edited 01-26-2009 04:36 AM
Hi Tzench,
instead of using the "i" terminal you can use a shiftregister to build your own pointer. Add one in the second case and two in the first.
Mike
01-26-2009 04:52 AM - edited 01-26-2009 04:54 AM
Hi Tzench
I hope I correctly understood your problem. You want to replace every 7DE0 with C0 etc. For this you may use the "search and replace string" function. Se picture. This will work the other way also C0->7DE0
01-26-2009 06:55 AM
01-26-2009 07:00 AM
01-26-2009 07:34 AM
Take a look at this example. Your task should not be a problem.
Good luck
01-26-2009 08:42 AM