bluffit
Member
From memory in C I would have done something like this:
char * a = (char*) malloc(1024 * sizeof(char));
char * b = (char*) malloc(1024 * sizeof(char));
int i=0;
// set some values up in *a.
// apply a function and assign to *b
while( i++ < 1024){
b = foo(a)
}
The question is, how would I do this in Ladder logic with Vxxxx addresses?
Something like this?
FOR (k=100) -------------------------------->
LD V2000 + (k-1) // I see that k = 1 on iteration 1.
// Do something with the accumulator value
OUT V2100 + (k-1)
NEXT <---------------------------------------
Thanks, hopefully this is a simple one. Am using DirectSoft5.
char * a = (char*) malloc(1024 * sizeof(char));
char * b = (char*) malloc(1024 * sizeof(char));
int i=0;
// set some values up in *a.
// apply a function and assign to *b
while( i++ < 1024){
b = foo(a)
}
The question is, how would I do this in Ladder logic with Vxxxx addresses?
Something like this?
FOR (k=100) -------------------------------->
LD V2000 + (k-1) // I see that k = 1 on iteration 1.
// Do something with the accumulator value
OUT V2100 + (k-1)
NEXT <---------------------------------------
Thanks, hopefully this is a simple one. Am using DirectSoft5.
Last edited: