{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)83c28659-b24b-4368-b789-d45d203c8c03","ParentGuid":"(Guid)74ccca2f-50e3-4d5a-9d7a-9fd420284f83","Name":"(string)atMotor","Properties":{"@Type":"2c41fa04:IDictionary","@Value":[{"@Key":"(Guid)24568a24-c491-472c-a21f-ee5d33859fab","@Value":{"@Type":"24568a24","@Value":{"MemoryReserveForOnlineChange":"(int)1024","ExcludeFromBuild":"(bool)False","External":"(bool)False","EnableSystemCall":"(bool)False","CompilerDefines":"(string)","LinkAlways":"(bool)False","Undefines":{"@Type":"[string]","@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)37ac611c-25e2-4bd1-bbb1-97034e378ea5"}]}}}}]},"TypeGuid":"(Guid)6f9dac99-8de1-4efc-8465-68ac443b7d08","EmbeddedTypeGuids":{"@Type":"[Guid]","@Value":["(Guid)a9ed5b7e-75c5-4651-af16-d2c27e98cb94","(Guid)3b83b776-fb25-43b8-99f2-3c507c9143fc"]}}},"TypeInfos":{"24568a24":"{24568a24-c491-472c-a21f-ee5d33859fab}","2c41fa04":"{2c41fa04-1834-41c1-816e-303c7aa2c05b}","81297157":"{81297157-7ec9-45ce-845e-84cab2b88ade}","829a18f2":"{829a18f2-c514-4f6e-9634-1df173429203}","bool":"System.Boolean","fa2ee218":"{fa2ee218-a39b-4b6d-b249-49dbddbd168a}","Guid":"System.Guid","int":"System.Int32","string":"System.String"}},"object":{"Graph":{"@Type":"6f9dac99","@Value":{"SpecialFunc":{"@Type":"0db3d7bb:Enum","@Value":"None"},"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)//2024-11-09 ATM \n//2024-12-03 CWD Added out_stateColor\n//2024-12-12 CWD Now derived from atGadget\n//2024-12-19 CWD Added pause\n//2024-12-29 CWD Use out_autoRun instead of in_autoRun\n\nSUPER^();\n\n\n\n\n// ===== Motor Control =====\nIF in_autoMode THEN\n\tpower := devices.getPower();\n\tout_run := out_autoRun;\nELSE\n\tIF in_manStart THEN\n\t\tout_run := TRUE;\n\tEND_IF\n\tIF in_manStop THEN\n\t\tout_run := FALSE;\n\tEND_IF\n\t\n\t//Stop output and reset timer \n\tIF manStopTmr.Q THEN\n\t\tout_run:=FALSE;\n\tEND_IF\nEND_IF\n\n//Always stop motor on fault\nIF in_fault THEN\n\tout_run := FALSE;\nEND_IF\n\n//Clear the manual buttons\nin_manStart := FALSE;\nin_manStop := FALSE;\n\n// ===== don't allow devices to start simulataneous =====\nrunTrig(CLK := out_run);\nIF runTrig.Q THEN //Start trigger declared in atDevice\n\tinrushDelay := REAL_TO_ULINT((in_ratedPower * 0.28 + 0.79) * 1000); //Calculate inrush delay in ms.  0.75kw = 1 sec, 15kw = 5 sec => Slope: 0.2807, Intercept: 0.7895\n\tdevices.inrushDelay := atTSSms() + inrushDelay; //delay is in us\nEND_IF\n\n\n// ===== Estimate power draw =====\n\nout_power := 0;\nIF out_run THEN\n\tout_power := in_ratedPower * 0.66; //0.66 is just a random guess at how much power the motor will normally use while running\nEND_IF\n\n\n// ===== Status =====\nmyStatus := atDeviceStatus.off;\nIF seq.reqToRun THEN\n\tmyStatus := atDeviceStatus.reqToRun;\nEND_IF\nIF out_run THEN\n\tmyStatus := atDeviceStatus.run;\nEND_IF\nIF out_inrushDelay THEN\n\tmyStatus := atDeviceStatus.inrushDelay;\n\tinrushTime := inrushTime + 1;\nEND_IF\nout_dlyTimeRem := T#0S;\nout_dlyTimeAct := seq.out_dlyAct;\nIF seq.out_strtDlyAct THEN\n\tmyStatus := atDeviceStatus.startDel;\n\tout_dlyTimeRem := seq.out_strtDlyET;\nEND_IF\nIF seq.out_stopDlyAct THEN\n\tmyStatus := atDeviceStatus.stopDel;\n\tout_dlyTimeRem := seq.out_stpDlyET;\nEND_IF\nIF seq.in_fault THEN\n\tmyStatus := atDeviceStatus.fault;\nEND_IF\nout_Status := myStatus;\n\n","LineInfoPersistence":"(string)83c28659-b24b-4368-b789-d45d203c8c03_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string){attribute 'no_assign'}\nFUNCTION_BLOCK atMotor EXTENDS atGadget\nVAR_INPUT\n\tin_manStart: BOOL; //Manual Start\n\tin_manStop: BOOL;\t//Manual Stop\nEND_VAR\nVAR_INPUT PERSISTENT\nEND_VAR\nVAR_OUTPUT\nEND_VAR\nVAR_OUTPUT PERSISTENT\nEND_VAR\nVAR\n\tpower: atDevicePower;\n\trunTrig: R_TRIG; //out_run trigger\n\tinrushDelay: ULINT; //Time to delay the start of the next motor in ms\n\tinrushTime: DINT;\nEND_VAR\n","LineInfoPersistence":"(string)83c28659-b24b-4368-b789-d45d203c8c03_Decl_LineIds"}}}},"UniqueIdGenerator":"(string)406","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"}