05-10-2022 09:57 AM
Hello,
I've got a problem:
I want to run two different devices simultaniously and control them/collect data from them. Now I've put together a while loop. In this while loop I've put an event structure. In this event structure I have 4 cases, In two of them I 'open' the devices via VISA RESOURCENAME they then each continue into the next event cases where all the executing and data collection takes place (These run in a loop, because I read out pressure values for example). The execution/collection cases get activated by a boolesch.
Now this runs perfectly fine, when I just run one of these devices, I can also open both devices, but when I activate one of the cases, which contain the loops for the execution stuff. I can't run the other until I stop the loop.
But I need to run both simultaniously (they don't need to be synced).
I hope you understand what I'm doing, I'm sorry I'm still a big rookie.
So my question is how can I fix this, that I can run both loops at once?
It would be amazing if somebody could help me here.
Don't be irritated by all the other cases, they are for other sensores, but the principles are the same.
(I used the IMG400 LabView package from pfeiffer)
Cheers
Dennis
05-10-2022 10:04 AM - edited 05-10-2022 10:05 AM
Your inner while loops are not independent at all! Any of these event cases cannot complete until the while loop inside has completed and only then another event can occur.
You need to start with learning dataflow basics and fully understand it. Your code is completely wrong in so many ways.
05-11-2022 10:25 AM
It's also recommended to read about Caveats and Recommendations when Using Events in LabVIEW.
05-11-2022 10:58 PM
Dennis, would you consider separate top-level VIs for each device you are controlling? Sure, you might have lots of different stop buttons to push when you want to stop everything, but I think simple apps (VIs) for each device are the quickest paths to success. You can combine functionality into one VI as time and learning allow.