Post by alimans on OPC-UA Server, Symbol Set: Raise an error: Object reference not set to an instance of an object.
CODESYS Forge
talk
(Post)
Hi everyone, I just created a very simple library without any code and, added it to my very simple project. after adding this library, I get an error when I try to open "Symbol Set" in "OPC UA Server" in "Communication Manager". Here is the code of my POU in the library: FUNCTION_BLOCK POU VAR eCommand : (CMD_NONE:=0, CMD_RESET:=-1) INT := CMD_NONE; END_VAR Attached is the error that I get. I also noticed that by removing the enumeration variable above (eCommand), I can open the "Symbol Set" again. Anybody has any idea why this error is raised and how could I use enumeration variables without error in "OPC UA Symbol Set"?
Last updated: 2024-08-08
Post by snhatton on Retain memory change to ZERO
CODESYS Forge
talk
(Post)
I think more information is needed to help solve the issue. Can you list the exact steps to reproduce the issue? What version of Codesys are you using? Did you add a persistentVars object to your project? I would recommend browsing all instances of the retain variable to see all possible writes to the variable in question.
Last updated: 2023-09-18
Post by turndapage on Can't Add Symbol Configuration
CODESYS Forge
talk
(Post)
I've got a Weintek HMI with CodeSYS built-in. I've got it connecting to CodeSYS and downloaded. The connection guide says I need to add a symbol configuration by right-clicking on the application and adding it, but it does not show up in the available objects. Is there something else I have to do to create a symbol configuration object?
Last updated: 2023-10-04
Post by alexgooi on How to protect library project?
CODESYS Forge
talk
(Post)
Hi aniket-b, If you save the library as a compiled library you are not able to see the source code. When the end user tries to view inside the object, CODESYS will give a notification that the source code is missing, see attachment. In short if you don't send the source code, it will not show.
Last updated: 2024-01-25
Post by installwhat on raspistepper error after install
CODESYS Forge
talk
(Post)
from another post on this forum .... In your library project select Project -> Project Information. On the Properties table remove the "LanguageModelAttribute" Value "Qualified Access Only". This will allow you to access the object without qualifying the access. ...... I guess they've compiled it the library with that setting and now I need to mess around with versions.
Last updated: 2024-04-20
Post by felipemsgarcia on Generic EtherCAT slave
CODESYS Forge
talk
(Post)
Hello, Without much info, I would assume that this is an optional object on the EtherCAT network and it's either disconnected or the address doesn't match. I would look into the devices manual or contact the manufacturer for further assistance. And, I would have posted a new topic instead of using a non related one... Cheers!
Last updated: 2024-05-16
Post by wb16 on Visualisation generates "Unresolved reference"
CODESYS Forge
talk
(Post)
Hello Zol6, Have you solved this issue? I use Festo PLC CPX-E-CEC-C1 to create alarm monitoring project. In CODESYS V3.5-SP18 I used the Alarm Storage object and have the same problem. Is it the PLC that is not compatible or the version of the library is not match? Best, wb16
Last updated: 2024-06-10
Post by charleskentyfz on (no subject)
CODESYS Forge
talk
(Post)
I have created an EtherCAT slave code and fixed two slaves (IDs written in the 0xF050 object dictionary). The module IDs are 0x1 and 0x101, respectively. It can be scanned normally in TwinCAT, but when scanning in CODESYS, it reports an error. Why is this happeningοΌtext in the second pic means 'device cannot be found in repository'
Last updated: 2024-07-07
Post by mmpl on Array to String
CODESYS Forge
talk
(Post)
I would like to create one large JSON string from an array of objects, where each object contains a value. My current approach involves using a for loop and string concatenation, but with 20,000 elements in the array, this method takes almost 7 seconds and negatively affects the PLC scan time. Is there a more efficient way to accomplish this?
Last updated: 2024-07-18
Post by mmpl on Array to String
CODESYS Forge
talk
(Post)
I would like to create one large JSON string from an array of objects, where each object contains a value. My current approach involves using a for loop and string concatenation, but with 20,000 elements in the array, this method takes almost 7 seconds and negatively affects the PLC scan time. Is there a more efficient way to accomplish this?
Last updated: 2024-07-18
Post by bjarne-pagaard on Unable to add alarm configuration object to project
CODESYS Forge
talk
(Post)
I believe it should be available. It may be the case, that your device does not support the alarm configuration. Some smaller PLCs sometimes do not support it. You can try changing to a different device, like a Codesys Control Win, in your project, and see if then allows you to add the alarm configuration.
Last updated: 2024-09-27
Post by timvh on FB string and naming
CODESYS Forge
talk
(Post)
Really not clear what you are trying to do, but isn't a Struct enough? So add an object of the type DUT to the Application. Then create a structure TYPE ST_Sensor : STRUCT sName : STRING; uiNumber : UINT; END_STRUCT END_TYPE Then in you application add an instance of this Structure stSensor1 : ST_Sensor := (sName := 'my sensor', uiNumber := 1); or use it like this stSensor1.sName := 'my sensor';
Last updated: 2024-09-28
Post by anderson on function block output
CODESYS Forge
talk
(Post)
I'm trying to make a CNC machine, but I'm having problems because the drive I'm using only has the option of communicating through digital inputs. In this case, I should use the CLP's digital outputs to communicate with it, correct? However, in the function blocks it seems that they are already pre-programmed and I didn't find the pulse output options, for example, so that I could associate a digital output from the PLC to connect this to the drive's pulse input. My question is: is it possible to associate the pulse output of the function block with a digital output of the PLC? and how to do this?
Last updated: 2024-01-05
Post by otbeka on CmpCrypto CryptoGenerateHash Not Outputting
CODESYS Forge
talk
(Post)
Unfortunately I noticed that, and tried: * using CryptoGeteAlgorithmByID within the function call * inputting the raw byte pointer as a testByte * instantiating the _hHash handle within the function body * using a different cryptoID or the raw DINT values from the RtsCryptoID DUT ... to no avail. The pReturn value is also set to 0, which would indicate that it is OK, right? This is odd given that the function is the same within the CryptoDemo example project here, just with a newer version. Is it possible that there is something wrong with the way my bytestring is being set up? I use the following DUTs here: TYPE MESSAGE : STRING(255); END_TYPE TYPE HASH_CODE : ARRAY[0..19] OF BYTE; END_TYPE
Last updated: 2024-09-06
Post by timvh on Specify Input Configuration "OnDialogClosed" Action to only react to certain Dialogs
CODESYS Forge
talk
(Post)
What maybe helps is the Visu Dialog ST demo project: https://store.codesys.com/en/visu-dialog-st.html This has an application IECOpenDialog where dialogs are opened using the VU.FbOpenDialogExtended function blocks. The fbOpenConfigurationDialog call has a reference (interface) to the "close listener" FB of which it's method is automatically called when the dialog is closed. This way you can create specific function blocks for each dialog when it is closed and do what you want with the data that might have been changed.
Last updated: 2023-09-28
Post by simotion on Online view : code is scanned
CODESYS Forge
talk
(Post)
If I do online monitoring of code in f.i. a function block, I cannot see if the function block is called or not. In software from other vendors you normally have an indication if the online code you are looking on is scanned at that moment or not. Is there a way in Codesys to determine in the online view if (parts) of the code are scanned or not? Thanks
Last updated: 2023-10-23
Post by macros8 on Alarm Management - Import and Export of AlarmGroup
CODESYS Forge
talk
(Post)
Hi, I struggle with exporting my Alarm Messages and following importing back to my project. Because filling in one by one is very time consuming I want to use export function and edit .csv file in Excel. As soon as I modify the file the import back to project does not work at all and function returns errors. Would you pls give me a hint how to properly use this functionality? Thanks a lot for help. Regards, M.
Last updated: 2023-12-02
Post by tvm on SEND_RECV_MSG function block on Schneider Machine Expert
CODESYS Forge
talk
(Post)
Anyone else using the SEND_RECV_MSG function block for RS-485 communication on Schneider Machine Expert? I have had ongoing issues with it for several years, which Schneider tech support is aware of, but hasn't been able to fix. The latest version of Machine Expert (v2.2) appears to have broken some of the functionality altogether. I'd be interested in hearing from anyone else using this platform for serial communication.
Last updated: 2024-01-03
Post by tvm on multiply gives negatives
CODESYS Forge
talk
(Post)
It's probably because you have an INT in the input to the MUL function, which will then try to output an INT as well. INT variables can only handle values of -32768 to 32767. Your value of 523000 won't fit in an INT, so it turns into an invalid number. Use a DINT. This is usually better for working with time values anyway, because time values are all 32 bit. Or if you can't, use INT_TO_DINT(gvlp.detectie_nalooptijd_s) in the input to the MUL function.
Last updated: 2024-01-04
Post by jackbrady on Function Blocks and arrays of function blocks
CODESYS Forge
talk
(Post)
Hello, I am new to Codesys and PLC programming in general (please go easy ha!) I'm not looking for code to be written for me just some help and pointing in the right direction. I am writing some code to send commands to a relay based on input values (to put it simply). Quite basic stuff. I have wrote a function block that takes a global variable (Open_command:BOOL) and outputs to another global variable (Opened : BOOL). The function block is simulating a device so I'll eventually get the globals from that. I now need to create multiple versions of this function block/ device (lets say 100) but I need each iteration of that function block to reference it's own relevant global variable. I think that the best way of doing this would be to use arrays, although I could be wrong. I am aware that for up to 100 instances I could very well manually assign everything but that seems rather time consuming and I want a fancier way of doing it. Here is a very basic example of what I am looking to do, please note I have not written this in proper code it's just to show what I mean. Global Variables V[0-100] int Open_command [0-100] Bool Opened [0-100] Bool Function Block var input x : BOOL Var output y : BOOL if x then y = TRUE ELSE y = FALSE The input to my function block will be Open_command, output will be Opened Example code. If V[x] > 10 then Open_command [x] = TRUE ELSE Open_command [x] = FALSE (So when V1 goes above 10 I need Open_command1 = TRUE therefore initiating FB1 output. V2 > 10, open_command2 = True > FB2 output V3 > 10, open_command3 = True > FB3 output ... ... ) What I can't seem to figure out is how to tie all this together, I have read through the codesys documentation and if anything it has confused me more! ha. Apologies for the poorly written post but hopefully you understand what I am trying to get at. Thanks, Jack
Last updated: 2024-02-14
Post by aniket-b on Multiple function blocks are not executing at the same time in ladder logic
CODESYS Forge
talk
(Post)
I have two ethernet Ip drives and created Function Blocks for different motions tasks. I am using same FB for both the drives. When I try to execute the relative move start command on FB for both the drives it is not working. However, if I add 1ms second delay between the execution of each drive it is working. Also when I change the rung order it is working for the first drive in the rung. what could be the wrong here?
Last updated: 2024-03-12
Post by schnepper on Error building Extension SDK Linux code
CODESYS Forge
talk
(Post)
I'm installed the CODESYS Control for Linux SL package and am trying to use the Extension API to call a simple C function. When I get to the step to run "make all" on the Linux machine, I get the error: build interface header: out/CmpFirstTestItf.h from CmpFirstTestItf.m4 ERROR: This functionname does not contain _cext (this is mandatory, see help for details): DEF_API(void',CDECL',external_struct__fb_init',(external_struct_fb_init_struct *p)',1,0x1F77E075,0x00000001) Why does "Generate Runtime System Files" create a function that does not have cext in the name? What am I missing?
Last updated: 2024-04-01
Post by gseidel on Discontinuity of A/B/C axis movement.
CODESYS Forge
talk
(Post)
Hi jonasz, you already solved it, I'm answering here for the sake of others with a similar question. You can provide the slope of the A/B/C axis with the U/V/W word. See example 3 here: https://content.helpme-codesys.com/en/CODESYS%20SoftMotion/_sm_cnc_din66025_additional_axis.html If you don't want to change the G-Code, the function block SMC_RecomputeABCSlopes can compute the slopes automatically. https://content.helpme-codesys.com/en/libs/SM3_CNC/Current/SM_CNC_POUs/SoftMotion-CNC/SoftMotion-Function-Blocks/SMC_RecomputeABCSlopes.html Best regards, Georg
Last updated: 2024-04-30
Post by shawn-plc on Return value from a tag given a string literal
CODESYS Forge
talk
(Post)
Good afternoon everyone, I am looking for a way to return a value given a string tag path. I put together a pseudo-example to illustrate my use-case and was wondering if anyone in this forum can help. The function fnValueFromTagPath is the function I am looking to either create or use from existing library. I would greatly appreciate it. Please see the attachment for additional detail. -Shawn
Last updated: 2024-08-13
Post by sven01 on Documentation / Usage Help For Scripting Engine Libraries
CODESYS Forge
talk
(Post)
Hi, I am still not able to figure out how to use the the classes and their functions. π Let's say I would like to use the function "importfile()" from the class "ScriptTextListObject.ScriptTextListMarker". I would be grateful for an additional example. Thanks! π
Last updated: 2023-08-21
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
.