Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved] suitable language for process control

Status
Not open for further replies.

curious_mind

Full Member level 4
Joined
Apr 14, 2019
Messages
208
Helped
0
Reputation
0
Reaction score
2
Trophy points
18
Activity points
1,573
We have a task for developing a process control software in C for embedded platform. The process control is relatively complex with various modes of operations. Simple way of developing this program is to use a large case statements and execute the subprograms within each statement. I was wondering if there were alternate way of modelling process control, which is easily maintainable by anybody. Brief literature survey got me to process control language from seimens ( similar to instruction list in PLC) which uses instructions to model operation. Do you think such a scheme would be effective?
 

Nowardays it is being more usual the Structured Text (ST) language on PLCs. It is much more powerfull and readable when compared to the instruction list (IL). I would not spent time to learn some language that soon or later would be the bootleneck as the code complexity increases.
 

We have a task for developing a process control software in C for embedded platform. The process control is relatively complex with various modes of operations. Simple way of developing this program is to use a large case statements and execute the subprograms within each statement. I was wondering if there were alternate way of modelling process control, which is easily maintainable by anybody. Brief literature survey got me to process control language from seimens ( similar to instruction list in PLC) which uses instructions to model operation. Do you think such a scheme would be effective?
Hello,
consider to use "Finit State Machine" (FSM) it is widely used design pattern in embedded systems. See link:
https://brilliant.org/wiki/finite-state-machines/

You can implement it "by hand" or use specialized library. There are many free libraries with FSMs implemented in C/C++ languages for many MCUs.

Best Regards
 

We have faced some practical issues. Someone develops a code and when he leaves, it takes a while to get used to understand the interpretation of the code. This becomes more difficult with novice coders. Secondly, any process consists of inputs, interlocks and outputs. Most of the time when interlocks changes, the output also changes. This means, some one has touch two piece of code, Viz. interlocks function and output function.
I am looking for something like layered based architecture, where I change only the top file and rest of the downstream code is untouched.
 

Hi,

there are many solutions.

In some "control devices" where the user can define the function... I did it "configuration style"
So all the possible math is done and various results are stored in an array.
And just some bytes in the EEPROM (written by the user) defines which value us used and how this value is treated and how.

Example:
Lets say you have a lighting control. 4 inputs, 4 outputs.
Signal flow: input --> filter --> linearisation --> output
So for each output you have 3 configuration bytes:
1) input --> to select one of 4 inputs
2) filter --> to set the low pass filter time constant
3) linearisation: to set whether the output follows: linear, squared, logarithmic...

benefits are: no need to write and compile code for each user. almost constant processing time per loop. So you can run a processing loop every 20ms and you know if it runs then it will run for every combination / user.
(I still recommend to verify the timing an use some safety margin)

For the EEPROM data you can generate a simple GUI with dropdown lists, graphs, values...

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top