I am working on an automation project where I need to handle 21 fixed mount bar-code scanners in parallel(i.e. all the scanner will be running all the time) to achieve that I am using multi-threading. Here each thread will handle one bar-code scanner.
Now, I want to update the scanned data in P.L.C (DB/Memory Blocks/Tags) by using O.P.C. So, I wanted to know is it possible to update P.L.C values by using O.P.C client in a multi-threaded application.
I am using Siemens P.L.C ( Model :- CPU 315-2 PN/DP, step 7, 300 series).
I would also like to know whether I should go with O.P.C Server or LibNoDave. there will be around 300 tags (Data blocks in P.L.C) which I need to read and check for Data Change event.
Better keep your architecture as simple as possible and avoid lots of threads, multithreading can unnecessarily complicate things and there is also a performance price to pay in case the threads need to synchronize. Since you have one OPC server and multiple threads connecting to it you will have to be careful not having the threads interfere with each other. If I were you I would instead have one thread that sets up a subscription to the OPC server with all the barcode scanners. Then another thread to monitor that thread to see if it is still working.