Robot send to, script
Posted: Tuesday 05 July, 2016 - 13:53
Hi,
I am trying to write some 4d script code for a robot. What I want is that products will be sent to a "server1" through output channel 1 if "server1"'s status is IDLE and to a second server through output channel 2 if "server1" is BUSY. I have written the following code that produces different messages in order for me to understand what values are being returned.
Do(
var([st5],vbstring,statusname(status(out(1,c)))),
msg(st5),
if
(
st5=[Idle],
msg([1]), msg([2])
)
)
For the first product the messages "IDLE" and later "1" appears. For the 2nd product the message is "BUSY" or sometimes "BLOCKED" and later "1" againg apperars. For the 2nd product the status of "server1" is not IDLE but the 2nd message displayed is "1" and not "2". Why and how can i fix it? would be grateful if someone could help
/Emil
I am trying to write some 4d script code for a robot. What I want is that products will be sent to a "server1" through output channel 1 if "server1"'s status is IDLE and to a second server through output channel 2 if "server1" is BUSY. I have written the following code that produces different messages in order for me to understand what values are being returned.
Do(
var([st5],vbstring,statusname(status(out(1,c)))),
msg(st5),
if
(
st5=[Idle],
msg([1]), msg([2])
)
)
For the first product the messages "IDLE" and later "1" appears. For the 2nd product the message is "BUSY" or sometimes "BLOCKED" and later "1" againg apperars. For the 2nd product the status of "server1" is not IDLE but the 2nd message displayed is "1" and not "2". Why and how can i fix it? would be grateful if someone could help
/Emil