{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)7fac81bc-d2c5-456e-80ab-19f58000258b","ParentGuid":"(Guid)74ccca2f-50e3-4d5a-9d7a-9fd420284f83","Name":"(string)atMbReqBase","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)1cccc206-fde4-465c-8b3d-b850f842be99"}]}}}}]},"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)//Modbus request\n//Makes a request using the start and quantity, puts the result into data\n//2024-06-27 CWD Initial create\n//2024-11-15 ATM Moved from Work to main for easier debugging\n//2024-11-23 ATM Cleaned up code, added start array position\n\nmbsClient REF= client.client;\n\n//Trigger request on interval\nSysTimeGetUs(TSSus);\nIF TSSus > last + in_interval * 1000 THEN\n\tlast := TSSus;\n\texecute:=NOT execute AND mbsClient.xConnected AND mbsClient.udiNumReplyTimeouts = 0; //This will cause the execute to turn off and then back on next scan, in case it somehow gets stuck on and no done or error is fired\n\t\n\t//Increment fault count. It will get zerod elswhere when valid data received\n\tfaultCnt := faultCnt + 1;\n\tout_fault := faultCnt >=5;\t\n\nEND_IF\n\n\nquantUsed := in_quantity;\nIF quantUsed > dataSize THEN\n\tquantUsed := DINT_TO_UINT(dataSize);\nEND_IF\n\n//Update outputs\nout_doneCnt := doneCntInt;\nout_errorCnt := errorCntInt;","LineInfoPersistence":"(string)7fac81bc-d2c5-456e-80ab-19f58000258b_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)FUNCTION_BLOCK ABSTRACT atMbReqBase\nVAR_INPUT\n    {attribute 'symbol' := 'none'}\n\tclient: REFERENCE TO atMbClient; // Instance of atMBClient\n\tin_startAddr: UINT;\n\tin_quantity: UINT;\n\tin_dataOffset: UINT; // Offset position for data into array.\n\t\n\tin_interval: SYSTIME := 1000; // Polling interval in ms\n\tin_unitId: BYTE := 0;\n\tin_timeout: SYSTIME := 0; // timeout in ms, if not set, will be 1ms less than interval.\nEND_VAR\nVAR_OUTPUT\n\tout_fault: BOOL;\n\t// Count of successful requests\n\tout_doneCnt: UDINT;\n\t// Count of failed requests\n\tout_errorCnt: UDINT;\nEND_VAR\nVAR\n    {attribute 'symbol' := 'none'}\n\tmbsClient: REFERENCE TO ModbusFB.Client;\n    {attribute 'symbol' := 'none'}\n\texecute: BOOL;\n    {attribute 'symbol' := 'none'}\n\tdataSize: DINT;\n    {attribute 'symbol' := 'none'}\n\tquantUsed: UINT;\n    {attribute 'symbol' := 'none'}\n\tlast: SYSTIME;\n    {attribute 'symbol' := 'none'}\n\tTSSus: SYSTIME;\n\t// Count of successful requests\n    {attribute 'symbol' := 'none'}\n\tdoneCntInt: UDINT;\n\t// Count of failed requests\n    {attribute 'symbol' := 'none'}\n\terrorCntInt: UDINT;\n\t// Increment every polling interval, reset on valid data\n    {attribute 'symbol' := 'none'}\n\tfaultCnt: UDINT;\nEND_VAR\n","LineInfoPersistence":"(string)7fac81bc-d2c5-456e-80ab-19f58000258b_Decl_LineIds"}}}},"UniqueIdGenerator":"(string)2111","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"}