DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
Sweiskittel

I am using data from a TCP/IP to determine if a part passes or fails so that the UR can place it correctly. The socket works correctly throughout the rest of the program. The socket takes a command "Dio 2 ?" and returns "Dio 2 = OFF" or "Dio 2 = ON" based on the status of the output. I then concatenate the string at the 8th character: str_sub(socket_read_string("gagemate"),8). This leaves me with a string of "ON" or "OFF". When I try to compare the string to another string I always get back FALSE. I am using the popups to show the values of Part_Pass, Part_Fail, PartPassCheck, and PartFailCheck. Regardless of the values of Part_Pass and Part_Fail, the checks always return false.This method is how I have checked other inputs in the program (see below) but does not seem to be working here. Is there something else that I need to be doing or is there some simple error that I missed?

     Part Status Check
       Part_Pass≔"OFF"
       Part_Fail≔"OFF"
       socket_send_line("Dio 2 ?","gagemate")
       Part_Pass=str_sub(socket_read_string("gagemate"),8)
       socket_send_line("Dio 3 ?","gagemate")
       Part_Fail=str_sub(socket_read_string("gagemate"),8)
       Popup
       Popup
       PartPassCheck≔Part_Pass≟"OFF"
       Popup
       PartFailCheck≔Part_Fail≟"ON"
       Popup
       If Part_Pass≟"ON" and Part_Fail≟"OFF"
         Popup
       ElseIf Part_Pass≟"OFF" and Part_Fail≟"ON"
         Popup
       Else
         Popup
Here is a working check at a different section in the program
 Check Input
               GM_Status≔"OFF"
               Loop GM_Status≟"OFF"
                 socket_send_line("Dio 1 ?","gagemate")
                 GM_Status=str_sub(socket_read_string("gagemate"),8)
                 Wait: 0.01
               socket_send_line("Dio 17 ON","gagemate")
               socket_read_string("gagemate")
               Wait: 0.1
               socket_send_line("Dio 17 OFF","gagemate")
               socket_read_string("gagemate")