AI Code in FC - Discuss

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jay_dee
Posts: 259
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 102 times
Been thanked: 74 times

AI Code in FC - Discuss

Post by jay_dee »

Hi,
I know this is a little contentious but worth a chat. AI Code.
Firstly I explicit do NOT want AI to write the whole program BUT I'm an engineer not a coder, the reason I use flowcode is exactly because someone else has written modules of code. I then use these generic pre-built building blocks to build a solution that is very specific to my needs.

I have a contact who daily works with tools in this emerging 'AI' sector, whilst there is much hype and there will always be good and bad use cases, his view if that they should be treated the same as having a engineering assistant or external consultant working with you. You would not blindly Trust what the junior/graduate engineer has produced and Don't loose control of the project but selectively out-source some jobs.

I've used external human consultants, they spent lots of money, built what they thought we asked for but did not fully read the specification, felt documentation was over rated/time consuming and then charged even more for reworking aspects that never worked.
So humans can be just as crap as any AI. Finding good technical partners at the right price point for smaller projects when the whole budget might only be £1500 is near impossible.

If I could find a way on constraining AI to work within defined parameters maybe it could be a low cost 'partner' solve a specific function/problems in code.
>Force it to work to rules and/or define the Code style (maybe MISRA C complient for exampe)
>Meet industry defined good practice and document the code.
>Ensure it adheres to compatibility/standards of other FC modules and the result was a single module that I could call into FC.

Personally, I just don’t know how close we are to being able target AI to do this. Most free AI tools seem pretty dumb and give scatter gun results and typically ignore any guidance you give! :)

Does anyone see a future where FC would allow an AI agent into the build enviroment? The FC project would maybe help define the constraints, allow an AI produced block to be imported and maybe check is passes some FC specific validation tests.

And I acknowledge anything would be a massive block of work for the FC dev team I know!
Any thoughts fellow flowcoders?

WingNut
Posts: 286
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 56 times
Been thanked: 43 times

Re: AI Code in FC - Discuss

Post by WingNut »

I've used AI to generate programs for visual studio and arduino. Results vary and depends which one you use. My experience for the engineering world, certainly embedded is that currently the versions free to the general public are little more than sophisticated search engines and for that purpose they are pretty good and have saved me a lot of time. You have to be very specific what you ask. Ask the same question 5 times and AI seems to give 5 different answers. ALso i've found with windows programs from visual studio, it assumes you know what you are doing which is a mistake on my part :P

BenR
Matrix Staff
Posts: 2336
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 647 times
Been thanked: 856 times

Re: AI Code in FC - Discuss

Post by BenR »

Hello,

We are currently planning on Flowcode and AI. We are working on a spectrum of possibilities from doing nothing right through to full AI integration. I'm currently not sure what will come of it but we are certainly thinking hard about it and what is the best road going forward.

At the moment I have these which work well with Claude and Cursor to allow them to be able to read and write flowcode project files. It's not full integration by any means but it does allow for AI to make sense of the Flowcode file format. Throw in a few example projects (the wiki can be a great resource here) and the AI is very good at being able to make sense of the project file. Just remember to reload the project file in Flowcode if the AI has made changes to the project source.

Please note the helper docs were made using AI and so there can and will be errors :D
Flowcode AI Helper Docs.zip
(18.69 KiB) Downloaded 189 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel

ShelleyRYoung
Posts: 1
Joined: Thu Sep 10, 2026 9:52 am

Re: AI Code in FC - Discuss

Post by ShelleyRYoung »

AI integration in Flowcode could be really useful if it includes proper validation and project constraints.
Edit by geometry vibes a day ago

medelec35
Valued Contributor
Posts: 2481
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 795 times
Been thanked: 858 times

Flowcode v11 Re: AI Code in FC - Discuss

Post by medelec35 »

I've put together two reference documents on Flowcode 11 that might be useful to others here, built up over a long series of real component and app builds (custom components, PC Developer/App Developer apps, and some embedded projects along the way).

The first covers building custom Flowcode components from scratch - the real `.fcfx` XML schema, property types, the forwarded-property pattern, variable scoping rules, flowchart command syntax, child component wiring, lifecycle events, the 2D simulation-drawing components (GdiCanvas/GdiText/GdiShape), a couple of possible Flowcode bugs around TimedInterval callback macros, and a fairly long list of common errors and their actual fixes.

The second covers PC Developer / App Developer projects specifically - `.fcpcd` files, the SCADA wire-protocol side, COM port comms, GDI widgets and gauges, MQTT client setup (including fixes for where QoS 1 can silently drop packets in a request/response design), and some notes on Web Developer for comparison.

Everything in both documents was checked against actual exported Flowcode files or real compiler/export errors rather than guessed - if something wasn't confirmed against a real file, it's marked as such rather than stated as fact. They're written mainly for an AI assistant to work from when building or editing a Flowcode file directly (dense, exact XML/schema detail, no hand-holding), rather than as a beginner tutorial - but if you don't mind that style, there's a fair bit in there a person could learn from too.

If you have any issues or successes using AI then please let me know.
I found that Claude works really well at creating components and app developer projects, as a really complex MQTT project was successfully completed.
Al creates the working file, but you might need to upload a blank project file to start with if requested by AI
Attachments
Flowcode Creation Documents.zip
(183.07 KiB) Downloaded 115 times
Martin

jay_dee
Posts: 259
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 102 times
Been thanked: 74 times

Re: AI Code in FC - Discuss

Post by jay_dee »

Hi all, Using Claude as an external "consultant" on Flowcode projects – just some thoughts
asked it to review one of my FC projects and suggest areas to improve. It was polite and said the overall structure was sound… and then I got schooled. It suggested and explained 10 genuinely good improvements!

Did I just get a B- and get told to spend more time in lectures? Haha. It's been over 25 years since I was at uni, and I was straight back there in seconds!

my initial thoughts on using Claude as an external consultant, where it changes the .fcfx file, which I open, review and edit in FC.

File handling
1) Reloading: If I have a file open and Claude changes it, I presume I need to close and re-open it. Or does the Reload button handle this properly?
2) Version numbering: I always name files with a version number, e.g. MyProject_Ver27.fcfx. Claude is good at incrementing this for each new version. Not perfect, but it works OK.
3) Is version control be worth introducing, Mainly so that when something dumb happens, I can roll back quickly.
4) File home page: When an external tool creates new files, the "last file opened" list isn't much help. A list of recent project folders showing the newest three files may be a handy way to find the latest version.

My method
Colour-coding changes: I asked Claude to colour any icons it changes in magenta, and anything it changed in the previous version in light pink. This gives some visual tracking of what's been touched.
Change log macro: I asked Claude to create a dedicated macro used purely as a change log, with all changes recorded as comments.

My advice, always Discuss first, then work incrementally: On any project, I start with a discussion with Claude, agree the steps or areas to improve/fix, then work through them one at a time. If you give Claude a big job list in one go, the FC tends to get out of hand, and it will sometimes drop in a long C code block that you then have to work through to understand.

Other
If the FC team do release a version with AI agents built into the programming UI, I think we'll need the option to have the whole AI conversation in a separate window or on a second monitor.

Steve-Matrix
Matrix Staff
Posts: 2061
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 311 times
Been thanked: 479 times

Re: AI Code in FC - Discuss

Post by Steve-Matrix »

Thanks for sharing your experience - some nice suggestions that should hopefully be of benefit to others using AI.

Reloading should work ok. When you click the "reload" button in Flowcode, it will close and then reopen the current file. If this has been changed outside of Flowcode, the changed file will be reloaded. Just be aware that reloading within Flowcode will sometimes prompt to save the file and if you say "yes" to this then external changes will be lost. Equally, if you have made changes to the file within Flowcode and then reload without saving, then those changes will be lost.

Another thing to be aware of is that AI agents don't always fully understand the file structure. I have been presented with a few odd crashes of Flowcode that have been because AI changes have compromised the file structure or have simply made things up.

Making well-named backups and using version control is always a good idea, not just when using AI to modify the project files.

We have discussed having an AI agent within Flowcode itself. One thing holding us back is that Flowcode is used quite a lot within education and the use of AI for student-centred activities is often discouraged or prohibited. At least that is the current situation in the UK. Things may change in the future though.

Post Reply