{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)6da06f08-747c-4a6c-8085-0895500046cd","ParentGuid":"(Guid)74ccca2f-50e3-4d5a-9d7a-9fd420284f83","Name":"(string)atLoadCellOld","Properties":{"@Type":"2c41fa04:IDictionary","@Value":[{"@Key":"(Guid)829a18f2-c514-4f6e-9634-1df173429203","@Value":{"@Type":"829a18f2","@Value":{"ParentObjects":{"@Type":"fa2ee218:IDictionary","@Value":[{"@Key":"(Guid)d9b2b2cc-ea99-4c3b-aa42-1e5c49e65b84","@Value":"(Guid)8e69f85d-a7ac-40ab-b0a3-3454b144d0b4"}]}}}}]},"TypeGuid":"(Guid)6f9dac99-8de1-4efc-8465-68ac443b7d08","EmbeddedTypeGuids":{"@Type":"[Guid]","@Value":["(Guid)a9ed5b7e-75c5-4651-af16-d2c27e98cb94","(Guid)3b83b776-fb25-43b8-99f2-3c507c9143fc"]}}},"TypeInfos":{"2c41fa04":"{2c41fa04-1834-41c1-816e-303c7aa2c05b}","81297157":"{81297157-7ec9-45ce-845e-84cab2b88ade}","829a18f2":"{829a18f2-c514-4f6e-9634-1df173429203}","fa2ee218":"{fa2ee218-a39b-4b6d-b249-49dbddbd168a}","Guid":"System.Guid","string":"System.String"}},"object":{"Graph":{"@Type":"6f9dac99","@Value":{"SpecialFunc":{"@Type":"0db3d7bb:Enum","@Value":"None"},"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)//Load Cell scaling and calcs, with stability calc\n\n//Ensure that mvV and Maxrange are not 0\nIF(SP.mvV = 0) THEN\n\tSP.mvV := 32.00;\nEND_IF\nIF(SP.EUMaxRange = 0) THEN\n\tSP.EUMaxRange := 32000;\nEND_IF\n\n//Calculate weight of load cells\n//EUAbs := Raw * RawMinLC  * EUMaxRange / (mvV * Vreg * RawMax) / mvMax));\nIF(SP.AutoCal) THEN\n    EUAbs := ANY_TO_REAL(i.Raw) * SP.RawMinLC * SP.EUMaxRange / ((SP.mvV * 10 * 32000) / SP.mvMax);\n    EURaw := EUAbs - SP.EUOffset;\nELSE\n    IF(i.CalMin) THEN\n        SP.RawMinLC := ANY_TO_REAL(i.Raw);\n        i.CalMin := FALSE;\n    END_IF;\n    IF(i.CalMax) THEN\n        SP.mvV := ANY_TO_REAL(i.Raw) / 10000;\n        i.CalMax := FALSE;\n    END_IF;\n    IF(SP.mvV = SP.RawMinLC) THEN\n        EURaw := 0;\n    ELSE\n        EUAbs := ((SP.EUMaxRange)*(ANY_TO_REAL(i.Raw) - SP.RawMinLC)/((SP.mvV * 10000)-SP.RawMinLC));\n        EURaw := EUAbs - SP.EUOffset;\n    END_IF;\nEND_IF;\n\n//Filter eu if time is valid\nIF (SP.FilterTime > 0) THEN\n\tEUFilter(in_cv := EURaw, in_tau :=REAL_TO_TIME(SP.FilterTime));\n\ti.EU := EUFilter.out_filt;\nELSE \n\ti.EU := EURaw;\nEND_IF\n\ni.EU := i.EU * 2.20462; //Convert to lbs\n\n//Calculate Stability\nScan();\nDeviation := (i.EU - EULast) / Scan.ScanTime_s;\nEULast := i.EU;\nStabRaw := ABS(Deviation) < SP.StabDev;\nStabTimer(IN := Stabraw, PT := T#1S * SP.StabTime);\ni.Stable := StabTimer.Q;\n\n//Auto Zero - Auto zero loadcell when stable and near zero for 10 sec.\nIF(SP.AutoZero) THEN\n    AutoZeroTimer(IN := i.Stable, PT := T#10S);\n    IF(AutoZeroTimer.Q AND ABS(i.EU) < SP.StabDev AND NOT AutoZeroed) THEN\n        SP.EUOffset := EUAbs;\n        AutoZeroed := True;\n    END_IF;\n    IF NOT (i.Stable) THEN\n        AutoZeroed := False;\n    END_IF;\nEND_IF\n\n//Detect if there is a fault by checking if Raw is 10% out of limits.\ni.Fault := (ANY_TO_REAL(i.Raw) < (SP.RawMinLC - (SP.mvV * 10000 - SP.RawMinLC) / 10)) OR (ANY_TO_REAL(i.Raw) > (SP.mvV * 10000 + (SP.mvV * 10000 - SP.RawMinLC) / 10));","LineInfoPersistence":"(string)6da06f08-747c-4a6c-8085-0895500046cd_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)FUNCTION_BLOCK atLoadCellOld\nVAR\n   // Scale has auto zeroed since last motion\n\tAutoZeroed : BOOL ;\n      // Deviation\n\tDeviation : REAL ;\n      // Absolute scaled value\n\tEUAbs : REAL ;\n      // Filter function\n\tEUFilter : atFilter ;\n   // Last Eu value\n\tEULast : REAL ;\n      // Scaled value before filter\n\tEURaw : REAL ;\n   // Currently stable no time filter\n\tStabRaw : BOOL ;\n      // Stable timer\n\tStabTimer : TON ;\n   // Stable time as DINT\n\tStabTimeDint : DINT ;\n   // Auto zero timer\n\tAutoZeroTimer : TON ;\n\t// Scantime\n\tScan: atScanTime;\n\ttim: TIME;\nEND_VAR\nVAR_IN_OUT\n\ti: atLoadCellData;\n\tSP: atLoadCellSP;\nEND_VAR\n","LineInfoPersistence":"(string)6da06f08-747c-4a6c-8085-0895500046cd_Decl_LineIds"}}}},"UniqueIdGenerator":"(string)4742","POULevel":{"@Type":"8e575c5b:Enum","@Value":"Standard"},"ChildObjectGuids":{"@Type":"ArrayList:IList","@Value":[]},"AddAttributeSubsequent":"(bool)False"}},"TypeInfos":{"0db3d7bb":"{0db3d7bb-cde0-4416-9a7b-ce49a0124323}","3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","6f9dac99":"{6f9dac99-8de1-4efc-8465-68ac443b7d08}","8e575c5b":"{8e575c5b-1d37-49c6-941b-5c0ec7874787}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","ArrayList":"System.Collections.ArrayList","bool":"System.Boolean","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","string":"System.String"}}},"FormatVersion":"1.0"}