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 - set-only coil bug

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

set-only coil bug (by hobby16)
Hi all,
I've done an open source PLC hardware based on LDMicro : http://faztech.free.fr/uploads/zplc/
Schematics and simple-face PCB routings are published, the target uP is 18 pins PICs (16F628 & 16F88)

All is fine, LDMicro simulator's behavior is quite consistant with real hardware and I'm really happy with the development suite (congratulations and many thanks to Jonathan Westhues).

Now, it seems I've seen a bug: the set-only coil behaves exactly like normal coil (it goes to zero when inputs go to zero, which it shouldn't), see the ladder code :
PROGRAM
RUNG
CONTACTS XRB0 0
COIL YRB1 0 1 0
END

Maybe I'm just mis-using the coil, can anyone confirm it's a bug, please ?
Mon Sep 13 2010, 09:52:18
(no subject) (by Jonathan Westhues)
Can you attach the full program, and the .hex file output that misbehaves?

Note that the set-only coil does appear greyed in simulation mode when its rung-in is false, even if the coil is set. Look at the coil state in the I/O list (bottom pane) to see what's actually happening.
Mon Sep 13 2010, 10:22:16
(no subject) (by hobby16)
Oh, you're right Jonathan, the coil state in the I/O list reacts as set-only as wanted (if I insert a new rung and use that same coil as a contact, it is hightlighted correctly when set).
In fact I've been misled by my hardware where inputs are all negated (because of common emitter photo-transistor).

So no real bug, just minor inconsistency in the display of set-only (and reset only) coils.

Thank you and again, congratulations. If you want some more information on the hardware I designed or add it to your project, you're welcome. So far, I use it in model trains.
Fred.
Mon Sep 13 2010, 13:05:43
(no subject) (by Jonathan Westhues)
The highlighting during simulation reflects the rung-in and rung-out states of the instructions. It does not necessarily reflect the states of the contacts and coils. For set-only and reset-only coils, it does not reflect the persistence, as you see; and for negated contacts and coils, it's exactly backwards.

This is by design. It's a little bit confusing, but I think that anything else would be worse.

And if you post details of your project, either here or on a website that you link to here, then probably other people would be interested to see it. Let me know if you have any other questions about the software.
Mon Sep 13 2010, 21:11:50
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):