Originally posted by mk42:
If this is a safety system,...
Hey Ronwelcome to the forum ...
this is the code from an Add-On Instruction that I use for testing various analog devices ... the output signal could be fed into an analog output module – which (if properly scaled) should give you the 4 to 20 milliamp output that you requested ...
.
Is there a piece missing?
Holy dyslexia batman, How did I miss that?? You know that part of brain that ignores duplication.... that must have come into play here. I looked at that a dozen times......(Wave_Max-Wave_Min)/2))+(((Wave_Max-Wave_Min)/2)+Wave_Min)
Good luck
Where does the 6.283185xxx value come into play? 2 x Pi right?
One benefit to this method is that when the big number reached its end and resets, the waveform is disturbed.