Search talk: string utils

 
<< < 1 .. 8 9 10 11 12 > >> (Page 10 of 12)

Post by ph0010421 on Converting each character to a string into ASCII CODESYS Forge talk (Post)
So the printer wants an ASCII conversion of the hex equivalent of ASCII characters?? They don't make it easy for us
Last updated: 3 days ago

Post by jari-koivuluoma on Problem trying Net Base Services 3.5.15.0 TCP connection CODESYS Forge talk (Post)
I have a need to send messages between 2 PLCs and I cant use network variables (because of size limit) so I tried writing this simple test program. This seems to work fine. I can send messages back and forth when a first "Start server" and then "Connect client". See the attached image. However, if I disconnect the client by setting ClientConnect to false and try to re-connect then the TCP_Client just gives me TIMEOUT error. When I stop and start the server again, then Im able to reconnect. How is this supposed to work? Why reconnecting wont work. There is not other way of disconnecting the client than setting xEnable of the TCP_Client to false. This is just a testing program and I will try it on 2 seperate devices once this works. PROGRAM PLC_PRG VAR CONSTANT mySize : UDINT := 255; END_VAR VAR Server: NBS.TCP_Server; ServerIpStr: STRING := '127.0.0.1'; ServerIP: NBS.IP_ADDR; ServerPort: UINT := 50000; ServerConnection: NBS.TCP_Connection; Client: NBS.TCP_Client; ServerRead: NBS.TCP_Read; ServerWrite: NBS.TCP_Write; ServerSend: STRING(mySize); ServerReceive: STRING(mySize); ServerConnect: BOOL; bServerSend: BOOL; IP: NBS.INADDR; ConnectedClientIP: STRING; ClientPort: UINT := 50000; ClientIpStr: STRING := '192.168.1.49'; ClientIP: NBS.IP_ADDR; ClientRead: NBS.TCP_Read; ClientWrite: NBS.TCP_Write; ClientSend: STRING(mySize); ClientReceive: STRING(mySize); ClientConnect: BOOL; bClientSend: BOOL; Error: BOOL; Message: BOOL; END_VAR // Server ServerIP.sAddr := ServerIpStr; Server( ipAddr := ServerIP, uiPort := ServerPort ); ServerConnection( xEnable := Server.xEnable, hServer := Server.hServer, ); IP := ServerConnection.IPAddress; ConnectedClientIP := F_Concat7( BYTE_TO_STRING(IP.S_un_b.s_b1),'.', BYTE_TO_STRING(IP.S_un_b.s_b2),'.', BYTE_TO_STRING(IP.S_un_b.s_b3),'.', BYTE_TO_STRING(IP.S_un_b.s_b4)); ServerRead( xEnable := ServerConnection.xActive, hConnection := ServerConnection.hConnection, szSize := SIZEOF(ServerReceive), pData := ADR(ServerReceive) ); IF ServerRead.xReady AND ServerRead.szCount > 0 THEN Message := TRUE; END_IF IF ServerRead.eError > 0 THEN Error := TRUE; END_IF ServerWrite( xExecute := ServerConnection.xActive AND bServerSend, hConnection := ServerConnection.hConnection, szSize := LEN(ServerSend)+1, pData := ADR(ServerSend) ); IF ServerWrite.xDone THEN bServerSend := FALSE; END_IF IF ServerWrite.eError > 0 THEN Error := TRUE; END_IF // Client ClientIP.sAddr := ClientIpStr; Client( xEnable := ClientConnect, ipAddr := ClientIP, uiPort := ServerPort, udiTimeOut := 10000000 ); ClientRead( xEnable := Client.xActive, hConnection := Client.hConnection, szSize := SIZEOF(ClientReceive), pData := ADR(ClientReceive) ); IF ClientRead.xReady AND ClientRead.szCount > 0 THEN Message := TRUE; END_IF IF ClientRead.eError > 0 THEN Error := TRUE; END_IF ClientWrite( xExecute := Client.xActive AND bClientSend, hConnection := Client.hConnection, szSize := LEN(ClientSend)+1, pData := ADR(ClientSend) ); IF ClientWrite.xDone THEN bClientSend := FALSE; END_IF IF ClientWrite.eError > 0 THEN Error := TRUE; END_IF
Last updated: 2024-10-03

Post by gustavocsw on MQTT memory leak problem CODESYS Forge talk (Post)
Hello everyone, I'm using the IoT Library to implement the MQTT communication with my local broker server in order to publish and subscribe at specifics topics to share and consume information about my application. But, it seems that are occurring some memory leak problem in a "high" frequency (more than 10 Hz) subscribe process. I follow the same method as in IoT Lib exemples, and at first looks perfect but my PLC was rebooting frequently and when I check its memory usage that was increasing as fast as the subscribe massage was sent. I'm using a WEG PLC410 and a WEG PLC500, and this error occurred in both of them (including in CODESYS Control Win x64). The application sends to the system a message JSON with the float payload Ex. {"data" : 0.8500}, but this happens with a INT, or BOL as well. I use the follow code in my application to find the value: //FindFirstValueByKey VARs PROGRAM JSON_VELO VAR //------Setting the JSON Subscriber to Set the Relay Value jsonDataVelo : JSON.JSONData; jsonByteArrayReaderVelo : JSON.JSONByteArrayReader; xST1okVelo : BOOL; FindFirstValueByKeyVelo : JSON.FindFirstValueByKey; jsonElementVelo : JSON.JSONElement; xDoneReaderVelo : BOOL; xDoneFindVelo : BOOL; //STRING and WSTRING for Subscribe the massage sPayloadJsonVelo : STRING := 'opa'; psPayloadJsonVelo : POINTER TO BYTE := ADR(sPayloadJsonVelo); //wsPayloadJsonRelaySet : WSTRING := "opa"; wsPayloadJsonVelo : WSTRING := STRING_TO_WSTRING('opa'); pwsPayloadJsonVelo : POINTER TO WORD := ADR(wsPayloadJsonVelo); lrVelo : LREAL; xKeepAliveVelo : BOOL; xSetVelo : BOOL; RSSet : RS; LIMPAR : STRING; //Find the msg end sFindVelo : STRING := '}'; psFindVelo : POINTER TO STRING := ADR(sFindVelo); iLenVelo : INT; iSizeVelo : INT := 12; udiContMsg : UDINT; END_VAR // FindFirstValueByKey CODE // Relay Set configuration xSetVelo := MQTT_SUBSCRIBER.RSVelo.Q1; IF xSetVelo THEN xKeepAliveVelo := TRUE; END_IF IF xKeepAliveVelo THEN udiContMsg := udiContMsg + 1; iLenVelo := TO_INT(StrLenA(psPayloadJsonVelo)); iSizeVelo := iLenVelo - TO_INT(MQTT_SUBSCRIBER.udiPayloadSizeVelo); StrDeleteA(psPayloadJsonVelo,iSizeVelo,iLenVelo); wsPayloadJsonVelo := STRING_TO_WSTRING(sPayloadJsonVelo); pwsPayloadJsonVelo := ADR(wsPayloadJsonVelo); //MQTT.ConvertUTF8toUTF16(sourceStart:= ADR(sPayloadJsonVelo), targetStart:= ADR(wsPayloadJsonVelo), dwTargetBufferSize:= TAM, bStrictConversion:= 1); //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := TRUE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := xDoneReaderVelo, wsKey := "data", diStartIndex:= 0, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); IF xDoneFindVelo THEN lrVelo := jsonElementVelo.value.lrValue; //Reset jsonByteArrayReader jsonByteArrayReaderVelo ( xExecute := FALSE, pwData := pwsPayloadJsonVelo, jsonData := jsonDataVelo, xDone => xDoneReaderVelo ); FindFirstValueByKeyVelo( xExecute := FALSE, wsKey := "data", diStartIndex:= 1, jsonData := jsonDataVelo, jsonElement => jsonElementVelo, xDone => xDoneFindVelo ); xKeepAliveVelo := FALSE; GVL.xSetVeloRead := TRUE; END_IF END_IF And this to subscribe at the topic: //SUBSCRIBE VAR: //----------------- Subscribe Velocity ----------------------- MQTTSubscribeVelo : MQTT.MQTTSubscribe;//Variable MQTTSubscriber block -X - function-X wsTopicSubscribeVelo : WSTRING(1024) := "CORE/odometry/GET/data/simp"; // Topic to publish a message sSubscribeMassageVelo : STRING; udiPayloadSizeVelo : UDINT; xSDoneVelo : BOOL; xSErrorVelo : BOOL; xReceiveVelo : BOOL; eSTypeVelo : MQTT.MQTT_ERROR; eSMQTTErrorVelo : MQTT.MQTT_ERROR; RSVelo : RS; udiCont : UDINT; //SUBSCRIBE CODE: MQTTSubscribeVelo( xEnable:= MQTT_CLIENT.xConnection_Broker AND NOT xSErrorVelo AND NOT JSON_VELO.xKeepAliveVelo, pbPayload:= JSON_VELO.psPayloadJsonVelo, udiMaxPayloadSize:= SIZEOF(JSON_VELO.sPayloadJsonVelo), udiPayloadSize => udiPayloadSizeVelo, mqttClient:= MQTT_CLIENT.ClientMQTT, wsTopicFilter:=wsTopicSubscribeVelo, xDone => xSDoneVelo, xError=> xSErrorVelo, xReceived => xReceiveVelo, eMQTTError=> eSMQTTErrorVelo ); RSVelo(SET := xReceiveVelo, RESET1 := JSON_VELO.xKeepAliveVelo);
Last updated: 2024-09-09

Post by george32 on CSV file and string manipulation. CODESYS Forge talk (Post)
Dear folks, I think I have a rather simple question but I could not find the right answer to my question: I have made with Excel a CSV file where I would like to have some general data regarding my program variables. I have made an program what let me read the file. The string I am currently get is at follows: 'IP_Adres;192.168.45.12$R$NPort_number;2000$R$NCycle_time;43$R$NStart_Standard_IO;20$R$N' Now I want to split the string in multiple part, which I later would connect to the right variable. By Google and experimenting I have reached to the following code for the first part of the splitting proces: // Splitting the BOM of the string: Received_string := FileReadString; IF LEFT(STR:=New_string,3)= '' THEN Received_string_without_BOM :=RIGHT(STR:= Received_string,SIZE:= (LEN(STR:= Received_string))-3); END_IF //Splitting the remaining string in part for later declaration. WHILE index = 0 DO index_split_part := FIND(STR1:= Received_string_without_BOM,STR2:= '$R$N'); Part_of_String[index]:=LEFT(STR:=Received_string_without_BOM, SIZE:= index_split_part); index := index + 1; END_WHILE However in the splitting proces I could not understand what is really happening. I understand that the Find() function returns the first value the $R$N in the Received_string_without_BOM. This would mean that the index_split_part := 23 I|P| _ |A |d|r|e|s|;|1_|9 |2 |. |1 |6 |8 |. |4 |5 |. |1 |2 |$ |R |$ |N |P | 1|2| 3 |4 |5|6|7|0|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27| So the next part is to read the first 23 characters of the Received_string_without_BOM with the LEFT() function. I expected that the outcome the following was: 'IP_Adres;192.168.45.12$'. However the outcome is: 'IP_Adres;192.168.45.12$R'. I do not understand where the R after the $ sign comes from, because its place is 24 so it would not be added to the part_of the_string[index]. If I hard coded value 24 for the size it gives me the following return: 'IP_Adres;192.168.45.12$R$N'. I would expect everything till the R but the code adds the $N also to the string. I hope someone could explain to my what I am seeing wrong in my point of view? With kind regards, George
Last updated: 2024-09-27

Post by kevinl on RevPi Connect RS485 CODESYS Forge talk (Post)
I figured this out on my own with this logic: usually the Serial port on a Raspberry pi is on /dev/ttyUSB0 then you need to set linux.DeviceFile=/dev/ttyUSB in codesys you then must set com port to 1 so i assumed codesys subtracts 1 from the number and adds this to the filename... (in code it would look like this: var comPort : byte := '1'; linuxDevice : string := '/dev/ttyUSB'; filename : string; end_var filename := concat(linuxDevice, (to_string(comPort-1)); filaname then is /dev/ttyUSB0 RevPi uses ttyRS485 as Serial port so you must remove the last number from the name and set the com port to this number +1 i hope this is understandable ;-)
Last updated: 2023-12-11

Post by dkugler on Toggling Visualizations using HMI Physical Buttons CODESYS Forge talk (Post)
the magic option is named "Use CurrentVisu variable" activate this option in the Visualization Manager an have a look: https://help.codesys.com/webapp/_visu_obj_manager;product=core_visualization;version=3.5.14.0 if your button is pressed, "feed" the string varable VisuElems.CurrentVisu := 'visu1'; with the correct name of the depending visu. alternative: place a frame element at a empty main visu, konfigure all visus to be shown by this frame. With setting the switching variable of the frame to the index value of the depending visu, it will switch to it. Advantage: the visu names are not hardcoded as string in the ladder lodgic. Good luck! Hint: If you have multiple VisuClients(Target, WebVisu,...) all will show the same visu. Independent switching is much more difficult, but there is a example from codesys.
Last updated: 2024-02-13

Post by amy123 on codesys mqtt publish serialization CODESYS Forge talk (Post)
Hello, I am using the CODESYS IIoT Libraries SL MQTT Publish. Does this publish block only support publishing STRINGS as a readable format? I can publish ENUM, STRUCT, BOOL; however, MQTT Explorer will only display strings. When I use Wireshark, I can see that it is publishing something, but it looks to be publishing a serialized version which is a bunch of 0s or random text. If so, is there any way to deserialize this information back into a readable format? See pictures, where I have a BOOL TRUE that gets published as 001. Then see where I publish a STRUCT and it's an incomprehensible combination of 0s - only the string variable is displayed. Or, is it expected that you convert everything to a string before publishing? Any help is greatly appreciated! :)
Last updated: 2024-02-16

Post by thn-power on How to change OPC NodeId IdentifierType CODESYS Forge talk (Post)
Hi Yet another OPC UA question. When setting up a OPC server using "Communcation manager" (Symbol set and information model) in Codesys the NodeId is always given as "opaque" type. At least when browsing using UAExpert. Other standard OPC objects use numeric (or string) identifier, but for some reason my variables seems to get opaque/binary type. See attached photo. How can I change this? I can't see that this is a parameter in the CodesysControl.cfg. Can this be specified in the information model nodeset? And is it possible to specify the exact numeric or string NodeId for each instance? And on a related topic, is there a way to export the OPC server nodeId's with variable name so that it can be imported in a OPC Client? The .xml files in the project folder does not seem to contain the NodeId.
Last updated: 2024-09-20

Post by timvh on FB string and naming CODESYS Forge talk (Post)
I see, you want to initialize the FB. To be able to initialise it like you described, you need to add the FB_Init method to your FB. (right click on the FB, select add object --> method). Then press the arrow down, to select the FB_Init (overwrite default implementation). In the VAR_INPUT section of this method, add the variable --> Tag : STRING; Then in the code section of this method add: THIS^.Tag := Tag; // copy initial value to local variable in FB Search Google if you want to know more about FB_Init. PS, reflection + instance path, is also an option if you want to get the full name of the instance (path) of the Function Block. See: https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_instance_path.html
Last updated: 2024-09-30

Post by talhaali on Adding a variable from text list into ST code CODESYS Forge talk (Post)
Hi, can I use a entry of a text list as variable in structured text? for example in attach picture, if i use want to use data of first row. I am trying to write: A : STRING := TextList.Default.0; but it is not workings
Last updated: 2023-12-07

Post by talhaali on Adding a variable from text list into ST code CODESYS Forge talk (Post)
Hi, can I use a entry of a text list as variable in structured text? for example in attach picture, if i want to use data of first row. I am trying to write: A : STRING := TextList.Default.0; but it is not workings
Last updated: 2023-12-07

Post by evanclegg on Digital Clock CODESYS Forge talk (Post)
To display the current time, you’ll need to retrieve it from the system clock. In CODESYS, you can use the built-in function SysTime to get the current system time. Here’s an example of how you can use it: VAR dtCurrentTime: DATE_AND_TIME; sTime: STRING(8); END_VAR dtCurrentTime := SysTime(); sTime := TIME_TO_STRING(dtCurrentTime.t); The sTime variable now contains the current time in the format “HH:MM:SSuno online".
Last updated: 2024-02-28

Post by nano on How to access to variable value through symbolic string name CODESYS Forge talk (Post)
this is not easily. From Point of SL-Licenses Codesys didnt provide the informations how to do. We created an own CDS-Component for that Behaviour. This Informations are available for OEM, if you are an OEM you can find the Informations in the RTS-Documentation.
Last updated: 2024-06-14

Post by thedertom on Help with DynamicTextGetTextW CODESYS Forge talk (Post)
Hi I try to get korean texts out of a textlist. For that I want to use DynamicTextGetTextW, but I am a little confused how it is supposed to work. The function returns POINTER TO STRING, but how do I get WSTRING? I succesfully used DynamicTextGetText with classical Strings. Thanks in advance!
Last updated: 2024-09-02

Post by timvh on VisuElems.CurrentUserGroupId is not stable CODESYS Forge talk (Post)
I'm not sure what you are trying to do, but getting the CurrentUserGroupID like this will not work, because there could be multiple Visualization Clients and each can have a different user that is logged in. Also when you go online with CODESYS and open an Visualization, this is counted as a client. Probably this is the reason you see it changing. What you can to is "iterate" over all clients and then see which user is logged in on which visualization Client. For this you need to add the Visu Utils library to the project and call the FbIterateClients. See https://content.helpme-codesys.com/en/libs/Visu%20Utils/4.4.0.0/VisuUtils/VisuActionUtilities/Function-Blocks/FbIterateClients.html fbClientIteration( xExecute := x_Execute, itfClientFilter := VU.Globals.AllClients, itfIterationCallback := fbIterator, xDone => x_Done, xBusy => x_Busy, xError => x_Error, eError => e_Error); The fbIterator, in the example above, should be an instance of an FB which you have created yourself and this must implement VU.IVisualizationClientIteration. For example: FUNCTION_BLOCK FB_ITERATOR IMPLEMENTS VU.IVisualizationClientIteration Then automatically the corresponding methods will be called. In the HandleClient Method, you will get an interface to the client(s) and then you can get the current user through this interface: itfClient.UserGroupId You can also get the UserName: itfClient.UserName
Last updated: 2023-11-14

Post by kblundy on Change the Opening Position of the Dialog using VU.FbOpenDialog CODESYS Forge talk (Post)
I hope the community can help me with this. I need to use the Visu Utils FbOpenDialog to control the opening and closing of a dialog. I have the Opening and Closing working, but I can’t get the dialogue's position to be controlled. The code looks like this: PROGRAM OPEN_DIALOG VAR xOpenLatchSettingDialog : BOOL; TopLeftDialog : VisuStructPoint ; fbOpenLatchSettingsDialog : VU.FbOpenDialog ; END_VAR IF xOpenLatchSettingDialog THEN xOpenLatchSettingDialog:= FALSE ; TopLeftDialog.iX := 100; TopLeftDialog.iY := 23; fbOpenLatchSettingsDialog(sDialogName := 'visu_AlarmLatchSettings', xExecute := xOpenLatchSettingDialog , xModal := TRUE, itfClientFilter := VU.Globals.OnlyTargetVisu, pTopLeftPosition := ADR(TopLeftDialog)); CloseVisuDialog(sDialogName:= 'visu_AlarmLatchSettings'); ELSE xOpenLatchSettingDialog:= TRUE ; IF fbOpenLatchSettingsDialog.xError THEN xOpenLatchSettingDialog := FALSE; END_IF END_IF I can't seem to work out a way to make the values in TopLeftDialog.iX and TopleftDialog.iY be passed correctly in the call and for it to change the position of the dialogue box. The code is compiled, but the position has not been changed. Any guidance or suggestions for revising this code would be incredibly valuable. Your insights could be the key to solving this issue.
Last updated: 2024-05-05

Post by gallusrrr on usb2can in Codeysy 3.5 Can Gateway CODESYS Forge talk (Post)
Hallo und guten Morgen, Ich danke für die Rückmeldung. ich habe das oben geschriebene durchgeführt und auch festgestellt das mit die Commandos für die Can befehle noch fehlen. (Google angeschmissen und geschaut auch gefunden) sudo apt-get install can-utils (damit auch jemanden anders der Post hilft) Anschließend habe ich das CAN System komplett aufgebaut so das ich mit einen anderen CAN Adapter schauen konnte ob die Nachricht auch ankommt. die Nachricht kommt an :) danach habe ich follgende Ausgabe: pi@Codesys:~ $ sudo ip -s -d link show can0 3: can0: <noarp,up,lower_up,echo> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10 link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0 can state ERROR-ACTIVE restart-ms 0 bitrate 250000 sample-point 0.875 tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1 brp 12 gs_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp_inc 1 clock 48000000 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 parentbus usb parentdev 1-1.4:1.0 RX: bytes packets errors dropped missed mcast 3549 819 0 0 0 0 TX: bytes packets errors dropped carrier collsns 32 4 0 0 0 0</noarp,up,lower_up,echo> (Sorry habe kein Speicherplatz im Web um Bilder anzuzeigen..) man kan sehen das die Nachricht abgeht und auch 32 Byte Empfangen worden sind. Die nachricht ist auch am anderen CAN Adapter sichtbar gewesen. Wie bekomem ich den einrichteten Adapter in Codesys rein? das ich den Befehl sudo ip link set can0 up type can bitrate 500000 das ich die Einrichtungs des Can Adapters noch in die Rasperry Start rutine nehmen muss ist mir klar. Ich bedanke mich .
Last updated: 2024-01-18

Post by macros8 on Translation - How to get text as reference in Frames translated? CODESYS Forge talk (Post)
Hi all, I need a help. I want to create Frame where some parameters are done via reference input to this frame. What I have realized that if I use for Label/Caption etc. string variable (%s) it is not included in translation list. This is a quite a big deal and I did not find way how to add text to the list manually. Would you give me a hint how to proceed? I hope there is a way (workaround) how to do it. Thanks a lot. M.
Last updated: 2023-12-01

Post by nmcc on Toggling Visualizations using HMI Physical Buttons CODESYS Forge talk (Post)
Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,
Last updated: 2024-02-13

Post by nmcc on Toggling Visualizations using HMI Physical Buttons CODESYS Forge talk (Post)
Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,
Last updated: 2024-02-13

Post by i-campbell on Publish a JSON payload via MQTT Publish (using IIot Libraries) CODESYS Forge talk (Post)
your are sending as a WSTRING which is UTF16, but your receiver is interpriting as UTF8. Change the receiver to use UTF16, or better change your sender to convert to UTF8. You publish the entire storage space (SIZEOF) Instead of the number of bytes of actual text (StrLenA) try using utf8JsonData : STRING(2000); JSON.Stu.ConvertUTF16toUTF8( ADR(wsJsonData), ADR(utf8JsonData), SIZEOF(utf8JsonData) ); and change your publish to mqttPublish( mqttClient:=mqttClient, pbPayload:=ADR(utf8JsonData), udiPayloadSize:=To_UDINT(JSON.Stu.StrLenA(ADR(utr8JsonData))), wsTopicName:=topic, mQTTPublishProperties:=mqttPublishProperties );
Last updated: 2024-04-10

Post by yannickasselin on How to sort JSON object in codesys CODESYS Forge talk (Post)
Just adding: sSubscriberdata := ''; Right before your memcopy should fix the extra characters. It is because your are copying 36 characters into a string which can contain more than 36 characters and there is garbage left in the extra characters. Regarding the parsing of json, I usually build a structure that mirrors the json data and use the available methods in the IIoT library to parse the data and fill the structure.
Last updated: 2024-05-08

Post by corriibme on Setting array values with JSON Utilities SL CODESYS Forge talk (Post)
It turns out that you can build JSON structures without ever calling the JSONBuilder function block directly. Instead, create a pointer to JSON.JSONData and invoke the necessary methods on its dereference. The parent object has a parent index of -1 (and an index of 0). EVERY other item (including keys, values, empty arrays and sub-objects) created by the setX methods needs the index to increase by 1. Then use the JSONByteArrayWriter FB to generate your JSON string
Last updated: 2024-05-23

Post by tba123 on Script engine, git checkout, Project Environment CODESYS Forge talk (Post)
Hi, I clone a git repository with VersionUpdateFlags.SilentMode, works fine But now I want to checkout a specific commit (with branch_copy command). When using the branch_copy command there is no VersionUpdateFlags and I get this annoying "Project Environment" prompt, blocking further execution of my script without user input. I already tried something like system.prompt_answers[???] = PromptResult.Cancel but I don´t know the string I need here.. The goal is to have a script that clones a repository and compiles every tag + create compiled libraries.
Last updated: 2024-06-10

Post by nano on How to access to variable value through symbolic string name CODESYS Forge talk (Post)
i know, this is the reason for us either. PLC-Handler is to big, and only available with additional Contracts/Costs. OPC-UA is to slow for us. As described, there is a solution available, but im not allowed to post them here. i would prefer you send a message at codesys store by "have a question" or similar called. Not sure. Or, if an Codesys-Official Member allows to share that informations, i can give you the right hints.
Last updated: 2024-06-15

<< < 1 .. 8 9 10 11 12 > >> (Page 10 of 12)

Showing results of 282

Sort by relevance or date