Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLI functions are blocking for each other #8

Open
CvanLeeuwenFt opened this issue Apr 10, 2020 · 1 comment
Open

SLI functions are blocking for each other #8

CvanLeeuwenFt opened this issue Apr 10, 2020 · 1 comment

Comments

@CvanLeeuwenFt
Copy link
Collaborator

CvanLeeuwenFt commented Apr 10, 2020

Calling a function in a second RoboPro process blocks the execution of the first.
Which one has been blocked, depends on the first who is executed. However both init's are executed well. This only when they are executed almost on the same time.
Normal RoboPro elements are not blocking.

All the SLI functions has an empty body, only a cout to the console.
SLIproblem2

@CvanLeeuwenFt
Copy link
Collaborator Author

CvanLeeuwenFt commented Apr 10, 2020

The SLI .so and source
libTxtSliSave4.zip

And the .rpp
test2A.zip

/*  Copyright (c) 2019-2020 C. van Leeuwen
 */
#include <exception>
#include <cstring>
#include <string>
//#include <array>
#include <iostream>       // std::cout
#include <fstream>
#include <sstream>
#include <thread>         // std::thread
#include <vector>

#include <stdio.h>          // for printf()
#include <unistd.h>         // for sleep()
#include "KeLibTxtDl.h"     // TXT Lib
#include "FtShmem.h"        // TXT Transfer Area see KeLib header
using namespace std;
//using namespace fischertechnik::TXT::Robot;

unsigned int DebugFlags;
FILE *DebugFile;
static bool IsInit = false;

static int X = 0, Y = 0, Z = 0, R = 0;

extern "C" {

// Return value:
//  0: success, continue with waiting for pFinishVar becoming 1
//  1: not finished
//  2: busy (entity locked by other process)
// -1: error
// Other positive values can be used for other waiting codes
// Other negative values can be used for other error codes
int init(short *t) {
	if (!IsInit) {
		//X = 0; Y = 0; Z = 0; R = 0;
		IsInit = true;
		//printf("*****init:  Set has been done\n");
	} else {
		//printf("*****init: Was already done ");
	}
	return 0;
}

int getVecWriteShort(short *t) {

	//printf("***** coor.save\n");

	*t =3;// coor->getCount();
	return 0;
}

int setVecSaveShort(short n) {
	//coor->writeToFile(n);
	//printf("***** VecSave stop \n");
	return 0;
}

int setVecSave2Short(short n) {
	//printf("***** VecSave2 stop \n");
	return 0;
}

int getFnLastErrorShort(short *t) {
	*t = 0;//LastError;
	return 0;
}

int setCoorXShort(short t) {
	//printf("*****  CoorX\n");
	X = t;
	return 0;
}
int setCoorYShort(short t) {
	//printf("*****  CoorY\n");
	Y = t;
	return 0;
}
int setCoorZShort(short t) {
	//printf("*****  CoorR\n");
	Z = t;
	return 0;
}
int setCoorRShort(short t) {
	//printf("*****  CoorR\n");
	R = t;
	return 0;
}
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant