Page 1 of 1

Component Creation - Variables in Properties

Posted: Tue Jun 30, 2020 5:32 pm
by Jay Dee
Hi,
I'm thinking of how I could make a certain component, the idea is still very much in the planning stage as I have only just started working on how to make components! (thanks Dave!)
Is it possible to have a component property with a drop down menu and be able to select from a list of the variables that exist within that specific Flowcode program?

I'm looking to assign text names and specific variables to a range of 'slots' within the properties bar.

I suspect you would usually do this via a componets macro, however if I have say 10 variables assigned and want to change their order, I need to open and adjust each component macro, which is quite slow. I was hoping a single interface on the properties bar would make this quicker.
hmm.... :? J.

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 9:23 am
by Steve
I'm pretty sure it's not possible for a property dropdown to determine the variables available in the program. I'm also unsure why it would be useful and there might be other techniques you could use. What exactly are you trying to achieve?

That said, we could look into adding this kind of functionality if there was a good reason. For example, we've recently added (to the upcoming v9) a new property type which is a dropdown for macros within the current program that allows the user to set a "callback" function in a property, along with an associated "call macro" event that takes a string as the macro to call. That required a change in how Flowcode works and has some caveats in its current form (e.g. it's simulation only, so no good for downloaded programs but very useful for developing deployed PC-based apps or SCADA-like programs).

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 10:08 am
by Jay Dee
Thanks Steve, I suspected that.
This idea brewing is on the edge of my capability TBH...but I often learn alot in the process! :)

Aim. A component to help build simple VT100 compatible output, for sending out diagnostic data to a terminal.

Building on the examples from Martin (Medelec), I've found the VT100 output to be a very effective way to get diagnostic data out of a PIC in the field.
I currently have a set of macros for sending, line by line, a text string and then a variable value.
This flowcode is an example of this, chopped from another larger project.
TeraTermExample.fcfx
TereTerm
(52.67 KiB) Downloaded 168 times
with screen output..
Output
Output
TeraTermOutput.PNG (6.9 KiB) Viewed 3966 times
This works great but I'm looking to improve
a) the system is slowed by having to write the description string each time, rather than just updating the variable value.
b) If I want to shuffle the order or insert a new variable, I need to go back through each seperate macro and change the Row number. This is painfully slow when you rushing a project to a deadline!
C) I would like to output 2 or 3 columns of data to give me even more room for data output. I usually use a BIG font so I can see the screen at a distance.

Anyway... I was pushing around ideas for how I could wrap this into a Component, giving a really slick way to push out description and variables from any program.
One idea was to have a compoent with multiple text boxes for text descriptions, a value to set the Row, another for Column and each with a drop down list of available variables. Simple in concept, complex in implmentation :) .... as it so often is! J.

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 11:10 am
by Steve
Thanks for explaining.

I think I would approach this by making use of the ICD functionality of Flowcode - setting breakpoints, using the watch window to view and change variable values, printing debug info to the console, etc.

But I also see the use to send out this kind of info in an embedded device "in the field". To do this, I would probably rely on a generic "VT100" component and had a macro within my program that created, formatted and sent the data I wanted to display to this component.

Another thought... If your target device has a lot of flash memory, you could create a component that held a multi-dimensional array of string data (in a set number of rows and columns like a spreadsheet) that you could then send out via RS232 (or whatever). You could create a component macro that filled the value or label in a particular "cell", and then create another macro to dump all the data to the output stream.

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 2:16 pm
by Jay Dee
Hi steve, thanks for your help, I'll take a look at some options but Yes, for field diagnostics a simple TeraTerm and Serial FTDI is very useful.

I dont want to put a downer on the situation but ICD/ICT..that is a whole painful story on it own. forgive the quick rant!
>Sadly I've spent way too much time trying to get these things to work smoothly with ECIO40. I throughly support the Flowcode enviroment but just trying to get live values from a PIC has not been an enjoyable process, with these tools.
>I dont tend to use the simulation as it does not run well on larger programs, I have to hack the program to test the section of code I'm interested in and the values /status of the sim graphics just dont seem reliable, and to be blunt, after a few issues, I now dont trust it.
>The watch window is painful to use and has to be setup each time, I cant save or re-order things or change the font to help viewing from a distance. It could be useful...but its very limited in its current form.
>I've just looked at the Console doumentation again...to be honest I've struggled to make 'head nor tail' of it. It make the VT100 Documents look straight forward.

I started wrting a whole feedback on the ICT and ICD but it got the better of me and I just had to walk away and deal with the main project in hand.
I dont want to knock they whole Flowcode enviroment but the bolt on tools (consol,scope, recorder ... ), for this engineer at least, just dont seem to offer robust tools, more approximations for the education market and cause more issues in my development cycle that they help solve.
I may well be using them wrong but I dont know any better and dont have any way of learning the correct way of using them.

As a field engineer, All I really want is to be able to define a list of variables and get a live values from the PIC displayed on screen, I have so far failed to acheive this with the builting ICD ICT( spent plenty of time trying) and the output to an external Terminal was so simple.
sorry, thats just been my experiance. J.

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 2:46 pm
by Steve
Thanks for the feedback. I'll pass that on and discuss with our team to see how we can improve these tools and their documentation.

Re: Component Creation - Variables in Properties

Posted: Wed Jul 01, 2020 3:04 pm
by Jay Dee
Steve, I wont forum rant... :)
I'll see where I got with the more structured feedback and send on if I can find it.
J.