Pointers

Benton

Member
Join Date
Oct 2010
Location
Baton Rouge
Posts
34
Hi everyone,

This is my first thread. I was wondering if someone could "point" me in the right direction when it comes to pointers and plcs. I am working with a Click Koyo program. It doesn't have to be Click related. Thanks in advance!
 
Unfortunately you are working with one of the most limited 'pointer' PLCs. The only instruction available for 'pointers' is the Single Copy instruction.

Many variables in a PLC have a numeric component to their identification. For some the 'address' is directly related to the variable absolute location within the PLC's CPU memory structure. If the PLC accepts a 'pointer' it will be the actual address of a 'target variable' which is contained in another variable of a suitable size. (A variable capable of holding only one bit obviously would not be suitable as a pointer.) The 'target variable's' value would be read or modified by a suitable instruction which uses the 'pointer' variable. If you know the CPU's addressing structure then you may be able to calculate a proper pointer to another variable, possibly by incrementing but also by other suitable math.

Some blocks of variables are set aside and ONLY referenced by using a number to indicate their position within the block. The number may be literal, e.g. '5', or a variable containing a valid position. These blocks may be called 'arrays'. An array named 'stuff' which has 100 elements may have one of its elements accessed by 'stuff[23]' or by 'stuff[variable]' as long as the value in 'variable' is maintained within the bounds of the array. Attempting to access a location which would be outside the array may result in a serious error. In the case of arrays the value within [] is referred to as an index. It has the same idea as a pointer especially if the index is a variable. As a note, the Click's 'pointer' is closer to this concept of 'index' as all variables within the Click are automatically treated as being in arrays.
 

Similar Topics

Hello, I've just came out of a call where a program that was modified two weeks ago threw the processor into fault. The program has been done...
Replies
9
Views
3,464
I'm trying to get a 5069-L306er to talk to a Automation Direct ProSence Controller by using RA's AOI for modbus client but its stuck not getting a...
Replies
9
Views
1,878
The last time I did anything with Wonderware was just after the dot com bust. Boy, I feel old. Anyway, it looks like I will get the chance to...
Replies
3
Views
1,512
Hi guys, Some pointers needed: Having PC with WIN7 pro X64 and Amsamotion clone of 6ES7 972-0CB20-0XA0 cable and need to backup VIPA cpu...
Replies
14
Views
3,112
Is there any form of Reference Type or Pointer Type like Codesys has? I am aware that you can nut a tag in the index of an array reference. but...
Replies
7
Views
1,886
Back
Top Bottom