works
Ok yes now the loop has stopped when I set sum to zero before the for loop. Why will it retain the sum value from the last call?
Ok yes now the loop has stopped when I set sum to zero before the for loop. Why will it retain the sum value from the last call?
I am adding elements of an ARRAY using pointer to access each element inside a FOR loop and the FOR loop does not stop! What is the right way to use pointers in such case?? I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case?? I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR VAR_IN_OUT // basically REFERENCE TO...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case! I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR VAR_IN_OUT // basically REFERENCE TO window_buffer:...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case! I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR VAR_IN_OUT // basically REFERENCE TO window_buffer:...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case! I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. METHOD FB_Init: BOOL VAR_INPUT bInitRetains: BOOL; // TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode: BOOL; // TRUE: the instance will be copied to the copy code afterward (online change) END_VAR VAR_IN_OUT // basically REFERENCE TO window_buffer:...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case! I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. FUNCTION_BLOCK FB500 VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR windowPtr: POINTER TO INT; piPtr :POINTER TO ARRAY[0..9] OF INT; windowSize: DINT; currentIndex: UINT; element1:INT; element2:INT; i:INT; j:INT; sum:DINT:=0; END_VAR element1:=windowPtr[0]; // read the first...
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case! I have another loop that is not using pointer and it stops but the loop using pointer keep on adding. https://ibb.co/k3DhkZT
https://ibb.co/k3DhkZT
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case https://ibb.co/k3DhkZT
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case
I am adding elements of an ARRAY using pointer and the FOR loop does not stop! What is the right way to use pointers in such case
Hi
**Guys I am new to codesys. Here the FB MyMovingAvg has a single Input ( nextNum: INT;) However in the main program this FB has been initialized with an ARRAY of INT Is this, Ok? and how will it access the next elements of the Array? ** Will more code will need to be written in the main program to make it able to get rest of the elements of array? Basically this is an example of dynamic memory Could someone explain me how all these work together FUNCTION_BLOCK MyMovingAvg VAR_INPUT nextNum: INT;...
**Guys I am new to codesys. Here the FB MyMovingAvg has a single Input ( nextNum: INT;) However in the main program this FB has been initialized with an ARRAY of INT Is this, Ok? and how will it access the next elements of the Array? ** Will more code will need to be written in the main program to make it able to get rest of the elements of array? Basically this is an example of dynamic memory FUNCTION_BLOCK MyMovingAvg VAR_INPUT nextNum: INT; END_VAR VAR_OUTPUT avg: REAL; END_VAR VAR windowPtr:...
**Guys I am new to codesys. Here the FB MyMovingAvg has a single Input ( nextNum: INT;) However in the main program this FB has been initialized with an ARRAY of INT Is this, Ok? and how will it access the next elements of the Array? ** Will more code will need to be written in the main program to make it able to get rest of the elements of array? Basically this is an example of dynamic memory FUNCTION_BLOCK MyMovingAvg VAR_INPUT nextNum: INT; END_VAR VAR_OUTPUT avg: REAL; END_VAR VAR windowPtr:...
Hi Forum members, I am new to Codesys - however I know that Codesys has J1939 library, I have one task - I want to create an alarm Panel for a generator the engine on the generator speaks J1939.The task is to display alarms (I think it is DM1 and DM2) and also some PGN parameters on the HMI , also should be able to start stop engine and also clear faults. I am thinking to go ahead with this project with hardware that will support Programming by Codesys How easy is it to accomplish these task in Codesys...