Request for Features... (by B.Schmelzer)
Hello Mr.Westhues,
i realy like Ladder Logic and it's concept. Some time ago i got it to work on my ATmega8-Devboard. Coincidentally i thought of using the Vellmann K8055 as an simple PLC. I'm going to extend the included ldinterpreter to a simple Software-PLC using the K8055. Unfortunately most of the nice features are disabled when i try to compile to interpretable bytecode. I'm talking about UART,PWM,ADC,EEPROM, etc...
I wonder why are these features disabled? Most of these features could easily implemented within the interpreter. So would it be possible to enable these features?
Greetings,
B.Schmelzer
special memory locations (by Jonathan Westhues)
My intent was that any special features with the bytecode target would be accessible via special memory locations. For example, you could write your interpreter so that whenever the program reads the variable "ADC0", it actually does an ADC conversion. And likewise for PWM output, with a variable that behaves specially when you write to it.
That's the reason why the names and locations of the variables are output in the bytecode file, in the $$bits and $$int16s sections. That would allow you to add support for any of those features, or for other special features that I didn't foresee.
(no subject) (by B.Schmelzer)
Yes, this sounds reasonable. But i wonder how to implement the "Formatted String Over UART" feature. This would be nice for debugging or status-display. Anyway: I'll try to find a solution.
Greetings,
B.Schmelzer
(no subject) (by Jonathan Westhues)
The "Formatted String Over UART" op is the one thing that would be ugly to implement that way. You could always modify the target to generate some special bytecode op for that; look at interpreted.cpp.
(no subject) (by B.Schmelzer)
Do i need a special Opcode? As i see, your compiler only uses the INT_UART_SEND opcode for transmitting the formatted text. (And other supported Opcodes) So it should work, if i implement INT_UART_SEND in your interpreter.c
Unfortunately i didn't succed to compile LDmicro using gcc, so i can't modify the interpreted.cpp to emit the INT_UART_SEND opcode :-(
Greetings,
B.Schmelzer
(no subject) (by Jonathan Westhues)
Correct, you would just have to make interpreted.cpp spit out UART_SEND ops.
The Microsoft compilers are all a free download with the Platform SDK. So there's no reason to build with gcc for Windows.