You are not logged in.
Pages: 1
Topic closed
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.
Last edited by scoobsalamander (2018-01-14 10:49:42)
Offline
...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
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
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Thanks for the example, this solution should be working for my case as I do not need more than 16 strings.
Offline
Pages: 1
Topic closed