Sending a trigger:
socket_send_string(“SW8”, socket_name)
socket_send_byte([13,10], socket_name)
triggerstatus = socket_read_line(socket_name)
if triggerstatus == “1”:
textmsg("Trigger successful: ", triggerstatus)
else:
textmsg("Trigger failed: ", triggerstatus)
end
returns a trigger failed with a trigger status of -2
Insight help just gives “Command Cannot Be Executed” as the explanation for error code -2.
I have copy pasted the code from the integration practicum, and manually set a string in cell C20. Communication between the robot and cognex works, a few lines in the copy pasted code:
socket_send_string(“GVC020”, socket_name)
socket_send_byte([13,10], socket_name)
getvaluestatus = socket_read_line(socket_name)
if getvaluestatus == “1” :
textmsg("GetValue successful: ", getvaluestatus)
else:
textmsg("GetValue failed: ", getvaluestatus)
end
sleep(1)
rec = socket_read_ascii_float(3, socket_name)
returns the value i have put in cell C20.
What am i missing/how do fix?