Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-01-13 22:34:42

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

How to use Subsystem mask parameters in REXLANG FB?

I have assigned several Subsystem mask parameters (string) and now I want to use them inside a REXLANG function block which is inside the same subsystem.

What is the best way to do this?


I wanted to use GetExtString together with a CNS FB but I have problems to use the string inside the REXLANG FB. If I send it straight to an output then it is working fine but if I assign it to a string variable I always get an error.

This is working fine :

string output(0) dataOut;

long init(void)
{	
	return 0;
}

long main(void)
{
	dataOut = GetExtString(".CNS_IN1_name:sy");
	return 0;
}

long exit(void)
{	
	return 0;
}

For the following code I always get the error code -504:Invalid numeric address);

string output(0) dataOut;

string tempString[20];

long init(void)
{	
	return 0;
}

long main(void)
{
	tempString = GetExtString(".CNS_IN1_name:sy");	
	dataOut = tempString;
	return 0;
}

long exit(void)
{	
	return 0;
}

...and if I replace

tempString = GetExtString(".CNS_IN1_name:sy");

by

tempString = "testString";

then it is working fine again.

BTW, I also think that the following is not correct inside the REXLANG docu.

2018-01-13-22_32_41-REXLANG--User-programmable-block.png

Last edited by scoobsalamander (2018-01-14 10:49:42)

Offline

#2 2018-01-14 11:26:00

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: How to use Subsystem mask parameters in REXLANG FB?

...if I try the same with GetExtDouble() it is also working, I think there is something I'm doing wrong with handling strings or maybe it is a bug?

Offline

#3 2018-01-16 08:56:28

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: How to use Subsystem mask parameters in REXLANG FB?

Dear scoobsalamander,
I was able to replicate your problem. Our developers are investigating the root cause of it.

In the meantime, here is an example on using string parameters from subsystem mask inside the REXLANG code (without using the CNS function block). The CNS block is present in the example project but it is not used anywhere.

And thanks for spotting the copy-paste error in the documentation.

Let me know if this solves your needs.

Kind regards,
Jaroslav

Offline

#4 2018-01-16 09:23:44

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: How to use Subsystem mask parameters in REXLANG FB?

Thanks for the example, this solution should be working for my case as I do not need more than 16 strings.

Offline

Board footer

Powered by FluxBB