Current Auto offset update

PowerScript

make the current offset adjustment as a function. by using for loop, removed unnecessary lines.

main 0 files
Current Auto offset …..js
Current Auto offset …..js 488 bytes
AutoCurrentOffset(Gain Value) //Gain Value = 6 or 9, internal only


function AutoCurrentOffset(CA_Gain){
	for(var i=0; i<2; ++i){
		var CurrentOffset = [
			0, 
			spm.readChannelAveraged('current', 100, 5)
		]

		var CurrentAmpSetting = {
			 "id": "park.nx.linear.dc",
			 "nx": { 
				"linear": {
					 "preGainPower": CA_Gain,
					 "postGainPower": 0,
					 "currentOffset": CurrentOffset[i] 
					}
				}
			};
		spm.currentamp.config = CurrentAmpSetting
	}
}
Comments (0)

No comments yet. Be the first to comment!

Snippet Information
Author: edward.park
Language: PowerScript
Created: Sep 15, 2026
Updated: 0 minutes ago
Views: 5
Stars: 1