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 - Changing Pin for Serial Command

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

Changing Pin for Serial Command (by Marcelo)
hi all,

I liked this compiler... I have a question about how I/O are used. Is there a possibility to show a I/O like a number and send this via serial?

thanks!
Mon Dec 7 2009, 08:53:38
(no subject) (by Jonathan Westhues)
Do you mean like to read the voltage at the pin with an analog-to-digital converter, and then print that value as an ASCII string over serial? Look at the "A/D Converter Read" and "Formatted String over UART" ops.
Mon Dec 7 2009, 13:18:12, download attachment serout.ld
uh... (by Marcelo)
Well, I don't want read this voltage... Let me see how i explain this... When i put a coil, for example, i can to put this source in Internal or uC pin... But i think in other option that send a command via serial.

So, i don't use microcontroller pin with ldmicro code to interface but use another microcontroller to activate this...

ok?

thanks for all...
Mon Dec 7 2009, 14:05:12
(no subject) (by Jonathan Westhues)
If you want to receive data over the serial port, then look at the "UART Receive" op.
Mon Dec 7 2009, 15:58:55
(no subject) (by Marcelo)
Hi... I would like to use this without explicit this in ladder code. I know that i have to change source code to do this... Where i modify the code to insert my modification?

Look, i need to change code for change I/O in another uC and i have to do this via serial...

Like this:

Ladder: -------------] [--------------
switch
Send this command via serial: switch-on (ON) or switch-off (OFF)

Thanks for all!
Tue Dec 8 2009, 11:18:38
(no subject) (by Jonathan Westhues)
Use code like in the attachment, but with an internal relay.
Tue Dec 8 2009, 12:23:39, download attachment serin.ld
(no subject) (by Marcelo)
Jonathan, thanks for all... But a wanna change your code... So, when i atribute a pin for anything, in the list have: "serial command to send/received".

Can you help me to do this in your code?

Thanks again...
Wed Dec 9 2009, 12:30:47
(no subject) (by Jonathan Westhues)
It would of course be possible to add this to LDmicro, but I am not interested in doing so. I prefer to keep serial as a separate op. If the user wishes to, then they can define whatever protocol they need, and write their own code to set internal relays based on serial input.

The source is available for download, and information about building and modifying it is available in the archives of this forum.
Wed Dec 9 2009, 23:39:47
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):