Pointer in Step 7

Source code example below:

Code:
FUNCTION FC 4 : VOID
TITLE =
VERSION : 0.1


VAR_INPUT
  iCounterNumber : INT ;    
  bCount : BOOL ;    
END_VAR
VAR_TEMP
  iCounterAddress : INT ;    
END_VAR
BEGIN
NETWORK
TITLE =

      L     #iCounterNumber; 
      T     #iCounterAddress; 
      A     #bCount; 
      CU    C [#iCounterAddress]; 


END_FUNCTION
 
Values are passed on functions by pointer, not by copying the value. So it needs to be loaded from memory location and saved on temporary variable as value, to avoid double pointer.
 
The pointer can be a temp variable, MW or DBW
Parameters, FB STAT variables, IW, PIW's are not permitted:

ccc.JPG
 

Similar Topics

Hi all, I'm looking for a steer using a pointer. The code is working in a fashion but i'm not setting the bit i require. The code looks at...
Replies
25
Views
5,034
Hello, Is it possible to perform operation like pointer on function. Regardless of value inside pointer or what ever variable I want to call...
Replies
2
Views
1,495
I would need advice in design which we are currently making in Step 5. Control system is based on Control modules which have defined structure...
Replies
6
Views
1,672
Hello Folks! I'm still trying to get the hang of using STL and Pointers in Step 7 (V5.5). For background, I'm writing a sample application...
Replies
7
Views
3,280
Hi guys, I am just starting to write some STL and thanks to this forum I got the solution to what i was trying to achieve. The question i have...
Replies
23
Views
9,154
Back
Top Bottom