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 - new element

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

new element (by dzairo)
Hi.
I have idea to add to LDmicro new element-instruction for RS-485 support..
Is there some one who can help me ??

I can make copy of formatted string send to uart and add function .. but need help with this..

best regard
Thu May 1 2014, 14:35:19
(no subject) (by MGP)
I thought that RS485 was a hardware thing?

Search for a "RS232 to RS485 converter".
Fri May 2 2014, 07:21:53
new element - instruction (by dzairo)
Hi. Sorry .. I bud write .. I mean Rs-485 mod bus or similar function.. send and received data by RS-485 .. implement code to firmware.. send max 32bytes buffer : 1 device address , 1 instruction or memory address , max 29 data , 1 CRC8 total 32bytes.

best regards
Fri May 2 2014, 10:23:02
(no subject) (by MGP)
Changing the firmware is out of the question.
Maybe you can do it like this, download PLC-LDMicroProteusScada.rar, that you can find in:

http://cq.cx/ladder-forum.pl?action=viewthread&parent=2080
Fri May 2 2014, 12:08:11
(no subject) (by Dzairo)
ehm.. doesn't matter what software use .. but this function missing in LD micro..

don't need append complete M-Bus firmware to MCU .. only small part ..
this is good one solution :
for example :
[6;38;W;56]
start packet, device address, register position, Read or Write , data , end pakcet..

device address : 8 bit for max 255 device in bux
register address : 16 bit for max 65536 register
Read Write : define if read or write from to register
data : data .. 16bit number.

this is easy solution how to send receive any short data to from .. but if want send text then this is not good..

any idea??
Sat May 3 2014, 13:03:02
(no subject) (by MGP)
From the Helpfile:

"Variables are always 16bit integers. This means that they are van go from -32768 to 32767........"

You can read the rest in LDmicro.

I think you're asking too much from LDmicro.
Keep it simple because the timing is crucial in transmitting via RS232.
Sun May 4 2014, 03:17:55
(no subject) (by dzairo)
hi MPG.

I newer before work with C in win32 platform then have big problem to change code and make changes what I want.

LDmicro is best project and work well, right now I use it.
But in LDmicro missing some easy function what user want .For example:
dealay,I2C,received string from uart , bit shift wariable etc..
I'm not PIC mcu programer then I can't say about this .. but for AVR mcu is not problem to implement some easy function.
Problems are gui . LDmicro is writed in C , if writed in Delphi then append all function self .. but now can't do it ..

for delay:
use timer 0 and function similar send uart , to ariable set delay and code delay (halt for this time)

for I2C:
small program after timer1 inicialization, and new element-instruction with two variable for address and data , read or write

receiving data by uart:
add to code IRQ for usart , variable now start from ram address 0, change it to 36 and first 36 bytes we use for rx buffer and rx wariable .

ldmicro generate code but not call sub programs (only for math function) if use it then code will be more easy and efective , yes but then we need use stack point and will be problem vith variable , but this is possible solve too.. define smaller memory and make free area for call function for example 20 call it's 40 bytes memory .

ehmmm.... all this is possible silve with special function .. possible to start programm , external program writed for example in C imported to hex code ..

add small and easy function make ld micro 100x better ..

I can do it but need help..

ehm.. qestion is : why is not possible in one line add more instruction coil or other , why only right side etc..

regards
Sun May 4 2014, 04:09:25
(no subject) (by MGP)
I can't help you, I program in LDmicro and have accepted it's limitations.
Someone else maybe ?
Sun May 4 2014, 15:08:30
(no subject) (by Ziggy)
LD micro and Arduino make an intersting combination.

Generate C output in LD micro and then augment it in Arduino environment.
Sun May 4 2014, 18:39:55
(no subject) (by Dzairo)
Hi MPG

Today I try add new instruction .
I use existing instruction EQU .
Duplicite this instruction and new one rename to Shift Variable.
This new instruction do exactly this: Shift Variable to right.
If first bit of variable is 1 then olutput is true ,for example coil set , if is 0 then output is false and coil clear .

This I test in AVR Studio 4.19 for atmega8 and work..
Need help with simulation etc..
I don't know if this function is useful or not , I just try append any function to LD micro..

Now need help to understand and finsih my function..
Then I can add more function to LD micro (I2C,real UART etc..)

regards.
Thu May 8 2014, 15:37:09
(no subject) (by Alex)
just cheking the forum, what happened to this ldmicro version? does it have bugs official 2.3v have?.


Ldmicro 4.1.2v github works pretty well, no bugs like 2.3 v
Sun Jan 8 2017, 21:51:25
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):