Using Fc App Dev to Monitor values from a PIC UART

Discuss PC Developer and Web Developer projects and features here.
Post Reply
jay_dee
Posts: 130
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

Using Fc App Dev to Monitor values from a PIC UART

Post by jay_dee »

Hi,
So this is very much just a working concept. Stage 1 of what I am trying to achieve with Fc App Dev.
There is lots to improve but I only get a few hours here and there..so just sharing what I have bashed together so far.

Background.
Most of the current SCADA and FC App Dev (FAD) examples use a PC running FC to work through a Slave micro. My requirment was to reverse this and allow a simple Micro to be easily monitored by an external PC. The idea is that I can deploy a PIC project, this is happy doing its main job but using a basic UART (and FTDI interface) can send out periodic data frames to a PC.
My favourite method previously was to send a structured message to a VT100 console (TeraTerm)..this was great TBH. A user could plug a PC into a field deployed project and monitor a whole bunch of values.

FC App Dev
With FAD I think I can now deploy a much nicer looking monitor screen with numbers, graphs, gauges...all the toys. The aim is also to ensure that main project's PIC needs absolute minimal resouces and it can send non-deterministic messages, after all it just about monitoring not controlling the PIC.

ECIO40P FC
Attached is some FC to run on a ECIO40P. There is a macro to send a number and another to send text strings. Everything else is just there to create some varying values and send stuff out over the UART.
Data send out is;
1) a location 'ID' to send it to. This just allows the FAD PIC Monitor to know which value is being updated.
2) The value itself which can be a number or text.
3) The value type, this allows the recieving FAD Pic Monitor to know what sort of data it is. ( bytes, Singed Integer, Unsigned Integer, String, Values Name) and deal with it differently if required.
ECIO40P_Serial_TX_V4.fcfx
ECIO Firmware
(31.21 KiB) Downloaded 161 times
My FAD PIC Monitor Note: this uses Bens new Console writer. Update Library if requird.
The system uses a circular buffer to look for header ':' and footer ';' bytes, creating a string from everything inbetween.
The ID byte ensures the correct textbox is updated.
The Type byte ensures the data type is treated correctly.
Everything else is just the value data... a number or text etc...
FAD_RecieveData_V2.fcsx
FAD Pic Monitor
(64.06 KiB) Downloaded 167 times
Current State
It works OK and in FAD the consoles are a huge help for development..I can see all data is correcly recieved but I think my current method of stripping the data out of the buffer is less than perfect. I often seem to drop data if I send several strings sequentially so I have to repeatedly send them, which is in efficient for static stext names.
Also it runs a bit slow, I think the use of lots of StaticText components is not ideal but since I cannot know in advance what sort of data is to be sent, it kind of works.
J. :)

Post Reply