Search talk: real to dint

 
<< < 1 .. 4 5 6 7 8 .. 168 > >> (Page 6 of 168)

Post by davidbo on Is it possible in the log to see previous shutdown CODESYS Forge talk (Post)
If my application does some kind of violation which makes it cast an exception it will trigger my real watchdog which results in a reboot. Unfortunately the log it seems only shows the boot sequence. Is it possible to see what happen before reboot?
Last updated: 2024-02-08

Post by lbartik on MPC predictive control CODESYS Forge talk (Post)
Would this work? https://www.mathworks.com/hardware-support/codesys.html I'm also interested in real-world MPC and have no idea where to start. There is an exciting Python library that is also beyond my grasp: https://www.do-mpc.com/en/latest/index.html Step 1, get PhD(s). Step 2, get job in aerospace/robotics. Step 3, return 15 years later to share this knowledge?
Last updated: 2024-10-19

Post by mozed on Connection to device closed CODESYS Forge talk (Post)
Hello I am using an OpusA3 with version 3.5 SP17 Patch 3 as part of a project. I had no real problem before I encountered a problem that blocked me. The detection of the OpusA3 from Codesys is done correctly. The gateway is well configured and if I ping the gateway or the OpusA3 I receive the response correctly. The problem is that when I try to connect, the Opus screen freezes and a few moments later Codesys displays an error message ("connection to device closed"). I tried to change PC, to update the runtime, to change OpusA3 but the problem remains the same. I'm a little lost knowing that before it worked without problem. I went back to a previous version of the project (where it worked correctly) but the message still appears. Do you have any clues to solve the problem? Sincerely,
Last updated: 2023-08-23

Post by timvh on Profinet fault with codesys control V3 - Receive packet error CODESYS Forge talk (Post)
Are you using the Control Win SL (installed together with the development environment of CODESYS)? If yes, you might want to consider using the CODESYS RTE instead. This has real-time capabilities (running on separate core(s)). But to be able to use this, you have to install the CODESYS Ethernet driver for your network interface to be able to let the RTE access the network port also in realtime. See: https://store.codesys.com/en/codesys-control-rte-sl-bundle.html https://content.helpme-codesys.com/en/CODESYS%20Control/_rtsl_windows_rts_v3.html PS, I haven't tested this myself yet, but you could try to use the SetCommunicationState method of the Profinet controller to see if you can reset and start the bus communication: result := PN_Controller.SetCommunicationState(eRequestedState := DED.DEVICE_TRANSITION_STATE.START); PS, if you are located in the Netherlands or Belgium, we could also provide the license(s) for you.
Last updated: 2024-02-28

Post by timvh on Profinet fault with codesys control V3 - Receive packet error CODESYS Forge talk (Post)
Are you using the Control Win SL (installed together with the development environment of CODESYS)? If yes, you might want to consider using the CODESYS RTE instead. This has real-time capabilities (running on separate core(s)). But to be able to use this, you have to install the CODESYS Ethernet driver for your network interface to be able to let the RTE access the network port also in realtime. See: https://store.codesys.com/en/codesys-control-rte-sl-bundle.html https://content.helpme-codesys.com/en/CODESYS%20Control/_rtsl_windows_rts_v3.html PS, I haven't tested this myself yet, but you could try to use the SetCommunicationState method of the Profinet controller to see if you can reset and start the bus communication: result := PN_Controller.SetCommunicationState(eRequestedState := DED.DEVICE_TRANSITION_STATE.START); PS, if you are located in the Netherlands or Belgium, we could also provide the license(s) for you.
Last updated: 2024-02-28

Post by askic on Generate FBs from source CODESYS Forge talk (Post)
Hello, I'm coming from Siemens (TIA) world and currently learning Codesys. I'd like to know if there is an option to add external txt file with ST code for creation of a function block and then use this file as a source file from which FB will be generated? For example, in TIA, there is an option add external source file to the project structure and then use option "Generate blocks from source". This would create a FB. Does Codesys have something similar? This external source file would look like this: FUNCTION_BLOCK Scaling VAR_INPUT x, k, n : REAL; END_VAR VAR_OUTPUT y : REAL; END_VAR VAR END_VAR y := k*x+n; END_FUNCTION_BLOCK
Last updated: 2024-07-31

Post by matt-purcell on Which Lib to use, connect to a socket with URL instead of IP address CODESYS Forge talk (Post)
Hello, I have a new project and I need to connect to a TCP socket using the URL instead of an explicit IP address, myendpoint@mydomain.com Which library is best suited for this? This is for a new enterprise project, the endpoint is a server in a datacenter running some real time application. We have big IP, it will automatically reassign the IP address to the backup server if a crash occurs so an explicit IP won't work for me. I've done this in RS logix, working now to migrate that code over to codesys. Thanks in advance!
Last updated: 2024-06-17

Post by svn123 on In Simulation Mode, logic is not executing CODESYS Forge talk (Post)
Please check the attached snapshot. I am converting an int to real and storing in rVlv01_SV and then scaling the value using LIN_TRAFO. In the bottom Status Bar of Codesys, both RUN and SIMULATION are visible. When I enter value 100 as input to INT_TO_REAL instruction and press Ctrl-F7, the value can be seen at the input but the logic seems not to work. I searched for help but could not find anything relevant. What could be the reason. Codesys ver3.5.11 svn
Last updated: 2023-12-25

Post by ihatemaryfisher on Sorting array of any-sized structure CODESYS Forge talk (Post)
In my machine's operation, I need to display multiples tables containing arrays of structured variables. The arrays change during operation, and my supervisor has advised me to write a new bubble-sort for each array. I think I can make a function to sort an array of any data type. This was my own project, and I'm a relatively new coder. I want to know the weaknesses in my approach, and a better method, if one exists. As far as I can test, the function accepts an array of a structured variable of any size, and sort it by any VAR in that structure. But it relies heavily on pointers, which I've heard are bad practice? Function call: // SORT BY BYTE-SIZED VAR IF xDoIt[6] THEN FUNBubbleSortSansBuffer( IN_pbySourcePointer := ADR(astArray[1]), // address of first byte in first element of array IN_pbyComparePointer:= ADR(astArray[1].byCompByte), // points to first byte of the comparing variable (variable you sort by) IN_uiStructureSize := SIZEOF(TYPE_STRUCTURE), // size, in bytes, of the structured variable IN_uiCompareSize := SIZEOF(astArray[1].byCompByte), // size, in bytes, of the comparing variable (variable you sort by) diArrayElements := UPPER_BOUND(astArray,1), // number of elements in array IN_xSmallToLarge := xSortOrder // whether to sort by small2large or large2small ); END_IF Function: FUNCTION FUNBubbleSortSansBuffer : BOOL VAR_INPUT IN_pbySourcePointer : POINTER TO BYTE; // points to beginning of array (first byte of first element) IN_pbyComparePointer: POINTER TO BYTE; // points to first byte of the comparing variable (variable you sort by) IN_uiStructureSize : UINT; // size, in bytes, of the structured variable IN_uiCompareSize : UINT; // size, in bytes, of the comparing variable (variable you sort by) diArrayElements : DINT; // number of elements in array IN_xSmallToLarge : BOOL; // whether to sort by small2large or large2small END_VAR VAR j : DINT; // repeat iteration over array until array ends i : DINT; // iterarte over array, swapping when necesary k : DINT; // iterator from 1 to size of structure (stepping 'through' a single element in array) dwSize : DWORD; // internal var for use in MEMUtils.MemCpy(<size>) // FOR SORTING BY BYTE VAR pbySourcePointer : POINTER TO BYTE; pbySourcePointer2 : POINTER TO BYTE; pbyComparePointer : POINTER TO BYTE; pbyComparePointer2 : POINTER TO BYTE; pbyPointerToBuffer : POINTER TO BYTE; // pointer to single byte buffer byBufferByte : BYTE; // single byte buffer END_VAR dwSize := UINT_TO_DWORD(IN_uiStructureSize); // get structure size (number of bytes) pbyPointerToBuffer := ADR(byBufferByte); // assign pointer to address of buffer byte (because MEMUtils.MemCpy requires a pointer input) CASE IN_uiCompareSize OF // depending on the size of the VAR to sort by (current functionality for BYTE and WORD/INT 1: // BYTE (8 BIT) FOR j := 1 TO diArrayElements DO // for number of elements in array FOR i := 1 TO (diArrayElements-1) DO // same thing, but row[i+1] row is included in swap logic pbySourcePointer := IN_pbySourcePointer + dwSize*(i-1); // point at #1 byte in array element[i] pbySourcePointer2 := pbySourcePointer + dwSize; // point at #1 byte in array element[i+1] // NOTE: because of memory locations, each array element is offset from one another by a number of bytes equal to the size of the structure // We can "walk" from array[i] to array[i+1] via steps equal to the size of the structure // e.g., ADR(array[i+1]) == ADR(array[i]) + SIZEOF([array datatype]) pbyComparePointer := IN_pbyComparePointer + dwSize*(i-1); // point to sorting variable in array element[i] pbyComparePointer2 := pbyComparePointer + dwSize; // point to sorting variable in array element[i+1] // using sort order (small -> large/large -> small) IF SEL(IN_xSmallToLarge, (pbyComparePointer2^ > pbyComparePointer^),(pbyComparePointer2^ < pbyComparePointer^)) THEN // This is where it gets tricky. We've identified pointers for the starting bytes of aArray[i] and aArray[i+1] // and we know the size of aArray[i]. We are going to swap individual bytes, one at a time, from aArray[i] and aArray[i+1] // this allows us to use only a single byte var as a buffer or temporary data storage // e.g., consider a structure consisting of a word, a byte, and a string. it is stored like this // |------WORD-------| |--BYTE-| |STRING------...| // astArray[1] == 1000 0100 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 0001 0010 0100 1000 0011 1100 0101 0101.... etc // performing a single swap (copy into a buffer, etc.) of the first byte of each array element creates this // astArray[1] == 0001 0100 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 1000 0010 0100 1000 0011 1100 0101 0101.... etc // incrementing the pointer adresses for the swap by 1 and swapping again swaps the next byte in each array element // astArray[1] == 0001 0010 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 1000 0100 0100 1000 0011 1100 0101 0101.... etc // continuing this from k to SIZEOF(TYPE_STRUCTURE) results in a toally swapped row FOR k := 1 TO IN_uiStructureSize DO // copy single byte[k] of array element 1 to buffer MEMUtils.MemCpy(pbyDest := (pbyPointerToBuffer), pbySrc := (pbySourcePointer+k-1), dwSize := 1); // copy single byte[k] of array element 2 to 1 MEMUtils.MemCpy(pbyDest := pbySourcePointer+k-1, pbySrc := (pbySourcePointer2+k-1), dwSize := 1); // copy buffer to byte[k] array element 2 MEMUtils.MemCpy(pbyDest := (pbySourcePointer2+k-1), pbySrc := pbyPointerToBuffer, dwSize := 1); END_FOR END_IF END_FOR END_FOR
Last updated: 2023-08-17

Post by alexgooi on Modbus writing on value change CODESYS Forge talk (Post)
The way I usally tackle this is by syncing only words (then you are able to use the FB above). If you then want to write a Boolean simply type it like this. Value[1].0 := Bool1; Value[1].1 := Bool2; Value[1].2 := Bool3; Uints have the same number of bits than a INT/WORD so these ones will work as well (they are only represented diffrently). A Real will work but you will loose some infomration in the conversion. If you want to keep the information you can convert 2 words to a float with a function (for example with the IEEE-754 standard) . In this way the syncing to the server is very simple and in the Codesys Program you decide what part of the word you want to use.
Last updated: 2024-04-03

I want to convert a WORD to a hex string like 15.432 to '3C48' CODESYS Forge talk (Thread)
I want to convert a WORD to a hex string like 15.432 to '3C48'
Last updated: 2024-04-19

How to allow a user to handle certificates without access to sourcecode? CODESYS Forge talk (Thread)
How to allow a user to handle certificates without access to sourcecode?
Last updated: 2024-08-07

Post by manuknecht on High Cycle Times for SoftMotion_PlanningTask when using AxisGroup CODESYS Forge talk (Post)
Hi, we did install the real-time kernel patch on the RPI and also performed the additional optimizations including isolating the cores. Changing the configuration of the planning task e.g. running it on a separate core, changing the cycle times and mode from cyclic to freewheeling did not show any improvements.
Last updated: 2024-03-14

how to add module to raspberry pi CODESYS Forge talk (Thread)
how to add module to raspberry pi
Last updated: 2020-11-24

how to set custom from/to timestamp in Trend CODESYS Forge talk (Thread)
how to set custom from/to timestamp in Trend
Last updated: 2020-03-31

Unable to connect to git remotes through Codesys. CODESYS Forge talk (Thread)
Unable to connect to git remotes through Codesys.
Last updated: 2023-11-10

Codesys to Android App to Cloud Database CODESYS Forge talk (Thread)
Codesys to Android App to Cloud Database
Last updated: 2022-03-10

How to map to values in CAN BUS CODESYS Forge talk (Thread)
How to map to values in CAN BUS
Last updated: 2021-04-29

Using Codesys WebClinet to talk to Sensibo API CODESYS Forge talk (Thread)
Using Codesys WebClinet to talk to Sensibo API
Last updated: 2021-07-20

How to add a VFD to Codesys CODESYS Forge talk (Thread)
How to add a VFD to Codesys
Last updated: 2023-05-12

How to convert Function block diagram to Structured text CODESYS Forge talk (Thread)
How to convert Function block diagram to Structured text
Last updated: 2015-05-04

How to save sensor values ​​to a file CODESYS Forge talk (Thread)
How to save sensor values ​​to a file
Last updated: 2023-02-22

HMI will not connect to PLC to display visu. CODESYS Forge talk (Thread)
HMI will not connect to PLC to display visu.
Last updated: 2020-02-28

how to Connect CodeSys to many devices? CODESYS Forge talk (Thread)
how to Connect CodeSys to many devices?
Last updated: 2017-08-16

how to communicate codesys to other PLC CODESYS Forge talk (Thread)
how to communicate codesys to other PLC
Last updated: 2011-07-06

<< < 1 .. 4 5 6 7 8 .. 168 > >> (Page 6 of 168)

Showing results of 4199

Sort by relevance or date