Squarewave generator (sim only)

A forum where Flowcode v6 user created components can be shared, discussed and reviewed.

Moderator: Benj

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Squarewave generator (sim only)

Postby JonnyW » Tue Sep 10, 2013 10:13 pm

This component generates a square wave during simulation.

Time interval is in milliseconds and approximate (to about 10ms).

The source for this is here, export as a fcpx file to your components folder to include - it will be in the misc category:
squarewave.fcfx
Source code
(10.65 KiB) Downloaded 298 times

A demo of this (just an empty loop) is here:
SquareWave_Test.fcfx
Example
(4.23 KiB) Downloaded 254 times


Open the Data Scope (Menu->View->Scope) to see the wave during simulation.

squarewave.png
squarewave.png (28.49 KiB) Viewed 5623 times


Jonny
Attachments
squarewave.fcpx
Compiled
(1.55 KiB) Downloaded 242 times
These users thanked the author JonnyW for the post (total 2):
medelec35 (Tue Sep 10, 2013 10:47 pm) • acestu (Fri Sep 13, 2013 12:00 am)
Rating: 10.53%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: Squarewave generator (sim only)

Postby medelec35 » Tue Sep 10, 2013 11:09 pm

Hi Jonny, added component (thanks for posting :) ) to components directory.
Unfortunantly component won't add to Dashboard panel:
Failed to add.png
Failed to add.png (38.11 KiB) Viewed 5617 times

Also when loading

Code: Select all

SquareWave_Test.fcfx

the following message is displayed:
Failed to open.png
Failed to open.png (19.34 KiB) Viewed 5617 times

Then Flowcode closes.

Edit:
Same thing happens when trying to open squarewave.fcfx
Flowocde shows failed to document (array not found ) then closes.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: Squarewave generator (sim only)

Postby JonnyW » Wed Sep 11, 2013 9:49 am

Hi. Sorry Martin!

I have been adding multi-dimensional array support, so the 'array' attribute of variables has been removed and added as a tag list instead. I didn't think about this as I did it a couple of days ago, and this will work with the next patch, but anything I output now will have this issue.

Very sorry again for this, its a good point - I better not roll this out around the office until a patch is out!

EDIT: I have modded the executable to output temporarily backwards compatible files, and the above attachments should work OK now.

Jonny
These users thanked the author JonnyW for the post:
medelec35 (Wed Sep 11, 2013 10:37 am)
Rating: 5.26%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: Squarewave generator (sim only)

Postby medelec35 » Wed Sep 11, 2013 10:37 am

Hi Jonny,
JonnyW wrote:Very sorry again for this, its a good point

No worries, it does not matter to me if it does not work at first since it's trial and error.
So long at it works in the end.

Thanks for reposting files.
Unfortunately its still not working for me.
I have added only the the latest squarewave.fcpx
Flowcode now opens, but the red square waveform is missing from component that's on the System panel.
The connection is missing from the scope.
When trying to add the squarewave component I get failed to add etc.:
Squarewave.png
Squarewave.png (83.11 KiB) Viewed 5605 times


Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: Squarewave generator (sim only)

Postby JonnyW » Wed Sep 11, 2013 12:19 pm

OK, must still be somewhere else I have changed the component, or not compiled/uploaded it correctly.

I will ensure this is done properly and works 100% in the next patch, should be today or more likely sometime tomorrow.

Jonny
These users thanked the author JonnyW for the post:
medelec35 (Wed Sep 11, 2013 12:26 pm)
Rating: 5.26%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: Squarewave generator (sim only)

Postby medelec35 » Wed Sep 11, 2013 1:17 pm

Thanks Jonny,
Will wait for the patch.


Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: Squarewave generator (sim only)

Postby medelec35 » Wed Sep 11, 2013 6:40 pm

Hi Jonny,
Just an update.
When I got home, I loaded squarewave.fcfx
changed Type of macro to simulation
Created component.
Now it works perfect!
I got it to trigger int interrupt on portB.
Waveform is showing correctly on the simulation scope, and number of detections showing on LCD is increasing as expected at the correct interval.:
Squarewave works.png
Squarewave works.png (75.77 KiB) Viewed 5583 times

I have altered the interval to 200ms so it will look a bit different to your scope.
Some tweaks may be necessary in the finished version, but overall very happy with the generator so far.
Big improvement over Flwocode V5

So Thanks again for what you have done :)

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 64 times
Been thanked: 306 times
Contact:

Re: Squarewave generator (sim only)

Postby JonnyW » Thu Sep 12, 2013 9:08 am

Hi Martin, good news.

There was a bug in Flowcode where it was only compiling the properties in a certain order, so I couldn't add to that version what I wanted, which is a general purpose generator. If you add a list of features you wuld like to see, I'm sure we can sort something.

Jonny
These users thanked the author JonnyW for the post:
medelec35 (Thu Sep 12, 2013 10:20 am)
Rating: 5.26%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8536
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2456 times
Been thanked: 3525 times
Contact:

Re: Squarewave generator (sim only)

Postby medelec35 » Thu Sep 12, 2013 10:20 am

Hi Jonny Thanks.
Here is my list:
On duration
Off duration
selectable Period Time or Frequency
Keys to press for Start, Pause, Continue and Stop. (Perhaps selectable from dropdown list?)

Hope I'm not asking for too much?
Also if anyone else would like to post on this thread what functions they would like to see that would be helpful.

Re scope.
I would like scope to show what pin is being used and if possible a x time scale perhaps in milliseconds?

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.