RobotStudio event

Reading Bar Codes to identify programs

Has anyone ever used bar code scanners to call programs?

Comments

  • I don't know what you really want to do. We build one machine for testing tires. Each tire has different dimensions and this is read by bar code scaner. Dimensions are send through the PLC via profibus to robot. Robot program is still running but with different parameters.
  • Hi
    I have used a barcode handscanner connected to the serialport on a S4C+ controller to read the barcode info.
    It was used as a identifier for some meassuring values that later on was written to a DB on a PC.
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • Not sure about using bar code scanners but I imagine whatever you scan can be translated into a group signal for example.  If you establish a product matrix associated with a unique identifier in that group signal then you can easily load and unload program modules.  The number of bits in your group signal will determine how many individual programs you can call.  For example here is something I am using:

      PROC rRUNMODEL_S()
        TEST nMODEL
        CASE 98:
          !MODEL NUMBER 98: RUNS A TEST SEARCH;
          Load "HOME:/MODELS/STBD/SEARCH_S.MOD";
          %"mainSEARCH_S"%;
          UnLoadSave,"HOME:/MODELS/STBD/SEARCH_S.MOD";
        CASE 240:
          !MODEL NUMBER 240: RUNS A 240DA HULL PROGRAM;
          Load "HOME:/MODELS/STBD/H240DA_S.MOD";
          %"mainH240DA"%;
          UnLoadSave,"HOME:/MODELS/STBD/H240DA_S.MOD";
        CASE 250:
          !MODEL NUMBER 250: RUNS A 250SLX HULL PROGRAM;
          Load "HOME:/MODELS/STBD/H250SLX_S.MOD";
          %"mainH250SLX"%;
          UnLoadSave,"HOME:/MODELS/STBD/H250SLX_S.MOD";
        CASE 260:
          !MODEL NUMBER 260: RUNS A 260DA HULL PROGRAM;
          Load "HOME:/MODELS/STBD/H260DA_S.MOD";
          %"mainH260DA"%;
          UnLoadSave,"HOME:/MODELS/STBD/H260DA_S.MOD";
        CASE 261:
          !MODEL NUMBER 261: RUNS A 260SD HULL PROGRAM;
          Load "HOME:/MODELS/STBD/H260SD_S.MOD";
          %"mainH260SD"%;
          UnLoadSave,"HOME:/MODELS/STBD/H260SD_S.MOD";
        ENDTEST
        MoveAbsJ jHOME1_S,v1000,fine,tSPINDLE_S;
        IF giMODEL=99 THEN
          Set do_030HOME_s;
          Reset do_019HKEEP;
        ELSE
          !CONTINUE
        ENDIF
        RETURN;
      ENDPROC

    Thanks,
    ACB
  • What directory does HOME refer to?
  • HOME refers to /hd0a/"your system name"/:
    Thanks,
    ACB
  • oops...

    HOME is actually /hd0a/"your system name"/HOME:

    Thanks,
    ACB
  • hello, i have tried to use the barcode scanner like mr PerSvensson, but my program it stops at
     ! write the first 5 characters to FlexPendant
    TPWrite ReadStrBin (channel, 5);

    does anybody have any ideea, i have make de setup for barcode, 9600, 8 bits, stop bit 1 and all the settings but it seen like de computer does not receive nothing to display on flexpendat



    MODULE nustiu
        
    PROC Main()
    VAR iodev channel;
    VAR string text;
    VAR num bindata;
    VAR robtarget target;
    Open "COM2:", channel \Bin;
    ! Clear input buffer for com2
    ClearIOBuff channel;
    ! Wait for input from com2 and then
    ! write the first 5 characters to FlexPendant      
    TPWrite ReadStrBin (channel, 5);

    !the program stop at up line

    ! Read the new line character
    text := ReadStrBin (channel, 1);
    ! Read the next input, interpreted as robtarget
    ! and move robot to that target
    ReadAnyBin channel, target;
    MoveJ target, v20, fine, tool0;
    ! Read text one character at the time
    ! until end of file
    bindata := ReadBin(channel);
    WHILE bindata <> EOF_BIN DO
    text := text + ByteToStr(bindata\Char);
    bindata := ReadBin(channel);
    ENDWHILE
    TPWrite text;
    Close channel;
    ENDPROC
    endmodule