Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Request for Features...

(you are viewing a thread; or go back to list of threads)

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
Sun Jul 5 2009, 10:19:28
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.
Sun Jul 5 2009, 17:23:49
(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
Mon Jul 6 2009, 13:34:01
(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.
Mon Jul 6 2009, 16:03:45
(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
Tue Jul 7 2009, 16:03:08
(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.
Wed Jul 8 2009, 02:02:06
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):