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 - ladder.h

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

ladder.h (by julian)
I'm looking forward to understand how should I write the "ladder.h" file. The LDMicro C generated file seems pretty understandable, but I have little C background as to realize the way I have to complete the I-O functions and type definitions.

Can anyone paste some code to watch?

BTW, kind congrats and thanks to the author of such a great software

julian
Sat Jul 18 2009, 20:09:56
(no subject) (by Jonathan Westhues)
At a minimum, you could define the typedefs, and tell it to declare all the functions extern:

typedef unsigned char BOOL;
typedef signed short SWORD;

#define EXTERN_EVERYTHING

Then in the rest of your code, you just have to define all the I/O functions (Read_U_xxx, Write_U_xxx), and call the function PlcCycle() every cycle time.
Sun Jul 19 2009, 17:37:22
(no subject) (by Alex)
but what if i use an internal input like R1, how do i define that?
Wed Aug 31 2016, 23:29:38, download attachment R1.jpg
(no subject) (by Alex)
In the image, how do i have to define? please help, iīm trying to understand, maybe iīm totally wrong
Wed Aug 31 2016, 23:37:55, download attachment R1-2.jpg
(no subject) (by Alex)
in the part where it says //TODO, iīm using ldmicro 3.5.4
Wed Aug 31 2016, 23:40:18
(no subject) (by Ihor Nehrutsa)
You do not need to define an variable for internal relay.
It defined in c file as:

...
STATIC BOOL U_b_R1 = 0;
#define Read_U_b_R1() U_b_R1
#define Write_U_b_R1(x) U_b_R1 = x
...
Thu Sep 1 2016, 04:33:01, download attachment r1.c
(no subject) (by Ihor Nehrutsa)
to Alex

#define is most fastest way for access to pin.

...
/*
// You provide these functions.
ldBOOL Read_U_b_Yled(void) {
return PORTD & (1<<PORTD2);
}
void Write_U_b_Yled(ldBOOL b) {
if(b)
PORTD |= (1<<PORTD2);
else
PORTD &= ~(1<<PORTD2);
}
*/
#define Read_U_b_Yled() (PORTD & (1<<PORTD2))
#define Write_U_b_Yled_0() ( PORTD &= ~(1<<PORTD2) )
#define Write_U_b_Yled_1() ( PORTD |= (1<<PORTD2) )
#define Write_U_b_Yled(b) ( (b) ? Write_U_b_Yled_1() : Write_U_b_Yled_0() )
...
Thu Sep 1 2016, 04:41:03, download attachment R1.ZIP
(no subject) (by Alex)
i know i have asked this before, but i really want to ask anyway, again, iīm trying to use ansi c code for 16f877A, for learning, everything is ok when adding I/O external pins in ladder.h, but when it is about internal inputs, outputs, timers, counters that involves directly with and I/O pin of the MCU , i use return, for example:

inline BOOL Read_U_b_Y1(void)
{
return (?);
}

i attach files with code, ladder and pictures, that is that i want to know about, thanks in advance,

PDT: it compiles with pic c compiler but in siumlation doesnīt work and it says in pic c compiler : "condition always true" in this part " if(U_i_T1 < 999) {" see image.
Thu Oct 20 2016, 19:00:55, download attachment prueba1.rar
(no subject) (by Alex)
i know that i donīt need to define internal variables, they are defined in ansi c code, but i only want to make this code work, it is a simple led blinking 10 sec on/off.
Thu Oct 20 2016, 19:03:29
(no subject) (by Ihor Nehrutsa)
to Alex

LD, asm and C inside
Fri Oct 21 2016, 10:43:50, download attachment prueba2.zip
(no subject) (by Alex)
thank you very much Ihor, it works correctly :) .Now to analize
Fri Oct 21 2016, 12:52:39
(no subject) (by Alex)
when i want to call the "PlcCycle();" without using delay for the time step for PlcCycle, i tried to use timer1 for calling it :


#include "ladder.h"
CONFIG(INTIO , UNPROTECT , WDTEN , PWRTEN , BOREN );
#ifndef _XTAL_FREQ

#define _XTAL_FREQ 20000000
#endif
long pulsos;
extern void PlcCycle(void);


void init(void)
{

set_tris_b(0x00);
}


void main(void)
{
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);

set_timer1(0);
init();
while(true)
{pulsos=get_timer1();



// Main Ladder diagramm cycle is here
if (pulsos>=100)
{
PlcCycle();
pulsos=0;
set_timer1(0);
}
}
}


but i get error "Function used but but not defiened... PlcCycle SCR=407"
Mon Oct 24 2016, 03:45:02
(no subject) (by Alex)
I finally could make a 10 sec blinking led on/off using using ansi c for the 16f877A
Tue Oct 25 2016, 18:22:22, download attachment prueba 4.rar
(no subject) (by Alex)
but...... when i try to use the same code with a different micro, 16f84A in this example, i changed in ladder.h :

#include <16F84A.h>
#use delay(crystal=4MHz)

in 16f877A was like this ( attach in prueba 4)

#include <16F877A.h>
#use delay(crystal=20MHz)

the problem is that the 10 seconds blinking led on/off in 16f877A turns into a 40 sec blinking led on/off in 16f84A, is it because of the crystal?
Tue Oct 25 2016, 18:27:02, download attachment prueba 5.rar
(no subject) (by Alex)
...using the same code with different micro
Tue Oct 25 2016, 18:27:58
(no subject) (by Alex)
sorry my mistake, now works ok in both micros with same code and different crystals ( 20 - 4 MHZ) i forgot to set de processor clock frecuency (in the micro)
Tue Oct 25 2016, 18:40:26
(no subject) (by Alex)
sometimes pic c compiler asks me for a ladder.c file sometimes it doesnīt, sometimes i have to #define sometimes i donīt.
Tue Oct 25 2016, 18:42:04
(no subject) (by Ihor Nehrutsa)
to Alex and MGP

I want to create "HO TO:" example based on serial LCD
like in thread
http://cq.cx/ladder-forum.pl?action=viewthread&parent=3084
Can I specify the address of your email in the article as hardware expert ?
Tue Oct 25 2016, 23:12:50
(no subject) (by Alex)
you know, iīve trying to call PlcCycle without delay_ , i donīt like delay, but i was using it like this in ansi c, like this:

void main(void)
{

//init();
while(1)
{

delay_ms(100);// Time step for PlcCycle() 100 ms


PlcCycle();
}
}

so i tried to use timer 0 as an interrupt for calling PlcCycle without delay (you know kinda of arduino with millis() in multitasking but thereīs no way to use it in pic),
so i did this:

void main(void)
{

long pulsos;

setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);

set_timer1(0);

while(true)
{pulsos=get_timer1();


if (pulsos>=10000)
{
PlcCycle();
pulsos=0;
set_timer1(0);
}
}
}


Summary: when i use delay it works ok, i just have to adjust it but works, when i use timer 0 it works but blinking time is never 1 sec, it is more than 1 or less, but not 1 sec, eve if i change "pulsos>=1000", "pulsos>=10000", "pulsos>=100", so......


again and last, HOW CAN I CALL PlcCycle without using delay_
Tue Oct 25 2016, 23:18:31, download attachment prueba 8.rar
(no subject) (by Alex)
sure: i have 2 e-mail

[email protected]
[email protected]
Tue Oct 25 2016, 23:22:00
(no subject) (by Alex)
no i try to use this for calling PlcCycle:

void main(void)
int i;
{
// 1000 cycles times 10 ms gives 10 seconds execution
for(i = 0; i < 1000; i++)
{

PlcCycle();


}


}

summary: not 1 sec cycle XD, doesnīt work
Wed Oct 26 2016, 22:53:40
(no subject) (by MGP)
Why should you use PlcCycle, it's not a instruction, it's a tool for measuring the time of the generated code and with this you can set the shortest cycletime.
Or do I miss something?
Thu Oct 27 2016, 05:57:42
(no subject) (by Alex)
Hello. maybe i am misunderstanding about PlcCycle, let me explain what iīve been trying to do from what iīve undesrtood:

STEP 1: (generate ansi c code)

when i generate ansi c code i get this message:

"Call this function once per PLC cycle. You are responsible for calling it at the interval that you specified in the MCU configuration when you generated this code."

STEP 2: (Search information in the forum)

After iīve read this meessage (STEP 1) i made my own research in the forum and found some examples using ansi c code:

----------example 1----------

http://cq.cx/ladder-forum.pl?action=viewthread&parent=3579

(LDMICRO EJEMPLO PIC12F629.zip)

"In this example PlcCyle is called like this:

void main(void)
{
RESTART_WDT();
init();
while(true)
{
RESTART_WDT(); // clear WDT unlimited
delay_ms(100);// Time step for PlcCycle() 100 ms

// Check inputs, process outs..
// Main Ladder diagramm cycle is here
PlcCycle();
}
}

"

----------example 2----------

http://cq.cx/ladder-forum.pl?action=viewthread&parent=2005

(this one ---- > pic12_ladder_bathroom_light_3.zip)
"
In this example PlcCycle i called like this:

void main(void)
{
CLRWDT();
init();
while(1)
{
CLRWDT(); // clear WDT unlimited
__delay_ms(100);// Time step for PlcCycle() 100 ms

// Check inputs, process outs..
// Main Ladder diagramm cycle is here
PlcCycle();
}
}

"
-------------------------------------------------------------
("delay_ms(100) IS USED FOR CALLING PLC CYLE in both examples)
-------------------------------------------------------------

----------example 3----------

http://cq.cx/ladder-forum.pl?action=viewthread&parent=3296

"this an example calling Plc Cycle in arduino (it works ok):

/* Plc cycle interval, set this according to LDmicro settings. (micro sec.) */
#define PLC_INTERVAL 10000

void setup()
{
PlcSetup();
}

void loop()
{
if (IsPlcInterval())
{
PlcCycle();
}
}

/* Plc Cycle timing function. */
boolean IsPlcInterval()
{
static unsigned long last_run;

if (micros() - last_run >= PLC_INTERVAL)
{
last_run = micros();
return true;
}
return false;
}

"
--------------------------------------------------
(IN EXAMPLE 3 DELAY IS NOT USED)
--------------------------------------------------

STEP 3: (attempts)

After many atempts i finally could make ansi c code works in prueba 4.rar (attach before)

like this :


"

void main(void)
{


while(1)
{

delay_ms(100);// Time step for PlcCycle() 100 ms

PlcCycle();
}
}

"

STEP 4: (call Plc Cyle without using delay)
------------------------------------------------------------
My doubt, what i want to do is that i donīt want to use "delay", because delay freezes microcontroller so i tried to use "timer 0" and "for" like this:
------------------------------------------------------------


---------using timer 0--------- (attach in "prueba 7.rar")

void main(void)
{

long pulsos;

setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);

set_timer1(0);

while(true)
{pulsos=get_timer1();

// Main Ladder diagramm cycle is here
if (pulsos>=10000)
{
PlcCycle();
pulsos=0;
set_timer1(0);
}
}
}

----------using "for"---------- (attach in "prueba 8.rar)
"

void main(void)
int i;
{


// 1000 cycles times 10 ms gives 10 seconds execution
for(i = 0; i < 1000; i++) {
PlcCycle();

}

}

"
-------------------------------------------------------------
In both attempts ("timer0" and "for") it works with a differente cycle time, for example, led blink for 1 sec in ansi c using "timer" 0 or "for" it is never 1 sec blink it is more or less than 1 sec, when i use delay it is for 1 sec.
-------------------------------------------------------------

STEP 5: (conclusion)
why i want to do this?

Because if sometime i want to do multitasking,.... using "delay" is not a good option.

I may misunderstading this or maybe i donīt explain very well,

-------------------------------------------------------------
so, coming to the point, i donīt want to use delay for calling Plc Cyle, i wish to call Plc Cyle in another way to do multitasking.
-------------------------------------------------------------

Thanks for your time.
Thu Oct 27 2016, 10:33:57
(no subject) (by Ihor Nehrutsa)
to Alex.

1) "using "delay" is not a good option."
Yes.

2) STEP 4 is good way.
setup_timer_1(), get_timer1() are HItech C routines?

What PIC C compiler you used?
Thu Oct 27 2016, 10:59:48
(no subject) (by Ihor Nehrutsa)
Thu Oct 27 2016, 11:03:33
(no subject) (by Alex)
I made a mistake, iīm not using timer 0 in the code, iīm using timer 1, which most but not all PCM devices has timer 1,


The Timer0 (has all devices) module is an 8-bit timer/counter that is included with all 8-bit PICŪ MCU devices.

"Yes, hitech"

http://saeedsolutions.blogspot...0-code-proteus-simulation.html

i Used these examples:

http://www.ucontrol.com.ar/for...-pulsos-con-timer-en-ccs/?wap2

https://www.youtube.com/watch?v=CemyLnAN5ew (timer 1)

I am using PIC C COMPILER version 4 (image attach)
Thu Oct 27 2016, 14:04:01, download attachment pic c compiler version.jpg
(no subject) (by Alex)
after reading internet information and watching videos about timer0 i understood that in pic c compiler we have to make some mathematical calculations with preescaler,set_timer0(x);,external clock (crystal),i think i found a set_timer0 near 1 sec, is not exactly 1 sec, which that was the value for my led blink en ladder. now in this ladder i set 2 leds, led 1 blinks for 1 sec on/off, after 5 blinks led 2 turns on, then turns off.
Mon Oct 31 2016, 18:01:56, download attachment prueba 11.rar
(no subject) (by Alex)
I used the "counter timer" of the Proteus 8 for my blinking led 1 sec on/off ansi c program generated by ldmicro 4.0.6, i was wondering that using timer0 would not get exactly 1 sec but at least the closest one(about 0.1 microsec), I thought that i didnīt define the crystal o delay very well so i used this two options:

option 1:

#use delay(crystal=20MHz)

option 2:

#FUSES HS
#use delay(CLOCK=20M, CRYSTAL=20M)

In both cases i got the same time (attach file),

Are they the same OPTION 1 and OPTION 2? (for CCS)
Thu Nov 3 2016, 12:14:06, download attachment timer.docx
(no subject) (by Alex)
CCS file attach
Thu Nov 3 2016, 12:15:41, download attachment prueba 11A.rar
(no subject) (by Alex)

#INT_TIMER0
void timer0_isr(void)
{
clear_interrupt(INT_TIMER0);
set_timer0(61);

PlcCycle();




}
void main()
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
set_timer0(61);
clear_interrupt(INT_TIMER0);
enable_interrupts(INT_TIMER0);
enable_interrupts(GLOBAL);


while(TRUE) ; // Endless loop
}
Fri Nov 11 2016, 23:59:01
(no subject) (by Ihor Nehrutsa)
Interrupt ISR routines must be small and fast as possible.
LDmicro PlcCicle too big and slow for calling inside ISR. :(
Sat Nov 12 2016, 01:40:06
(no subject) (by Alex)
is there another better way ? :(
Sat Nov 12 2016, 02:42:42
(no subject) (by Ihor Nehrutsa)
Like in AVR's C code.
Init timer,
start main cycle
any code here...;
read timer valueD,
if timervaue == PLC_INTERVAL
then call PlcCycle();
any code here...;
end of cycle
Sat Nov 12 2016, 03:37:05
(no subject) (by Alex)
thanks, iīll try
Sat Nov 12 2016, 04:01:11
(no subject) (by Alex)
#use rtos(timer=0,minor_cycle=10ms)
// function declarations
#task(rate=10ms,max=10ms)
void PlcCycle();
//void The_first_rtos_task ( );
#task(rate=500ms,max=10ms)
void The_second_rtos_task ( );
#task(rate=100ms,max=10ms)
void The_third_rtos_task ( );
// more function declarations
// function implementations
void The_first_rtos_task ( )
{
//PlcCycle();
}

void The_second_rtos_task ( )
{
// task code
}
void The_third_rtos_task ( )
{
// task code
}

void main ( )
{

rtos_run ( );
}
Sat Nov 12 2016, 10:43:20
(no subject) (by Alex)
sorry, change: minor_cycle=10ms to minor_cycle=1ms

change all : max=10ms to max=1ms



when i delete the others 2 task it doesnīt work :p , but when there are the 3 tasks it works but i donīt undesrtand why doesnīt work if i delte the other 2 unnecesary tasks.
Sat Nov 12 2016, 10:46:52
(no subject) (by Alex)
to all:

some example how to use : U_duty_cycle en ansi c ladder code
Sun Nov 13 2016, 00:30:50
(no subject) (by Alex)
for supporting peripherals
Sun Nov 13 2016, 00:31:33
(no subject) (by Ihor Nehrutsa)
to Alex
What lib you use? rtos,task it very intresting.
Sun Nov 13 2016, 08:11:19
(no subject) (by Ihor Nehrutsa)
Sun Nov 13 2016, 08:20:08
(no subject) (by Alex)
Sun Nov 13 2016, 15:07:51
(no subject) (by Alex)
ccs_c_manual, great pdf
Sun Nov 13 2016, 15:08:50
(no subject) (by Alex)
when i use ANSI C code generated by LDMICRO, i always make 3 steps, i donīt know if these are the best way to do but i am just a user of the program:

3 steps:

1)ladder.h "generated by http://adam.horcica.cz/tools/ladder-gen/ "
2)ansic c code (c file) "generated by LDMICRO"
3)main program "i have to generate this"

In step 3 wich is where i always call the PlcCycle()
i use:

---------FOR ARDUINO----------

#include "ladder.h"


#define PLC_INTERVAL 10000

void setup()
{
PlcSetup();
}

void loop()
{
if (IsPlcInterval())
{
PlcCycle();
}
}

/* Plc Cycle timing function. */
boolean IsPlcInterval()
{
static unsigned long last_run;

if (micros() - last_run >= PLC_INTERVAL)
{
last_run = micros();
return true;
}
return false;
}

//this can be made using millis() too

--------- FOR PICīs-------------

---with timer0:---

#INT_TIMER0
void timer0_isr(void)
{
clear_interrupt(INT_TIMER0);
set_timer0(61);

PlcCycle();

}
void main()
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
set_timer0(61);
clear_interrupt(INT_TIMER0);
enable_interrupts(INT_TIMER0);
enable_interrupts(GLOBAL);


while(TRUE) ; // Endless loop
}

---with timer1:---

#INT_TIMER1
void timer1()
{
clear_interrupt(INT_TIMER1);
set_timer1(59286);

PlcCycle();


}
void main()
{
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
set_timer1(59286);
clear_interrupt(INT_TIMER1);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);


while(TRUE) ; // Endless loop
}

---with RTOīs:---

#use rtos(timer=0,minor_cycle=1ms)
// function declarations
#task(rate=10ms,max=1ms)
void PlcCycle();
//void The_first_rtos_task ( );
#task(rate=10ms,max=1ms)
void The_second_rtos_task ( );
#task(rate=10ms,max=1ms)
void The_third_rtos_task ( );
// more function declarations
// function implementations
void The_first_rtos_task ( )
{
//PlcCycle();
}

void The_second_rtos_task ( )
{
// task code
}
void The_third_rtos_task ( )
{
// task code
}
// more function implementations
void main ( )
{
// initialization code for other resources
rtos_run ( );
}


*Using RTOīs i donīt get 10 ms cycle time wich is the time i need.

*Using timer1 with pre-scaler 1:8 , preload timer :59286 and
20Mhz i get 10ms overflow.

*In arduino no problem.

TIMER1 WORKS OK FOR STEP 3, my doubt is that i have to make a "toggle" (return true...return false)like in arduino in this part:

if (micros() - last_run >= PLC_INTERVAL)
{
last_run = micros();
return true;
}
return false;
}

but i canīt use "return" inside a void, i would like to know how could i make that "toggle", i hope i made it clear, i really donņt know if it is neccesary to do this, maybe iīm just making it complicated, but the reason i ask this is because after some time in proteus simulation clock from "ANIMATING:" at the begining simulation and ANIMATING are synchronized then no, thatīs why i would like to add that "toggle".
Sun Mar 12 2017, 15:55:57
(no subject) (by Ihor Nehrutsa)
HI-TECH C TimerDemo attached.

You should use interrupt source routine Timer0 or Timer1
only for calculate datas for your own micros() function,
not for calling PlcCycle().
Then use Arduino algorithm to PIC.


static unsigned long timer1_raw_tics48_17 = 0; // Size 32 bits integer

/* service routine for timer 1 interrupt */
void interrupt timer1_isr(void)
{
timer1_raw_tics++;
TMR1IF = 0;
}
Mon Mar 13 2017, 11:59:37, download attachment timer0.c
(no subject) (by Ihor Nehrutsa)
static unsigned long timer1_raw_tics_80_49 = 0; // MSB 32 bits size

static unsigned long timer1_raw_tics_48_17 = 0; // Midle 32 bits size

// LSB is Timer1 value. // LSB 16 bits size

/* service routine for timer 1 interrupt */
void interrupt timer1_isr(void)
{
timer1_raw_tics_48_17++;
if(timer1_raw_tics48_17 == 0) timer1_raw_tics_80_49++;
TMR1IF = 0;
}

Like in Aruino
unsigned long millis()
{
//covert timer1_raw_tics_80_49,timer1_raw_tics_48_17,Timer1 value to milliseconds
}

unsigned long micros()
{
//covert timer1_raw_tics_80_49,timer1_raw_tics_48_17,Timer1 value to microseconds
}
Tue Mar 14 2017, 13:16:10
(no subject) (by Alex)
thanks for your reply Ihor, i am really checking all of this information you gave for a user like me :)
Tue Mar 14 2017, 15:25:59
(no subject) (by Alex)
do i have to use a library "#use timer() "?

#use timer(tick=.......
Fri Mar 17 2017, 23:07:39
(no subject) (by Ihor Nehrutsa)
to Alex
Yes, of course.
It's even simpler.
See ccs_c_manual.pdf page 150 Examples: ...
Sat Mar 18 2017, 06:52:32
(no subject) (by Ihor Nehrutsa)
CCS C Compiler Manual
http://www.ccsinfo.com/
Sat Mar 18 2017, 07:02:40, download attachment ccs_c_manual.pdf
(no subject) (by Alex)
To Ihor

I have used timer() library but it only works with MPLAB IDE, not with PIC C COMPILER, maybe i donīt have that library there.

I have used this code for ticks in MPLAB IDE:





#USE TIMER(TIMER=1,TICK=1ms,BITS=16,NOISR)

unsigned int16 tick_difference(unsigned int16 current,
unsigned int16 previous) {
return(current - previous);
}

void main(void) {
unsigned int16 current_tick, previous_tick;
current_tick = previous_tick = get_ticks();
while(TRUE) {
current_tick = get_ticks();
if(tick_difference(current_tick, previous_tick) >
1000) {
PlcCycle();
previous_tick = current_tick;
}
}
}



It works but the only problem is that my led blinks every 10 seconds...not 1 second as made in ansi c code.


Also i have used this code in MPLAB (the one i used in pic c compiler)



#INT_TIMER1
void timer1()
{
clear_interrupt(INT_TIMER1);
set_timer1(59286);

PlcCycle();


}
void main()
{
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
set_timer1(59286);
clear_interrupt(INT_TIMER1);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);


while(TRUE) ; // Endless loop
}

This code en pic c compiler led toogle blinks every 1 second but in MPLAB it does every 10 seconds.

PIC C COMPILER : blinks every 1 second
MPLAB IDE : blinks every 10 seconds

"with same code"
Sat Mar 18 2017, 10:48:55
(no subject) (by Alex)
I had to install Pic C Compiler version 5 to use "timer()" library, now im trying to get the 10 ms tick becuase i get led blink every 8 sec or 4 sec (10 sec in mplab IDE ) by changing numbers in #USE TIMER(TIMER=1,TICK=1ms,BITS=16,NOISR).

Being honest it was easier to use timer1 or timer0 for calling PlcCycle(), much better with timer1 because i get the 10ms tick that way i get the 1 sec blink led, but i should not use it for calling PlcCycle as Ihor said.

Iīll keep trying.
Sat Mar 18 2017, 16:04:58
(no subject) (by Alex)
i think i misunderstood everything, i thought i had to call PlcCycle because in this post at the beggining Jonathan Westhues said this:

Then in the rest of your code, you just have to define all the I/O functions (Read_U_xxx, Write_U_xxx), and call the function PlcCycle() every cycle time.

"and call the function PlcCycle() every cycle time."
Sun Mar 19 2017, 10:25:07
(no subject) (by Alex)
Hello i always make ansi c for some simple codes, but in this version i couldnīt use ladder gen, no problem about that, but when i compile i get some errors about the ansi c code.
Fri Jul 21 2017, 09:58:15, download attachment ANSI C_16F628A.rar
(no subject) (by Alex)
this is an image about that
Fri Jul 21 2017, 09:59:39, download attachment ansicerror.jpg
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):