Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

RFID data filtering

stijn
2015-07-30
2015-08-03
  • stijn - 2015-07-30

    Hello is there some people who can help me concerning Array and data funtions:(RFID data filtering)

    If we have new tags, then we need to add the counter to 3 and the status to 1(new)
    after that we need to have a 2nd inventory
    we need to do the counter -1 after the first inventory round
    if the counter is equal to 0 then we need to add the status to (2 delete)
    We need to send only the incomming(new tags) and (deleted tags)data after losing 3 times
    example: tag [ data1..12,counter,status]

    1: ( add new tags to databse with tag counter 3 + add status 1(new) if not existing in database )
    ( search for duplicates if not add tag counter 3 and status 1)

            FOR a:=0 TO 11 BY 1 DO
    
                tag[a,1]    :=datanew[((a)*12)+1];
                tag[a,2]    :=datanew[((a)*12)+2];
                tag[a,3]    :=datanew[((a)*12)+3];
                tag[a,4]    :=datanew[((a)*12)+4];
                tag[a,5]    :=datanew[((a)*12)+5];
                tag[a,6]    :=datanew[((a)*12)+6];
                tag[a,7]    :=datanew[((a)*12)+7];
                tag[a,8]    :=datanew[((a)*12)+8];
                tag[a,9]    :=datanew[((a)*12)+9];
                tag[a,10]   :=datanew[((a)*12)+10];
                tag[a,11]   :=datanew[((a)*12)+11];
                tag[a,12]   :=datanew[((a)*12)+12];
    
    
    
            END_FOR
    
            IF a>11
            THEN
            i:=2;
            END_IF
    

    )
    2: (
    sending new tags with status 1*)

            i:=25;
    
    25: (*sending delete tags with status2*)
    
            i:=26;
    
    
    26:  (*cleaning db,delete status new, status 1 to 0*)
    
            i:=27;
    
    27:  (*celaning db, counter -1 if tag is not existing anymore*)
    
            i:=28;
    
    28:  (*cleaning db, putting the tags to status 2, of the counter is equal to 0*)
    
            i:=29;
    
    
    29:   (* go to case 30*)
    

    help data.pro [31.3 KiB]

    help data.pro [31.3 KiB]

     
  • PJE - 2015-08-02

    It should be noted that 'a' will be 12 after the FOR loop. Therefore 'i' will always be set to 2.

    I'd write this as a nested FOR loop rather than having 12 repetitions which could be replaced by a second loop.

    The rest of the post is a little cryptic to help. If you can explain more clearly I could help. I use a Turck RFID read/write head on a BL20 under V2.3.

     
  • shooter - 2015-08-03

    IF a>11
    THEN
    i:=2;
    END_IF

    is not needed.
    as the for loop will always be finished before the program goes on.
    I see tag arrays with 500, but i think it should be in some cases 500/12. so 37 or so.

    what is the problem you are having as this piece is correct.

    the case is good, with leaving open some space for insertions.

    your planning is good, but you need more comments in your program.

     
  • stijn - 2015-08-03

    PJE hat geschrieben:
    It should be noted that 'a' will be 12 after the FOR loop. Therefore 'i' will always be set to 2.
    I'd write this as a nested FOR loop rather than having 12 repetitions which could be replaced by a second loop.
    The rest of the post is a little cryptic to help. If you can explain more clearly I could help. I use a Turck RFID read/write head on a BL20 under V2.3.

    PJE: if you want i can send you the complete program, to explain more in detail what is needed.
    please send me some email to e info@stijn.sg e

     

Log in to post a comment.