FC7 - Component Creation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

FC7 - Component Creation

Post by johnsondav »

Hi Everyone

I have been trying to get to grips with the process of - 'Component Creation'.

What I would like to do, is produce a Step-by-Step guide for others to follows. My thoughts are, if someone makes a start, others will follow. But, this will only be true if there is something for others to look at and then add to.
So far, I have built a working RF TX & RX using those very cheap 433MHz modules.

http://www.nyplatform.com/index.php?rou ... uct_id=800

So far, I have only got as far as producing the FC7 component for the transmitter. I would like some constructive critique from anyone who would like to get involved. The transmitter module is configured to output:
- sync pattern for the receiver to detect
- actual data (either single byte or maybe a simple packet data)

The receiver, when synced, checks for matched data and then turns an led on or off - like a remote switch.

Simple I know, but the point is all about getting the FC7 components made correctly.


So here is my FC7 component for the transmitter:
RF_ASK_TX.fcpx
(2.08 KiB) Downloaded 306 times
Here is the Component Project that produced it:
RF ASK 433MHz Ver2.fcfx
(17.2 KiB) Downloaded 332 times
Here is the Project for the receiver to detect the transmitted data:
RF Test 1 PIC18F4550 Reciever.fcfx
(15.96 KiB) Downloaded 333 times
You will notice, the receiver will check in coming data for the correct sync pattern before extracting the actual data sent. If correct, it will turn on the led. Its very basic, but it works well enough to get me started with creating a FC7
component. I have used two different chips, just to make sure the produced FC7 component works across devices.

The RF_433MHz_TX component uses just one pin of the the base component - RS232. So, I wanted to see what was possible when designing my component from the base component.

Like I said, its very early days, so if anyone is interested, I just wanted to see if what I am doing so far is any good.

Your thoughts please.

Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Please Note!

Do not store this component in your main FC7 component folder. I would recommend you save the component somewhere else and use the 'Global Options' under the 'View' menu to set where FC7 should look for your components as shown here:
Global Options.jpg
Global Options.jpg (142.29 KiB) Viewed 11574 times
Better than messing things up just yet.

Dave

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: FC7 - Component Creation

Post by Benj »

Hi Dave,

For me the Channel, Baud and TX pin property changes are not being passed into the CAL UART component. You can test this by making a change to the panel properties and then checking the CAL UART component.

Looking at the code in the Ev_Property macro I can't see why this wouldn't be working. Maybe it's just me. I keep being distracted today with meetings etc so not 100% sure.

However in Flowcode 7.2 property copying became a whole lot easier and may mean you can get rid of the Ev_Property macro and Property change event all together.

This Wiki page details the 7.2 changes, the part you will be interested in is the Exposing Properties part. This saves you having to copy values back and forth and allows you to better support devices with advanced re-mappable UARTs etc.
https://www.matrixtsl.com/wikiv7/index. ... t_Features

I would also expose the RX pin as it could be a pain in software mode or in hardware remap mode to have it set to a none available pin, as both cases will likely cause a compile error.

To add more polish to your component double click the Begin icon of each of your macros and add a description of what the macro does. While you're in the edit macro details dialogue you should also double click any parameters and create a tool tip in the description box. e.g. what the parameter does and what values are acceptable.

For example.
Comms.jpg
Comms.jpg (71.32 KiB) Viewed 11561 times
There is another description field under the File -> Component Configuration menu which allows you to add a tool tip when hovering over the component on the component tool bar. This can be used to tell you what the component does and it's limitations etc.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Ben

Thank you for your suggestions, much appreciated. I have got the RF_TX component working and added some info to each of the MACRO's. Well, I think I have added the helpers to each of the macro's in the correct place.

I have included the RX pin as suggested, this will allow both transmitter and receiver to be attached to the same chip making a transceiver. Trouble is, how to set up the receiver macro with the correct sync pattern - working on this now.

Here is the amended transmitter project to match the above receiver project built using the component shown below- both working, but the receiver sync pattern is only in the project, not the component yet.
RF ASK PIC16F88 Transmitter.fcfx
(12.85 KiB) Downloaded 331 times
Transmitter/Receiver Component RF_433MHz_TX
RF_ASK_TX.fcpx
(2.47 KiB) Downloaded 295 times
Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi All

I give up. Just cannot figure out how to get a 2D model/image to go with this component I have created. Nothing works, like using 'Shapes'; 'images' etc. I cannot find any help files to explain what I am supposed to do. Your 2D models, when loading your components look cool. What I get, at best, is a dot, so small is pointless.

please could you indicate if there is a bug or what I might be doing wrong.

Here is the icon - display OK
ICON.png
(44.82 KiB) Downloaded 7275 times
But the model, well!
Model.png
(21.44 KiB) Downloaded 7275 times
Help!

Dave

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: FC7 - Component Creation

Post by Benj »

Hi Dave,

If you look under the search item on the component toolbar and search for flasher you should get the component for creating the comms style gui. Just add this to your component source and maybe add simulation macro calls in your macros to flash the leds. Then when you export you should get something nicer. There are also additional options in the advanced tab of the component settings menu to set the size of the component when dragged on but these shouldn't be needed as standard.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Ben

You are a star. It works. Thank you ever so much. Question is though for another day - why, and what was I doing that prevented my images from working?

Here it is:
New Component.jpg
New Component.jpg (79.04 KiB) Viewed 11501 times
Well, now that I have a working component image that shows my component, brilliant, All I need to do now, is figure out how to get the simulation LED's to work. I wouldn't have much time to do that today, so I may be bothering someone later with more questions. Hope you don't mind?

Thanks a lot.

Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Ben

I have got my Component working now, including the Flashing LED. It was straight forward once I got it installed.

Here it is working:
Component Test.jpg
(117.24 KiB) Downloaded 7242 times
Thank you for all your help. Just need to check and start the Step-by-Step guide on how I achieved my working simple RF_ASK 433MHz component.

Regards
Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Everyone

Here is that Step-by-Step guide to building a simple RF ASK component.
Comments please, though pls keep them construction as to usefulness.
Component Creation 1.pdf
(3.41 MiB) Downloaded 345 times
I will place the project in the Forum - User Components should you wish to explore the actual project that created the component.

Dave

Ariko
Posts: 18
Joined: Tue Feb 23, 2016 10:28 pm
Has thanked: 6 times
Been thanked: 8 times
Contact:

Re: FC7 - Component Creation

Post by Ariko »

Nice work Dave

Many thanks!

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Everyone.

An update as to my progress. Well, I have been experimenting with the creation of a gLCD display based upon the EBM001 verFC6. Of course it does not work for FC7 so I re-built it (all credit to Matrix staff for the original). However, using the SPI-CAL (not bit bang - SPI much faster though). It sort of works, definitely faster. It simulates both text and simple graphics OK and downloads to a PIC18F4550 using SPI and runs the graphics but not the text(well, the text is all exactly the same rubbish no matter what the actual text is), text length is correct though. I thought the problem may be to do with the - ReadASCIILUT macro (couldn't figure out how to sort that out) so I decided to start a fresh.

Here is the part working component EBM001/ILI9163:
glcd_New_Based.fcfx
(110.69 KiB) Downloaded 214 times
However, the re-make of the same component using FC7 based gLCD component to build the same SPI attachment, does not work at all, yet looks the same to me(apart from the base gLCD). I do know you guys are very busy, but if I could get this sorted, I would very much like to do another tutorial of my efforts. Here is the component that does not work - nothing happens - no simulation and nothong happens on the chip either(PIC18F4550).
Here is the component:
Base_gLCD.fcfx
(99.85 KiB) Downloaded 203 times
It may be too time consuming to get it sorted but any suggestion as to where to look for possible problems would be very much appreciated. The whole point of this projects is simple - I will be able to change the command codes to suit whatever gLCD display is available of similar size, yes with limits of course, but I get to choose the device :D

Best regards
Dave
Last edited by johnsondav on Wed Jul 26, 2017 6:04 pm, edited 4 times in total.

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: FC7 - Component Creation

Post by Benj »

Hi Dave,

I've sent you a PM with the source for the EBM001 display. Hopefully this should help to point you in the right direction.

A helpful hint for you is that the gLCD base provides the simulation and the ASCII font data for printing strings. The component itself currently has to do the rest of the work, e.g. routines to print strings, draw lines, circles etc. Eventually I planned to move all this to the LCD base but this may mean a speed decrease which isn't at all ideal. For now things work reasonably well but have a look and see what you think.

Let us know how you get on.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: FC7 - Component Creation

Post by johnsondav »

Hi Ben

Thank you every so much. It's very much appreciated.

Here are the details of the completed gLCD display with SPI port. I have included a tutorial to help anyone with developing their your own gLCD:
viewtopic.php?f=66&t=19116

Regards
Dave

Post Reply