Can I use a singleton class to handle device communication shared by two executables?
Hi everybody, I have a laser that communicates via RS232. I am interested in deploying an executable that periodically logs hardware diagnostics to a database and is always on, and in addition, deploying executables used to automate experiments that concurrently communicate with the laser.
I want to avoid a situation where in these programs attempt to access the laser simultaneously causing race conditions between write and read commands. I was thinking I could do this with a singleton class containing priority queues as an intermediate layer between the program logic and the hardware.
My question is, if I implement a singleton class and include it within a compiled executable (i.e. programs not run by hitting the start button), will the labVIEW engine make sure the same singleton is shared across executables? Also, does anyone know if this is a good way to handle this problem? Is there a better way to do this?
Posted Feb 21, 2016, 9:40 PM UTC