Post by struccc on Bibliothek: floatingpointutils
CODESYS Forge
talk
(Post)
The issue s the byte order typically in this case. Can be especially problematic with floating point numbers - even more tricky if transferred with a word based protocol. It is a peasant way to try out the alternatives, dword order can be a-b-c-d, b-a-d-c, c-d-a-b, d-c-b-a where a is the most significant, d is the least significant byte. So all you need is to swap the bytes in your dword, until you get the expected result. If you don't want to mess writing code for this, I'd recommend CAA_Memory library for that: MEM.ReverseBYTEsInDWORD and MEM.ReverseWORDsInDWORD functions would definitively do the trick. Otherwise, can do like this: VAR dwIn : DWORD := 16#11223344; dwOut : DWORD; rOut : REAL; pIN : POINTER TO BYTE; pOUT : POINTER TO BYTE; END_VAR pIN := ADR(dwIn); //pOUt := ADR(dwOut); pOUt := ADR(rOut); pOut[0] := pIN[3]; pOut[1] := pIN[2]; pOut[2] := pIN[1]; pOut[3] := pIN[0]; Ugly, but does the job...
Last updated: 2024-11-19
Post by pernockham on Inheritence of struct,
CODESYS Forge
talk
(Post)
Interesting, thanks! Didnt know about ANY before, and will sure find a use-case for it. Im not sure it will help me here though, it seems to me that an ANY will not accept a string assignment? I actually think that the "ALIAS" should work, that was a hard found error. I had a fair bit of scratching my head looking for misdirected pointers before I understood what was (not) happening. I will use the work-around of individual structs instead.
Last updated: 2025-03-08
Post by pistola on C0357: "GetNextClient" is obsolete, use VisuUtils instead
CODESYS Forge
talk
(Post)
I'm having some troubles with this same issue and I'm wondering if someone can help me out. On a settings visual I allow the operator to enter some values however if they activate the page change button it will change the change with the Numpad dialog open. Since I'm using Visuelems.CURRENTVISU to change the pages I came across this code noted below for determining if the Numpad dialog was active. This code worked great however now in 3.5.19 it's now obsolete. I've tried following the directions in the attached program above however I can't see to get it to work in my program. Can anyone provide some help to determine if a dialog is open? FUNCTION Check_Dialog_Open : Bool VAR_INPUT sDialogName : STRING; // Input variable for the name of the dialog END_VAR VAR pstClientData : POINTER TO VisuElems.VisuStructClientData; // Pointer to the client data structure itfDialogManager : VisuElems.IDialogManager; // Interface for the dialog manager itfMyDialog : VisuElems.IVisualisationDialog; // Interface for the specific visualisation dialog END_VAR // Begin the iteration over the client manager VisuElems.g_ClientManager.BeginIteration(); // Loop through each client until no more clients are found WHILE (pstClientData := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO // Get the dialog manager interface itfDialogManager := VisuElems.g_VisuManager.GetDialogManager(); // Get the specific dialog interface using the dialog name itfMyDialog := itfDialogManager.GetDialog(sDialogName); // Check if the dialog is open for the current client Check_Dialog_Open := VisuDialogs.VisuDlgUtil_IsDialogOpen(itfMyDialog, pstClientData, itfDialogManager); // If the dialog is open, exit the loop IF Check_Dialog_Open THEN EXIT; END_IF END_WHILE
Last updated: 2025-03-27
Import RsLogix 5000 project to Codesys
CODESYS Forge
talk
(Thread)
Import RsLogix 5000 project to Codesys
Last updated: 2023-09-07
IMAGE DISPLAY ACCORDING TO INPUT VARIABLE
CODESYS Forge
talk
(Thread)
IMAGE DISPLAY ACCORDING TO INPUT VARIABLE
Last updated: 2023-09-12
Retain memory change to ZERO
CODESYS Forge
talk
(Thread)
Retain memory change to ZERO
Last updated: 2023-09-19
Fail to download missing libraries
CODESYS Forge
talk
(Thread)
Fail to download missing libraries
Last updated: 2021-11-12
Moved To: Control double acting valve
CODESYS Forge
talk
(Thread)
Moved To: Control double acting valve
Last updated: 2016-10-18
How to configure OPC-UA server
CODESYS Forge
talk
(Thread)
How to configure OPC-UA server
Last updated: 2018-12-03
SoftMotion interface to analog axes
CODESYS Forge
talk
(Thread)
SoftMotion interface to analog axes
Last updated: 2016-12-08
Lock usb port to a device
CODESYS Forge
talk
(Thread)
Lock usb port to a device
Last updated: 2017-06-07
Device descriptor: how to create...
CODESYS Forge
talk
(Thread)
Device descriptor: how to create...
Last updated: 2018-09-12
RFC2217 Serial to Ethernet devices
CODESYS Forge
talk
(Thread)
RFC2217 Serial to Ethernet devices
Last updated: 2017-08-03
Login-to-PLC problems
CODESYS Forge
talk
(Thread)
Login-to-PLC problems
Last updated: 2016-09-21
Bit access to DWORD Variable
CODESYS Forge
talk
(Thread)
Bit access to DWORD Variable
Last updated: 2019-12-18
Raspberry Pi to Codesys 2.3
CODESYS Forge
talk
(Thread)
Raspberry Pi to Codesys 2.3
Last updated: 2014-01-29
modbus from serial to tcp
CODESYS Forge
talk
(Thread)
modbus from serial to tcp
Last updated: 2017-06-05
Logging to a SoftPLC remotely?
CODESYS Forge
talk
(Thread)
Logging to a SoftPLC remotely?
Last updated: 2020-10-02
LoadFile - delete button goes to exception
CODESYS Forge
talk
(Thread)
LoadFile - delete button goes to exception
Last updated: 2018-11-23
Unable to import device description error
CODESYS Forge
talk
(Thread)
Unable to import device description error
Last updated: 2021-07-29
How to get object attributes
CODESYS Forge
talk
(Thread)
How to get object attributes
Last updated: 2018-01-30
PFC200 Update to 4.9.0.0 - No Connection
CODESYS Forge
talk
(Thread)
PFC200 Update to 4.9.0.0 - No Connection
Last updated: 2023-09-27
PFC200 Update to 4.9.0.0 - No Connection
CODESYS Forge
talk
(Thread)
PFC200 Update to 4.9.0.0 - No Connection
Last updated: 2023-09-28
eCockpit - unable to start simulation
CODESYS Forge
talk
(Thread)
eCockpit - unable to start simulation
Last updated: 2023-10-20
User Management - REFERENCE TO VisuUserMgmtProvider
CODESYS Forge
talk
(Thread)
User Management - REFERENCE TO VisuUserMgmtProvider
Last updated: 2023-11-17
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND or OR.