Gents,
A quick one on the circular buffer. Does the FlushBuffer command simulate?
It appears not to do anything to the Circular buffer tab information in the console. Is this normal?
best
Pete
Circular buffer - FlushBuffer command
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Circular buffer - FlushBuffer command
Hi Pete,
For efficiency the flush command simply resets the read and write pointers, the contents of the buffer are unaffected so this is probably what you are seeing. I suppose for simulation I could also scrub the data if this would make things more obvious.
For efficiency the flush command simply resets the read and write pointers, the contents of the buffer are unaffected so this is probably what you are seeing. I suppose for simulation I could also scrub the data if this would make things more obvious.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
Re: Circular buffer - FlushBuffer command
Thanks,
edit... forget below...I just re read your note... thats the way its designed!... dont bother changing the simulation...I will read out all of the data...
Got it.. was that supposed to be the design? - reset pointers and leave data in the buffer?
I will check again but the data still seems to be in the Circ buffer ie i can read it
best
Pete
edit... forget below...I just re read your note... thats the way its designed!... dont bother changing the simulation...I will read out all of the data...
Got it.. was that supposed to be the design? - reset pointers and leave data in the buffer?
I will check again but the data still seems to be in the Circ buffer ie i can read it
best
Pete
sorry about that Chief!
- AbhijitR
- Posts: 300
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 284 times
- Been thanked: 80 times
Re: Circular buffer - FlushBuffer command
Hello! Ben
good afternoon
In other case if it is not possible is there any other way to clear the buffer so it will be blank to receive next data.
I am using this component for the first time and it is indeed very helpful.
Thank you.
Abhi
good afternoon
May i request you if it is possible and the upgrade of component allows, to add one more option/command for this component, FlushBuffer which will absolutely clear the buffer and ResetBuffer which will rest the pointer.
In other case if it is not possible is there any other way to clear the buffer so it will be blank to receive next data.
I am using this component for the first time and it is indeed very helpful.
Thank you.
Abhi
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Circular buffer - FlushBuffer command
Hi Abhi,
This should not be required. If you flush the buffer then the buffer is effectively empty and available to receive more data.
Make sure you use the GetNumberBytes macro to check the contents of the buffer before reading out data and then you will be sure you won't be reading out old stale data.
If you do need to flood the buffer with a known value then you can do this by adding that value in a loop for the buffer size number of times. Then flushing the buffer. But as I say this shouldn't be required.
This should not be required. If you flush the buffer then the buffer is effectively empty and available to receive more data.
Make sure you use the GetNumberBytes macro to check the contents of the buffer before reading out data and then you will be sure you won't be reading out old stale data.
If you do need to flood the buffer with a known value then you can do this by adding that value in a loop for the buffer size number of times. Then flushing the buffer. But as I say this shouldn't be required.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel