[ac6d98]: / project / sparkplug™_mqtt_edge_b9741afd / function_blocks_d9bd2ff1 / fb_edge_df8b6e33 / fb_edge_af25efb2 / makevalidclientid_c6cfe459 / c6cfe459700a4639be52dc60e06c5c88.object  Maximize  Restore  History

Download this file

1 lines (1 with data), 2.4 kB

1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)c6cfe459-700a-4639-be52-dc60e06c5c88","ParentGuid":"(Guid)af25efb2-e7d3-4d17-9b46-1d6d5c77fe77","Name":"(string)MakeValidClientID","Properties":{"@Type":"2c41fa04:IDictionary","@Value":{}},"TypeGuid":"(Guid)f8a58466-d7f6-439f-bbb8-d4600e41d099","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}","Guid":"System.Guid","string":"System.String"}},"object":{"Graph":{"@Type":"f8a58466","@Value":{"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)//DELETE BAD CHARACTERS\nFOR i := 1 TO LEN( ClientID ) DO\n    //Valid characters are 0x30 to 0x39, 0x41 to 0x5A, and 0x61 to 0x7A\n    IF ( ClientID[ i - 1 ] < 16#30 ) OR\n        ( ( ClientID[ i - 1 ] > 16#39 ) AND ( ClientID[ i - 1 ] < 16#41 ) ) OR\n        ( ( ClientID[ i - 1 ] > 16#5A ) AND ( ClientID[ i - 1 ] < 16#61 ) ) OR\n        ( ( ClientID[ i - 1 ] > 16#7A ) ) THEN\n        STU.StrDeleteA( pby := ADR( ClientID ),\n                        iLength := 1,\n                        iPosition := i );\n    END_IF\nEND_FOR\n\n//REDUCE SIZE TO 23\nIF LEN( ClientID ) > 23 THEN\n    ClientID := RIGHT( STR := ClientID,\n                       SIZE := 23 );\nEND_IF","LineInfoPersistence":"(string)c6cfe459-700a-4639-be52-dc60e06c5c88_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)/// Leaves you with only the characters:\n/// \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n/// Then takes the RIGHT most 23 characaters\n{attribute 'hide'}\nMETHOD MakeValidClientID\nVAR_IN_OUT\n    {warning disable C0388}\n    ClientID : STRING;\n    {warning restore C0388}\nEND_VAR\nVAR\n    i : INT;\nEND_VAR","LineInfoPersistence":"(string)c6cfe459-700a-4639-be52-dc60e06c5c88_Decl_LineIds"}}}}}},"TypeInfos":{"3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","f8a58466":"{f8a58466-d7f6-439f-bbb8-d4600e41d099}","string":"System.String"}}},"FormatVersion":"1.0"}