Bug in the Data Recorder (SOLVED:Use the Data Recorder in ICT mode)

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Bug in the Data Recorder (SOLVED:Use the Data Recorder in ICT mode)

Post by Lagoda »

Hi Everyone,
I found this bug in Flowcode 7.3.0.6 during simulation.
I think the pictures say everything from the problem.

Best Regards,
Lagoda
Attachments
counter_test.fcfx
(7.61 KiB) Downloaded 208 times
False Pulse Time.jpg
False Pulse Time.jpg (105.71 KiB) Viewed 4286 times
Incorrect Time Diagram.jpg
Incorrect Time Diagram.jpg (138.56 KiB) Viewed 4286 times
Last edited by Lagoda on Mon Feb 26, 2018 6:04 pm, edited 1 time in total.

keithh534
Posts: 55
Joined: Thu Nov 23, 2017 12:21 am
Has thanked: 15 times
Been thanked: 12 times
Contact:

Re: Bug in the Data Recorder

Post by keithh534 »

I'm experiencing the same issue with PWM coding.

User avatar
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: Bug in the Data Recorder

Post by Benj »

Hi Lagoda,

I just tried your program here, you have a delay of 1ms and the data recorder shows a delay of just over 3000us or 3ms. This is due to the way Windows does timings and the simulation will never be as reliable as the timings on the real world microcontroller.

The timing function of the data recorder is therefore much more reliable when used with Ghost ICT data rather than simulated data as the timings are much more accurate for ICT data as the pins are sampled on a regular and reliable interrupt tick.

Hi Keith,

PWM waveforms are not currently simulated and so won't appear on the data recorder in simulation. Is this the problem you are having?

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bug in the Data Recorder

Post by Lagoda »

Hi Ben,

Thanks for the reply.

I'm sorry that the simulation does not provide a reliable result in this case.
For 100 us, 10us, and 1us delay, the pulse width measured on the RC0 pin is 0.53us according to the simulation.
Is this the same reason?

Best Regards,

Lagoda

User avatar
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: Bug in the Data Recorder

Post by Benj »

Hi Lagoda,

Windows provides a 10ms tick time as the absolute minimum amount of timing if you allow the application to hand back to the OS for the delay. Windows is nothing like a real time operating system and this 10ms tick can often become hundreds of milliseconds, nothing is guaranteed.

We therefore use a guestimate to allow the simulation to drive itself timing wise based on the speed of your processor but this is made more difficult because modern CPUs throttle up and down during operation to save power. Combine this with threading complications and you have a right headache.

I don't really know all the ins and outs as my expertise lies in the microcontroller and circuit side of things but I do know we have tried several ways to provide a nice stable and responsive simulation. From what you're saying it looks like microsecond delays may simply not simulate or provides a fixed number of no operations.

Out of interest can you provide some specs on your computer, OS, CPU, etc.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bug in the Data Recorder

Post by Lagoda »

Hello Ben,

I understand the cause of the problem.
Thank you again for the answer.

Lagoda

Post Reply