BASIC Moves Development Studio
06/2005
Danaher Motion
44 Rev
E
M-SS-005-03l
{
return (D + L + atoi(S));
}
void CFUNC_VVALP(char* S, double D, int L)
{
int fd = open("/tyCo/1",2,0);
fdprintf(fd,"Original Values:%d, %f, %s\r\n", L, D, S);
L = 10;
D = 22.2;
strcpy(S,"VValP");
fdprintf(fd,"New Value:%d, %f, %s\r\n", L, D, S);
close(fd);
}
/* By Reference Parameters */
double CFUNC_DREFP(char** S, int* L, double* D)
{
return (*D + *L + atof(*S));
}
2.5.3. Special
Considerations
Motion and System properties can only be passed by value.
KILLTASK
will not unblock a task locked inside the C-function. An endless
block on a semaphore, message queue, etc. inside a C-function prevent sa
task from correct being killed. If C-function has some blocking operation
system call (
taskDelay
(),
semTake
(),
msgQGet
(),
msqQSend
(), IO operation,
etc.), this may interfere with killing the user task.
When an object module is loaded several times without unloading, all its
instances are kept in the RAM, while the system symbol table has references
only to the resent instance. MC-Basic applications may refer to the obsolete
version of some modified object file.
OUNLOAD
does not check to see if the object file is in use. It is your
responsibility to ensure that the object is not unloaded as long as there tasks
and libraries that refer to the object.
Consider following example, both the program TASK1.PRG and
TASK2.PRG use the same function from object module.
Æ
oload my_obj.o
Æ
load TASK1.PRG
Æ
send my_obj.o ‘ send updated version of object file
Æ
oload my_obj.o
Æ
load TASK2.PRG
In this example, TASK1.PRG references the oldest instance of my_obj.o
while TASK2.PRG references the recent version.