I have been struggling with a record loop.
What is the best way to implement the following.
I have a network based Analog output device type.
I want to have the option of using that device as a TTL binary output.
I want the driver to be "smart".
Let's assume I have the following records:
ao, ai, mbbo mbbi (3-state logic high/low/undefined)
If I change the mbbo to high, the ao is set to 3.7v
If I change mbbo to low, ao is set to 1.0v
The ai is readback and mbbi is computed based on the value of ai
Now, I would like the mbbo to reflect the value of the ao
If ao is set to .5, mbbo is reset to low
If ao is set to 2.5, mbbo is undefined
If ao is set to 4.7, mbbo is set to high.
The issue is that if in the latter case mmbo is set to high, ao will be
changed from 4.7 to 3.7v. If mbbo is set to low, ao is switched back to
1v.
Is the sync'ing of ao and mbbo an unreasonable request?
If not, how would you do that?
--
Emmanuel