27 if(shared_memory == NULL)
50 f = (
float *) ptr +
sizeof(
int)*
max_int*2;
57 printf(
"ERROR: rlPlcState sharedMemoryStatus(%s) is not OK\n", shared_memory);
81 if(
i != NULL) memset(
i ,0,
sizeof(
int)*
max_int);
98 if(index<0 || index >=
max_int)
return 0;
99 if(
i[index] ==
i_old[index])
return 0;
105 if(index<0 || index >=
max_float)
return 0;
106 if(
f[index] ==
f_old[index])
return 0;
113 if(
d[index] ==
d_old[index])
return 0;
119 if(index<0 || index >=
max_int)
return 0;
120 if(
i[index] >
i_old[index])
return 1;
126 if(index<0 || index >=
max_float)
return 0;
127 if(
f[index] >
f_old[index])
return 1;
134 if(
d[index] >
d_old[index])
return 1;
140 if(index<0 || index >=
max_int)
return 0;
141 if(
i[index] <
i_old[index])
return 1;
147 if(index<0 || index >=
max_float)
return 0;
148 if(
f[index] <
f_old[index])
return 1;
155 if(
d[index] <
d_old[index])
return 1;
161 if(index<0 || index >=
max_int)
return 0;
162 return i[index] -
i_old[index];
167 if(index<0 || index >=
max_float)
return 0;
168 return f[index] -
f_old[index];
174 return d[index] -
d_old[index];
179 if(index<0 || index >=
max_int)
return;
180 i[index] =
i[index] | bit;
185 if(index<0 || index >=
max_int)
return;
186 i[index] =
i[index] & ~bit;
191 if(index<0 || index >=
max_int)
return 0;
192 if(
i[index] & bit)
return 1;
198 if(index<0 || index >=
max_int)
return 0;
199 if(
i[index] & bit)
return 0;
205 if(index<0 || index >=
max_int)
return 0;
208 if(
i_old[index] & bit)
return 0;
216 if(index<0 || index >=
max_int)
return 0;
217 if((
i[index] & bit) == 0)
219 if((
i_old[index] & bit) == 0)
return 0;
242 if(index<0 || index >=
max_int)
return 0;
248 if(index<0 || index >=
max_float)
return 0;
260 if(index<0 || index >=
max_int)
return 0;
266 if(index<0 || index >=
max_float)
return 0;
380 if(
i & bit)
return 1;
386 if(
i & bit)
return 0;
394 if(
i_old & bit)
return 0;
404 if((
i_old & bit) == 0)
return 0;
rlPlcState(int numInt=100, int numFloat=100, int numDouble=0, const char *shared_memory=NULL)
int intChanged(int index)
float deltaFloat(int index)
int floatChanged(int index)
int doubleChanged(int index)
float getFloat(int index)
int doubleHasDecreased(int index)
float getOldFloat(int index)
int isSet(int index, int bit)
int hasBeenSet(int index, int bit)
void set(int index, int bit)
int floatHasDecreased(int index)
int intHasDecreased(int index)
double getOldDouble(int index)
int doubleHasIncreased(int index)
double getDouble(int index)
double deltaDouble(int index)
int hasBeenCleared(int index, int bit)
int floatHasIncreased(int index)
int isClear(int index, int bit)
int intHasIncreased(int index)
int hasBeenCleared(int bit)