I needed to send and receive strings between robot and Keyence 3D vision sensor for Bin-Picking. I often send the trigger scan signal as soon as robot is outside the container area so that sensor controller has enough time for the calculation of the next part(s) to pick during the time robot is doing other jobs like placing in the machine etc. When robot is back in Home position it will request the calculated next pick-positions from sensor.
This time because of a very small cycle time robot needs to obtain the next data from vision sensor as soon as possible in advance for background calculation during other jobs. I have created a state machine in a .sub file for background communication using submit interpreter.
Here is my problem:
Each time a string should be written in buffer strBuf[] but the buffer is always empty after the command is run.
Running the same program with robot interpreter works fine but at cost of time(up to 2.5 Sec), but by using a submit interpreter:
SWITCH subStep
.
.
CASE 4
bOk = STRCLEAR(strBuf[])
nOffset = 0
SWRITE(strBuf[], state, nOffset, "TPR,101,0,%d,1", nLoopCnt)
subStep = subStep + 1
CASE 5
KeySendString(strBuf[])
subStep = subStep + 1
.......
CASE 6
KeyRecvStringSub(strBuf[])
.
.
ENDSWITCH
Display More
My first thought is, it needed more time to perform this than cyclic time submit interpreter allows so no string is received after executing KeySendString(strBuf[]). Is there a way I can get this done correctly?
Thanks