LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compteur

Hello everyone
 

I have products with different references such as A1, A2, A3, etc. I scan these references using a Zebra scanner.

 

I would like to create a counter that ignores any reference that has already been scanned.

 

Does anyone have an idea, please?

 

Fredo123Danzel_0-1779449119099.png

 

0 Kudos
Message 1 of 7
(275 Views)

We cannot debug picture. Overlapping wires and structures, no indication what you mean by "references", local variables where we have no idea where the terminal is. A feedback node that makes no sense, etc.

 

Please attach your VI, give some reasonable inputs. typically placing items in a "set" would be easiest to tell if an item already exists.

0 Kudos
Message 2 of 7
(248 Views)

You recently posted about problems installing LabVIEW 2021.  If you were successful, and your code uses LabVIEW 2021, then please submit your code using that version.  Note that experienced LabVIEW developers probably have not (yet) installed the latest version of LabVIEW, and won't be able to open code saved (for example) using LabVIEW 2026.

 

Bob Schor

0 Kudos
Message 3 of 7
(168 Views)

Hello everyone,

 

thank you for your replies. I have just attached my .vi file, please.

 

I am using LabVIEW 2021 (64-bit).

0 Kudos
Message 4 of 7
(146 Views)

My program compares each scanned reference with the previously scanned reference. If the current reference is different from the previous one, the counter is incremented by 1; otherwise, no action is taken.

 

I also want the counter to be saved when exiting the while loop, as this persistence step is currently not implemented.

0 Kudos
Message 5 of 7
(128 Views)

You are in the right direction. you latest vi is like a buffer. it increments whenever the two conditions are met, the new scan is different from zero and it is different from the previous. 

However, it will compare only with the latest scan included. If you need to compare with all the previous scans you need to use an array (like what you used in the first image.

 

Use this COUNTREF_With Iteration.vi to be called from the main vi 

I included a control Iteration that you can wire from the main loop, this way, when iteration is 0 (first time the vi is called, it initializes the shift register).

I included an image of the counter with iteration being called from your main vi. (There is more to be added from your logic). 

ROtake_0-1779714386488.png

 

RKO
0 Kudos
Message 6 of 7
(113 Views)

Hello  ROtake,

Thank you for your reply.

I need to integrate this logic into a state machine, at the end of my test when the product reference is validated.

 

However, I think the method I used may not be the most suitable one.

The objective is to check whether a reference has already been scanned or not.

 

Therefore, I think it would be better to store all scanned references in an array, and then check within this array whether the reference already exists before performing the counting or processing.

0 Kudos
Message 7 of 7
(89 Views)