Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to view Compensation Table Data in C PLC
In general you will need to be careful with this as you just have a pointer to the data. If you have 1D 2D or 3D tables the data will be organized differently.

Also you should not expect to be able to build tables this way, only view the data, and perhaps change existing data. But you can not change the size of any table or add tables or remove tables. To do any of this it is best to go through the ASCII interface using GetResponse()

#include <RtGpShm.h>
#include <stdio.h>
#include <dlfcn.h>

#include "../../Include/pp_proj.h"

void user_plcc()
double dVar1;
float *pData;

dVar1 = pshm->CompTable[0].Nx[0];
pshm->P[1] = dVar1;
pData = pshm->CompTable[0].Data + OffsetTblSHM; // include offset for GP memory side access
pshm->P[10] = *pData;
pshm->P[11] = *pData++;
pshm->P[12] = *pData++;

Forum Jump:

Users browsing this thread: 1 Guest(s)