<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Activity for gised-link</title><link href="https://forge.codesys.com/u/gised-link/activity/" rel="alternate"/><id>https://forge.codesys.com/u/gised-link/activity/</id><updated>2021-11-25T09:05:44.006000Z</updated><subtitle>Recent activity for gised-link</subtitle><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d" rel="alternate"/><published>2021-11-25T09:05:44.006000Z</published><updated>2021-11-25T09:05:44.006000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d</id><summary type="html">(for the future me: DO NOT SPAM THE POST BUTTON)</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/556d" rel="alternate"/><published>2021-11-25T09:05:30.845000Z</published><updated>2021-11-25T09:05:30.845000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/556d</id><summary type="html">About the MEMCMP/cast in the Compare function: Yes of course a byte per byte comparison is stupid for REAL and also on other types. I was so excited that I forget to remove this commented line of code of my example... shame on me. We aren't far enough 😅... insertion sort is not that bad but merge sort or quick sort will be really more effective. I am looking to adapt the sort provided in the OSCAT lib to run using a pointer (PVOID) instead of a POINTER TO ARRAY[1..32000] OF REAL. I have some issue...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d" rel="alternate"/><published>2021-11-25T09:05:07.011000Z</published><updated>2021-11-25T09:05:07.011000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d</id><summary type="html">(for the next me: DO NOT SPAM THE POST BUTTON)</summary></entry><entry><title>gised-link posted a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d" rel="alternate"/><published>2021-11-25T09:04:37.417000Z</published><updated>2021-11-25T09:04:37.417000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/be6d</id><summary type="html">About the MEMCPY/cast in the Compare function: Yes of course a byte per byte comparison is stupid for REAL and also on other types. I was so excited that I forget to remove this commented line of code of my example... shame on me. We aren't far enough 😅... insertion sort is not that bad but merge sort or quick sort will be really more effective. I am looking to adapt the sort provided in the OSCAT lib to run using a pointer (PVOID) instead of a POINTER TO ARRAY[1..32000] OF REAL. I have some issue...</summary></entry><entry><title>gised-link posted a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/556d" rel="alternate"/><published>2021-11-25T09:04:34.538000Z</published><updated>2021-11-25T09:04:34.538000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#90b4/556d</id><summary type="html">About the MEMCPY/cast in the Compare function: Yes of course a byte per byte comparison is stupid for REAL and also on other types. I was so excited that I forget to remove this commented line of code of my example... shame on me. We aren't far enough 😅... insertion sort is not that bad but merge sort or quick sort will be really more effective. I am looking to adapt the sort provided in the OSCAT lib to run using a pointer (PVOID) instead of a POINTER TO ARRAY[1..32000] OF REAL. I have some issue...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:57:53.487000Z</published><updated>2021-11-24T16:57:53.487000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate (EXTENDS) from the abstract FB_Sort. Then you override the Compare method to fit your needs (like...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:38:49.164000Z</published><updated>2021-11-24T16:38:49.164000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate (EXTENDS) from the abstract FB_Sort. Then you override the Compare method to fit your needs (like...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:37:37.919000Z</published><updated>2021-11-24T16:37:37.919000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate (EXTENDS) from the abstract FB_Sort. Then you override the Compare method to fit your needs (like...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:29:46.638000Z</published><updated>2021-11-24T16:29:46.638000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate (EXTENDS) from the abstract FB_Sort. Then you override the Compare method to fit your needs (like...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:17:39.046000Z</published><updated>2021-11-24T16:17:39.046000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate from the abstract FB_Sort. Then you override the Compare method to fit your needs (like comparing...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:17:06.579000Z</published><updated>2021-11-24T16:17:06.579000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate from the abstract FB_Sort. Then you override the Compare method to fit your needs (like comparing...</summary></entry><entry><title>gised-link posted a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da" rel="alternate"/><published>2021-11-24T16:10:32.492000Z</published><updated>2021-11-24T16:10:32.492000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ae1b1ff98/?limit=25&amp;page=1#f6da</id><summary type="html">Hi everyone, I have taken a look of your examples. In other languages we pass a comparison function as a parameter of the sorting function. This is not (or it is?) possible using ST language. A way to do it may be to create an ABSTRACT FUNCTION_BLOCK FB_Sort with a private Compare and final Sort method. Then in your code you have to create your own FB_Sort_blablabla (example: FB_Sort_REAL) which derivate from the abstract FB_Sort. Then you override the Compare method to fit your needs (like comparing...</summary></entry><entry><title>gised-link modified a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b" rel="alternate"/><published>2021-09-09T11:32:07.727000Z</published><updated>2021-09-09T11:32:07.727000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b</id><summary type="html">Float is 32 bit or 4 bytes and is called REAL in the PLC world. Double is 64 bit or 8 bytes and is calle LREAL in PLC world. with your Value size is too small for a Double, so I'm assuming you will send a float/REAL instead. Simply do: MEMCPY(ADR(Clinet_Tx1[8]), ADR(my_REAL_type_value), SIZEOF(my_REAL_type_value)); /// Going deeper on the topic /// With what I see, instead of an array, the best to do is to create a STRUCT type with all your needed fields in it. Like this (create a new DUT file with...</summary></entry><entry><title>gised-link modified a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b" rel="alternate"/><published>2021-09-09T11:31:05.141000Z</published><updated>2021-09-09T11:31:05.141000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b</id><summary type="html">Float is 32 bit or 4 bytes and is called REAL in the PLC world. Double is 64 bit or 8 bytes and is calle LREAL in PLC world. with your Value size is too small for a Double, so I'm assuming you will send a float/REAL instead. Simply do: MEMCPY(ADR(Clinet_Tx1[8]), ADR(my_REAL_type_value), SIZEOF(my_REAL_type_value)); /// Going deeper on the topic /// With what I see, instead of an array, the best to do is to create a STRUCT type with all your needed fields in it. Like this (create a new DUT file with...</summary></entry><entry><title>gised-link posted a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b" rel="alternate"/><published>2021-09-09T11:29:50.457000Z</published><updated>2021-09-09T11:29:50.457000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#9efb/2f6b</id><summary type="html">Float is 32 bit or 4 bytes and is called REAL in the PLC world. Double is 64 bit or 8 bytes and is calle LREAL in PLC world. with your Value size is too small for a Double, so I'm assuming you will send a float/REAL instead. Simply do: MEMCPY(ADR(Clinet_Tx1[8]), ADR(my_REAL_type_value), SIZEOF(my_REAL_type_value)); /// Going deeper on the topic /// With what I see, instead of an array, the best to do is to create a STRUCT type with all your needed fields in it. Like this (create a new DUT file with...</summary></entry><entry><title>gised-link posted a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d/f008/99fd" rel="alternate"/><published>2021-09-08T12:01:06.405000Z</published><updated>2021-09-08T12:01:06.405000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d/f008/99fd</id><summary type="html">Arf good point. C programer habbits... I have edited my post</summary></entry><entry><title>gised-link modified a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d" rel="alternate"/><published>2021-09-08T11:59:40.737000Z</published><updated>2021-09-08T11:59:40.737000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d</id><summary type="html">Hi, The simpliest method is to consider your 12 bytes value as "not null terminated" string. When this case appears to me, I declare a byte array of the needed size (in your case 12 bytes) this way: my_arr_value : ARRAY[0..11] OF BYTE; // some array Then when I will write/copy to/from this array, I simply use MEMCPY(dest, source, n) standard function: // copy TCP_Write_0 in my_arr_value // in this case, SIZEOF(TCP_Write_0) must be greater or equal than SIZEOF(my_arr_value) MEMCPY(ADR(my_arr_value),...</summary></entry><entry><title>gised-link modified a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/780175db85/?limit=25#4ae1" rel="alternate"/><published>2021-09-08T11:07:23.639000Z</published><updated>2021-09-08T11:07:23.639000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/780175db85/?limit=25#4ae1</id><summary type="html">Hi, First, do you have a logic analyser (may be integrated inside your oscilloscope)? Such a tool is a game changer when it comes to debug UART/I2C/SPI/... signals. If you can provide some pictures of the SPI signals, this will be perfect. As documented in page 7 of your datasheet, MOSI information are valid/read on the rising edge of the CLK signal. Be sure to "output" some signals with the correct timing (you can do it without slave connected). instead of Mode 0, try another mode just to see what...</summary></entry><entry><title>gised-link posted a comment on discussion Runtime 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/780175db85/?limit=25#4ae1" rel="alternate"/><published>2021-09-08T11:07:10.316000Z</published><updated>2021-09-08T11:07:10.316000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Runtime/thread/780175db85/?limit=25#4ae1</id><summary type="html">Hi, First, do you have a logic analyser (may be integrated inside your oscilloscope)? Such a tool is a game changer when it comes to debug UART/I2C/SPI/... signals. If you can provide some pictures off the SPI signals, this will be perfect. As documented in page 7 of your datasheet, MOSI information are valid/read on the rising edge of the CLK signal. Be sure to "output" some signals with the correct timing (you can do it without slave connected). instead of Mode 0, try another mode just to see what...</summary></entry><entry><title>gised-link modified a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d" rel="alternate"/><published>2021-09-08T10:41:49.587000Z</published><updated>2021-09-08T10:41:49.587000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d</id><summary type="html">Hi, The simpliest method is to consider your 12 bytes value as "not null terminated" string. When this case appears to me, I declare a byte array of the needed size (in your case 12 bytes) this way: my_arr_value : ARRAY[0..11] OF BYTE; // some array Then when I will write/copy to/from this array, I simply use MEMCPY(dest, source, n) standard function: // copy TCP_Write_0 in my_arr_value // in this case, SIZEOF(TCP_Write_0) must be greater or equal than SIZEOF(my_arr_value) MEMCPY(my_arr_value, TCP_Write_0,...</summary></entry><entry><title>gised-link posted a comment on discussion Engineering 🇬🇧</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d" rel="alternate"/><published>2021-09-08T10:40:24.901000Z</published><updated>2021-09-08T10:40:24.901000Z</updated><author><name>gised-link</name><uri>https://forge.codesys.com/u/gised-link/profile/</uri></author><id>https://forge.codesys.com/forge/talk/Engineering/thread/05bdba8da0/?limit=25#e58d</id><summary type="html">Hi, I don't know what you will do with this 12 bytes number. The simpliest method is to consider your 12 bytes value as "not null terminated" string. When this case appears to me, I declare a byte array of the needed size (in your case 12 bytes) this way: my_arr_value : ARRAY[0..11] OF BYTE; // some array Then when I will write/copy to/from this array, I simply use MEMCPY(dest, source, n) standard function: // copy TCP_Write_0 in my_arr_value // in this case, SIZEOF(TCP_Write_0) must be greater or...</summary></entry></feed>