08-29-2018 12:22 PM
In my program, I am reading pressure transducer data from a analog input. The pressure data needs to be input to another while loop which is analog output. The two loops are running at a different frequencies. The read running slower than the write. The analog output is variable and depends on the analog input. I have set up a case structure that helps determine the analog output according to different ranges of the input. What would be the best way to transfer data between these two loops. I am thinking either notifiers or local variables. The read loop would already determine the case, just need to choose the same case in the write loop. I have attached what I think the loops would look like with local variables. I am just wondering what the better way to do this would be since the loops are running at different speeds.
Thanks,
Harsh
08-29-2018 01:12 PM
Since the Write loop only cares about the latest value, I would just use a Global Variable.
08-29-2018 01:41 PM
Yes, the global variable looks like a good option, I used it using a simple numeric control instead of pressure data and it seemed to work. But using a notifier caused issues as I think the the case would switch to default in the increments where no notifications were being received.