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

Lagoda
Posts: 149
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 62 times
Been thanked: 59 times
Contact:

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

Postby Lagoda » Sun Feb 25, 2018 2:52 pm

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 34 times
False Pulse Time.jpg
False Pulse Time.jpg (105.72 KiB) Viewed 1553 times
Incorrect Time Diagram.jpg
Incorrect Time Diagram.jpg (138.56 KiB) Viewed 1553 times
Last edited by Lagoda on Mon Feb 26, 2018 6:04 pm, edited 1 time in total.
These users thanked the author Lagoda for the post:
Benj (Mon Feb 26, 2018 11:22 am)
Rating: 5.26%
 

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

Re: Bug in the Data Recorder

Postby keithh534 » Sun Feb 25, 2018 6:11 pm

I'm experiencing the same issue with PWM coding.

User avatar
Benj
Matrix Staff
Posts: 14247
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4370 times
Been thanked: 4104 times
Contact:

Re: Bug in the Data Recorder

Postby Benj » Mon Feb 26, 2018 11:26 am

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?
These users thanked the author Benj for the post:
Lagoda (Mon Feb 26, 2018 4:19 pm)
Rating: 5.26%
 

Lagoda
Posts: 149
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 62 times
Been thanked: 59 times
Contact:

Re: Bug in the Data Recorder

Postby Lagoda » Mon Feb 26, 2018 4:21 pm

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: 14247
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4370 times
Been thanked: 4104 times
Contact:

Re: Bug in the Data Recorder

Postby Benj » Mon Feb 26, 2018 5:19 pm

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.
These users thanked the author Benj for the post:
Lagoda (Mon Feb 26, 2018 6:01 pm)
Rating: 5.26%
 

Lagoda
Posts: 149
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 62 times
Been thanked: 59 times
Contact:

Re: Bug in the Data Recorder

Postby Lagoda » Mon Feb 26, 2018 5:59 pm

Hello Ben,

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

Lagoda
These users thanked the author Lagoda for the post:
Benj (Mon Feb 26, 2018 6:22 pm)
Rating: 5.26%