{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)447bdb2a-76c1-41a4-8d53-a716965e026a","ParentGuid":"(Guid)74ccca2f-50e3-4d5a-9d7a-9fd420284f83","Name":"(string)atAI","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)f51d36d8-f32e-4906-b00e-cccc255bbdc2"}]}}}}]},"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)//Does scaling, filtering and limit alarms for an analog input\n//2024-02-09 CWD Updated to use in and out structures.  Added Calibration inputs.\n//2024-05-22 CWD Add channel and card faults. Convert to using DINT on iput rather then INT.\n//2024-05-28 CWD Add scaled in to allow for using all the ai goodness with any real value\n//2024-07-31 CWD Add ready to indicate raw is valid and output is valid.\n//2024-11-15 ATM Update to new in_ out_ schema\n//2025-01-10 CCR Update to include second level of scaling if needed\n//2025-03-27 CCR moved scaling,faults,filtering and limits etc. to methods.\n\n//Only process input if the raw is marked as ready. Used to handle delaying processing value until remote I/O has responded with a value\nIF NOT in_ready THEN\n\tout_ready := FALSE;\n\tRETURN;\nEND_IF\n\n//This could be delayed until filter has had time to work\ngetFaults();\nout_ready := TRUE;\nIF in_simEn THEN\n\tout_eu := in_simIn;\nELSE\n\tdoScalingRaw();\n\tdoScalingEU();\n\tdoFiltering();\n\tout_eu := filtered;\nEND_IF\n\ndoLimits();\ndoCal();\n\n\n","LineInfoPersistence":"(string)447bdb2a-76c1-41a4-8d53-a716965e026a_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string){attribute 'no_assign'}\nFUNCTION_BLOCK atAI\nVAR_INPUT\n\tin_raw: REAL; \t\t\t\t//Raw input\n\tin_calMin: BOOL; \t\t\t//Calibrate min value to current input level\n\tin_calMax: BOOL; \t\t\t//Calibrate max value to current input level\n\tin_reset: BOOL; \t\t\t//Alarm reset\n\t{attribute 'symbol' := 'none'}\n\tin_simEn: BOOL := FALSE;\n\t{attribute 'symbol' := 'none'}\n\tin_simIn: REAL; \t\t\t//Value to output when in simulator mode\n\tin_ready: BOOL := TRUE; \t//Indicates the the value at raw is now valid. Used at startup to delay updates until remote I/O has replied\n\tlimits: atLimits; \t\t\t//Limit inputs\n\tscalingRaw: atScaling;\t\t//Scaling Raw Input to percent\n\tscalingEU: atScaling;\t\t//Scaling percent to EU\n\tfaults: atAIFault; \t\t\t//fault inputs\n\tfilter: atFilter;\t\t\t//Filtering from the scaling EU\n\tin_signal: REAL; \t\t\t// Signal value, depending on input type\n\tin_name: STRING;\t\t\t//Name the atAI for HMI visualization\nEND_VAR\nVAR_INPUT PERSISTENT\n\ttitleIDX_AI: INT;\t\t\t// For using a text list in Webvisu if Persistant Variable Space is Limited (i.e. Using a Productivity PLC vs Raspberry)\n\tin_filterTim: DINT;\t\t\t// Converts to Ms DINT for easy HMI entry\nEND_VAR\nVAR_OUTPUT\n\tout_scaled: REAL; \t\t\t// Scaled value\n\tout_eu: REAL; \t\t\t\t// Filtered and scaled value\n\tout_ready: BOOL; \t\t\t// Output is ready for use.\nEND_VAR\nVAR\n\tai: BOOL;\n\tfiltered: REAL;\nEND_VAR","LineInfoPersistence":"(string)447bdb2a-76c1-41a4-8d53-a716965e026a_Decl_LineIds"}}}},"UniqueIdGenerator":"(string)2228","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"}