Post by micik on ERR_OK not recognized
CODESYS Forge
talk
(Post)
Hello, if I try to use ERR_Ok in my code to check whether the file is open correctly or not, I get an error "Identifier ERR_OK not recognized", I can use plain 0 (zero) instead. But in general, is this a proper way to check for success of file operation since the 4th parameter is a poinmter to RTS_IEC_RESULT, and normally I would expect this to be used somehow. _hFile := SysFileOpen(_sFileName, am:=SysFile.ACCESS_MODE.AM_WRITE, ADR(_result)); IF _result <> 0 THEN udDiag := 100; RETURN;
Last updated: 2024-08-17
Post by carohe on %t SystemTime in Variable
CODESYS Forge
talk
(Post)
Hello, if you enter %t as a "Text" on a rectangle and do not link a variable in "Text variable", it automatically displays the system time. My question is, where do if find a variable, that contains exactly this time? I tried numerous variants using GetLocalDateTime or GetSysTime but I always have to manage timezones myself (which I do not want to do). I only want a variable with the date an time from my windows system, where the visualization is running. Where can I find this variable?
Last updated: 2024-08-20
Post by richiemuia on Static Analysis, Loading Files via script.
CODESYS Forge
talk
(Post)
I've seen that you can use cmds like below to run SA from scripts. system.commands["staticanalysis", "run"].execute() But I would like to run different SA configuration files to create separate logs and cant find anywhere in the scripting engine if this is supported. This stems from if I turn on everything, SA stops reporting issues in the message log when the list gets over 600ish issues. Once we have done an initial clean up of code this wont be an issue, but I'm trying to get a baseline to track improvement.
Last updated: 2024-08-21
Post by richiemuia on Static Analysis, Loading Files via script.
CODESYS Forge
talk
(Post)
I've seen that you can use cmds like below to run SA from scripts. system.commands["staticanalysis", "run"].execute() But I would like to run different SA configuration files to create separate logs and cant find anywhere in the scripting engine if this is supported. This stems from if I turn on everything, SA stops reporting issues in the message log when the list gets over 600ish issues. Once we have done an initial clean up of code this wont be an issue, but I'm trying to get a baseline to track improvement.
Last updated: 2024-08-21
Post by anuj9326 on OPC-UA Client connection, Linux SL /Raspberry Pi
CODESYS Forge
talk
(Post)
hello edwin i have did the same and i could connect the opc-ua server but i dont see anything in the resources tree, in the application i linked my variables to the symbol configuration but i dont see that in the uaexpert. if i use the same application with a non linux system i can get those variables values and see the complete tree structure. What could be the problem ?
Last updated: 2024-08-21
Post by anuj9326 on OPC-UA Client connection, Linux SL /Raspberry Pi
CODESYS Forge
talk
(Post)
hello edwin i have did the same and i could connect the opc-ua server but i dont see anything in the resources tree, in the application i linked my variables to the symbol configuration but i dont see that in the uaexpert. if i use the same application with a non linux system i can get those variables values and see the complete tree structure. What could be the problem ?
Last updated: 2024-08-21
Post by mini-developer on Precompilation Error NBS.UDP_Peer
CODESYS Forge
talk
(Post)
Hello, I use the Library NBS from "caa net base services". After opening the Project i get 19 errors from the message window "Precompilation", most of them because it doesn't recognise a component of the FB "NBS.UD_Peer". (see photo) After compiling the Project at least 2 times, there are no errors. Is there a reason and solution for this behavior? Is there a problem with resolving the library? Thanks for any clue
Last updated: 2024-08-23
Post by taqamert on IFM-Sensor ADC READ
CODESYS Forge
talk
(Post)
I have a pressure sensor that measures 0-600 bar and outputs a 0-5V signal, but my PLC reads analog inputs in the 0-10V range and displays a value of 1024 when 10V is applied. In this case, when the sensor outputs 5V at 600 bar, the PLC shows a value of 512. My working range is 0-350 bar, which means the PLC only uses 298 bits in this range, significantly reducing the resolution. What can I do to achieve better resolution within the 0-350 bar range?
Last updated: 2024-08-23
Post by taqamert on IFM-Sensor ADC READ
CODESYS Forge
talk
(Post)
I have a pressure sensor that measures 0-600 bar and outputs a 0-5V signal, but my PLC reads analog inputs in the 0-10V range and displays a value of 1024 when 10V is applied. In this case, when the sensor outputs 5V at 600 bar, the PLC shows a value of 512. My working range is 0-350 bar, which means the PLC only uses 298 bits in this range, significantly reducing the resolution. What can I do to achieve better resolution within the 0-350 bar range?
Last updated: 2024-08-23
Post by taqamert on IFM-Sensor ADC READ
CODESYS Forge
talk
(Post)
I have a pressure sensor that measures 0-600 bar and outputs a 0-5V signal, but my PLC reads analog inputs in the 0-10V range and displays a value of 1024 when 10V is applied. In this case, when the sensor outputs 5V at 600 bar, the PLC shows a value of 512. My working range is 0-350 bar, which means the PLC only uses 298 bits in this range, significantly reducing the resolution. What can I do to achieve better resolution within the 0-350 bar range?
Last updated: 2024-08-23
Post by szotyi on Array of Program
CODESYS Forge
talk
(Post)
Hi! What is the proper and the easiest way to call programs through looping of array of programs, or pointer of program? instead of calling the programs one by one: prog1(inputX: 11); prog2(inputY: 12); prog3(inputZ: 13); similar like: VAR programsToCall : ARRAY [1..3] OF PROGRAM; END_VAR programsToCall[1] := prog1(inputX: 11); programsToCall[2] := prog2(inputY: 12); programsToCall[3] := prog3(inputZ: 13); FOR i := 1 TO 3 DO programsToCall[i] (); END_FOR Thanks.
Last updated: 2024-08-28
Post by egau on Mutate Hash table value
CODESYS Forge
talk
(Post)
Hi, using the ElementCollections Library, why isn't it possible to mutate a value found within a HashTable? From what I understand, the only way to change a value would be to use the RemoveByKey(), followed by AddKeyValuePair(). My goal is to use a Data Structure that works like a Dictionary in Python. The HashTable seems to come close to this, except that the values themselves seem to be immutable... In python, we can mutate a dict easily (see attached picture).
Last updated: 2024-08-29
Post by paulpotat on cm4 runtime problem
CODESYS Forge
talk
(Post)
It looks like it works with 4.13.0.0 indeed. However when installing the runtime, it's not possible to select the multicore option (see attachment). But once the 4.13.0.0 runtime is installed, the logs seems to indicate that the runtime is running in multicore mode. Looking at "htop" output, it seems like it actually is running on multiple CPU. This is very misleading, is it normal or is this a bug ? Thank you for your answer @eschwellinger, BR
Last updated: 2024-09-02
Post by pradeepradha on Update Raspberry Pi option is missing under Tools menu
CODESYS Forge
talk
(Post)
Hello, the option to update Rasberry Pi from under the Tools menu is missing in my installation. Currently I have the build 3.15.19.50, along with the Pi package 4.11.0.0. But the same problem is observed even with the latest build and Pi packages. I have tried clean install with both the versions but cannot solve the issue. I never faced this on Windows 10, but now the new PCs are with Windows 11 - this is the only difference. How can I solve this problem?
Last updated: 2024-09-02
Post by timvh on Unable to Connect to Modbus RTU Device
CODESYS Forge
talk
(Post)
If your Control Win is the Modbus "Master" then your configuration should be something like: Modbus_COM (Serial port) - Modbus Master (this is the Control Win SoftPLC actively setting up the communication) - Modbus Slave (this is then your WAGO 750-315) You need to add channels to the Modbus Slave configuration to inform the master which variables to read/write from the Wago module. The way you configured it now, the Control Win is also a slave. PS, don't forget to put the PLC (Control Win) in Run.
Last updated: 2024-09-03
Post by docker on Webvisu client connection monitoring
CODESYS Forge
talk
(Post)
Hi mate, With this snippet i was able to see the lastusage variable count, but it would not iterate between clients? i was only able to access the data of the target visu. it threw an error with the array of pointers stating it was not able to convert etc. also when i tried it with the while loop it created an endless loop and crashed the program. any ideas? Thankyou
Last updated: 2024-09-10
Post by alex-at-xana on EThercat Dynamic configuration
CODESYS Forge
talk
(Post)
Ah - forgot another question as it may be related to the PLL problem: I am executing a 4ms cycle. I do not call (from what I know) the Ethercat_MAster periodically in my program. The bus cycle task is set to the Ethercat task. I would assume that the master should send 250 frames per second. Yet, the status of the master says it transmits 500 frames per second which would indicate that the master is called twice. Any ideas there?
Last updated: 2024-09-10
Post by dkugler on TargetVisu Freezing
CODESYS Forge
talk
(Post)
The only weird situation i remeber with particular or complete frozen target visu was after the rtc clock was fallen or set back to the past. It looked like after running a while the alarm history database crashed during writing entries at a date lot of years in the past. After setting the rtc clock to actual date/time and deleting the alarm db every thing worked fine. I don't know, if this is/was a problem of our PLC hardware/firmware? Maybe check date/time at your system?
Last updated: 2024-09-13
Post by jinlee on Camera RTSP Feed
CODESYS Forge
talk
(Post)
Hi, I followed your guidance and used go2rtc. There is a link generated from go2rtc I can copy into the web browser element in the visualisation. It somehow only appear within the software when it is running, but not on the webvisu. I want to display the camera feed onto the webvisu. My camera is reolink 810a which supports IP protocol. My project is pretty simple, just a web browser element with assigned URL.
Last updated: 2024-09-17
Post by timvh on Stack overflow with really simple function
CODESYS Forge
talk
(Post)
You have declared the function block in a function and call the instance also from a function. This is not correct, because a function is initialised with every call. The http client function block should be declared as Global Variable if you want to cal it from a Function, but probably it is better to declare it in a Program and also call the instance of the http function block from the same Program.... The variables of a Program are not initialised with each call.
Last updated: 2024-09-20
Post by andrebrandt on FB string and naming
CODESYS Forge
talk
(Post)
Hi all. I have a FB written in ST. FUNCTION_BLOCK NTC10k VAR_INPUT Syst:STRING; In:REAL; END_VAR VAR_OUTPUT Out:REAL; OTag:STRING; Out_St:Struct_NTC10K; END_VAR VAR Tag:STRING; InstanceName: STRING; Structure:Struct_NTC10K; END_VAR What i'm trying to do, is to pass data to structure. In structure i want to add a tag with systemnumber and sensorname. '320.001-RT401' In pou i use this RT401: NTC10k;, and tried this RT401: NTC10k(Tag:='RT401'); Anyone done this?
Last updated: 2024-09-26
Post by rmaas on Webvisu cliënt responsiveness
CODESYS Forge
talk
(Post)
hi, Does anyone know how to optimise the responisiveness of the web visualisation? When i open the webvisu on my laptop it is very responsive, no noticable lag. But when i open it on the HMI (web client) at the customer site there is a lag of +-500 when opening popups etc. The hmi used is: Phoenix Contact WP 6156-WHPS full hd Arm® Cortex®-A53, 1.6 GHz qt web browser The clients performance seems to be the problem, what can i do in my project to decrease the load for the client?
Last updated: 2024-09-28
Post by timvh on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20)
CODESYS Forge
talk
(Post)
The RTE will take the RTE license. The HMI will take the HMI license. For the Application Based Licenses, the Runtime will take the smallest which is required. So if you have an application running EtherCAT and no visualization, only the Control with support for EtherCAT is used. If you have another runtime which requires the visualization, it will take the smallest Control license which is required and available + the smallest visualization license which is required.
Last updated: 2024-10-01
Post by totorovic on Hard shutdown: no code on device after power on
CODESYS Forge
talk
(Post)
However, if faulty EtherCAT cables were the issue, why wouldn't the error occur during normal operation? Why would bad cables only cause problems during a hard shutdown? I don't have the answer to this question. One last question: When you encountered this behavior, did you see a similar error in your logs? i.e, an "AccessViolation" exception in the EtherCAT Task Yes. It was the exeption you can see in attached file.
Last updated: 2024-10-03
Post by vstrom on Recipe definition, how to have the Name string in current language?
CODESYS Forge
talk
(Post)
I'd like to know if it is possible to have the "Name" field, in the recipe definition, language dependent. Something like to have the possibility to put there a string ID that will be add to the GlobalTextList. In this way it can be translated and when showed in a Visualization screen its value depend on the current language. Thanks.
Last updated: 2024-10-04
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
.