Search talk: detect unused code

 
<< < 1 .. 46 47 48 49 50 .. 54 > >> (Page 48 of 54)

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 marlutec on [ERROR] The PLCopenXML import is not possible because Device not found. Type: 89, Id: 0000 0005, Version: 3.5.10.0 CODESYS Forge talk (Post)
Hello every one. Now i'm instaling a Weintek cMT2108x2(v2) with IR-ETN40R. When I start to import the archive content the code of I/O remote IR-ETN40R, ocurred this error. [ERROR] The PLCopenXML import is not possible because Device not found. Type: 89, Id: 0000 0005, Version: 3.5.10.0 Can someone help me? Marcos Gentil, from Brazil.
Last updated: 2024-02-15

Post by nano on Is there any support for I2C on Raspberry Pi? CODESYS Forge talk (Post)
hello jdj this question can be answered well with a pretty good forge documentation: https://forge.codesys.com/drv/io-drivers/doc/Generic/ u r also able to create in codesys directly an iec-code by using the i2c-interface as driver using the codesys ide and st depending on the stepperdriver, used in yöur hat, its possible that an driver is already available in the device-repository. which mcp-device is used on the hat?
Last updated: 2024-03-01

Post by androidzz on Json Builder problem? CODESYS Forge talk (Post)
Dear reader, I am using the codesys JSON utilities SL, 1.9.0.0 library. And then specifically the FB JSONBuilder. I need to create a main object with at least 2 objects in it. The first object is no problem, but I cannot insert the second object into the main object. See attached my code and the result I get. I am assuming that I am doing something wrong with the parent index but have tried a lot and can't get it done. Kind regards, Rob
Last updated: 2024-03-11

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 valenting on Problem with Licenced Software Metrics CODESYS Forge talk (Post)
Hi, When I try to install my codesys program with the new application-based licensing, I have an error "it exceeds the scope of the license agreement. See Device > Licensed Software Metrics" In the Licensed Software Metrics section, I see a code size < 3MB and less than 2700 variables in visualiaztions. I'm using a license "Control Basic L" with "Codesys Visualization L" option, so it should be enough with these metrics. What can I do ?
Last updated: 2024-04-22

Post by richard-wang on Codesys recipe manager - what does it do? CODESYS Forge talk (Post)
Hi All Thanks for sharing this information. For whom may not know why always get error code 16#4000 or 16#4002 while performing Recipe commands, the root cause is There is a line need to be inserted in CODESYSControl.cfg file, which is PlaceholderFilePath.1=/var/opt/codesys/PlcLogic/ I am using Pi, therefore the above path is set to my pi unit, after adding above line to my cfg file, all the Recipe commands work fine. But I still do not know how and when this file got modified though.
Last updated: 2024-04-29

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 miodusy on CODESYS Control Standard S and Beaglebone CODESYS Forge talk (Post)
Hi, CODESYS Control Standard S + CODESYS Visualization L, CODESYS Control for Beaglebone 4.11.0.0, CODESYS V3.5 SP20 + (64-bit) I have problem that license manager say that this device is not supported when i try active whole license. When I select only runtime and communication it is go next step, but then I no have license on in Visualistion section, all of rest of software metric licese is ok(IO, Istances of com et, code size etc.). Thanks!
Last updated: 2024-05-11

Post by corriibme on Setting array values with JSON Utilities SL CODESYS Forge talk (Post)
I have been trying to set an array value to a JSON structure of this form: {"key": [1,2,3,4]} While I have been able to create the key and set its value to an empty array, I've not had any luck in putting any value in that array. objindex:= fb_JBuilder.SetKeyWithArray("Key6", diParentIndex := diRootIndex); objindex2:= fb_JBuilder.SetValue(value:= iValue2, diParentIndex:= objindex); iValue2: ARRAY[0..3] OF INT:= [1,2,3,4]; The two lines of code above produce {"key6": []} . The second line essentially has no effect.
Last updated: 2024-05-12

Post by totorovic on Softmotion not working with simulation mode CODESYS Forge talk (Post)
Good morning, I think that the mode Simulation does not support the Softmotion functionnality because it runs the CODESYS process with normal priority wich is not a good thing for real-time behavior. If you want to test your PLC project, please use a Codesys Control Softmotion (and your computer must have the Ethercat driver installed) or much easier, download your code into the C6 Smart. BR
Last updated: 2024-05-13

Post by rene-h on VU.FbOpenDialog - TargetVisu - 2 x WebVisu CODESYS Forge talk (Post)
Hello, i am trying to find a way how to open Dialogs on a Single Visu. The options from VU.Globals are Target and WebVisu, but Webvisu opens the Dialog on both WebVisus and it should be separated. CurrentVisu can only be used when the Dialog is called from the Visu, but its all done in the Code. One Webvisu is for the User and one is for diagnostic reasons, and they should not be interfered from each other. Maybe someone can help me with this. Thanks
Last updated: 2024-06-13

Post by rabaggett on No Visu on RasPi CODESYS Forge talk (Post)
Hello, I have been having trouble getting a visualization to show up on the RasPi. I have previously used both WAGO touchscreen and Windows ControlWin and had no trouble. The visu does not show on the Raspi screen on start of the program and attempts to view in a browser both on the Raspi (Chromium) and from my laptop (Brave,Chrome,Firefox) running Codesys development fail. The visu shows correctly in Codesys development when online. (Win 11) The control code that is active is operating correctly. Raspi Codesys runtime is licensed. What am I missing? Thanks!
Last updated: 2024-06-20

Post by mandeepahujaifm on Ethernet/IP 4.6.0 causing exceptions? CODESYS Forge talk (Post)
I have experienced the same with one of our customers after updating EIP Scanner to 4.6.0.0 and really baffled by it. The core dump simply shows error with ENIPScanner I/O task and on analyzing it says no source code available for 4.6.0.0. Contemplating to go back to 4.5.1 but 4.6.0.0 has some really nice fixes. I guess it don't matter if it crashes anways. Please keep us posted if you find anything.
Last updated: 2024-07-11

Post by timvh on No source code available for this object CODESYS Forge talk (Post)
The message means that you (CODESYS) tries to open the function block, but this is not possible because the library which contains the FB is compiled. You either get this when you try to manually open the function block (while editing the application), but it could also happen that an exception occurs in the running application and CODESYS tries to show the location where it occured. If it happened in an FB of the compiled library, it cannot show this and you could get this message too.
Last updated: 2024-07-16

Post by kislov on Change modbus server parameters from program CODESYS Forge talk (Post)
Use in IEC-code: Modbus_Serial_Device.UpdateComPortSettings(...) https://content.helpme-codesys.com/en/libs/IoDrvModbusSerialSlave/Current/pou-ModbusSerialDeviceDiag/UpdateComPortSettings.html Take note: "Only possible if server is disabled (see xEnable Input)" So: Modbus_Serial_Device.xEnable := FALSE; Modbus_Serial_Device.UpdateComPortSettings(...) Modbus_Serial_Device.xEnable := TRUE; Please note that after PLC reboot the values from the GUI (from your screenshot) will be applied again. So you need to save values from HMI in RETAIN and restore them after start of application.
Last updated: 2024-07-17

Post by konradkmiller on Variable assignments CODESYS Forge talk (Post)
I have a snippet of code that I was given as a reference in ST. ** ModbusMasterRTU( xConnect:= TRUE, IPort:= IoConfigGlobals.COM1, // IoConfigGlobals.RS232485Interface, // COM1=Front Port / Serial module = Name of module in Devices structure I/O list udiBaudrate:= 19200, usiDataBits:= 8 , eParity:= WagoTypesCom.eTTYParity.None , eStopBits:= WagoTypesCom.eTTYStopBits.One , eHandshake:= WagoTypesCom.eTTYHandshake.None , ePhysical:= WagoTypesCom.eTTYPhysicalLayer.RS485HalfDuplex, xIsConnected=> xIsConnected , xError=> , oStatus=> , eFrameType:= WagoAppPlcModbus.eMbFrameType.RTU , tTimeOut:= T#1S, utQuery:= utQuery , xTrigger:= SEND, utResponse:= utResponse)** What is the meaning of => in this context?
Last updated: 2024-07-20

Post by mase on Python script: Launch Codesys, Execute Script, Exit Codesys CODESYS Forge talk (Post)
Hi, sorry I can´t help you with your issue, but I hope you can give me a hint on getting GUID for other objects than POUs. Your code states "Guid("6f9dac99-8de1-4efc-8465-68ac443b7d08")". We can I find the GUID / ObjectIds`? I wasn´t able to get details about the GUID of DataTypes (STRUCT/ENUM,..)m, Functions (FUN), GLOBALS and TYPES. I want to create markdown of all available project elements. Thanks for your help
Last updated: 2024-08-06

Post by liamb on Converting CANbus to Decimal from signed 2's complement CODESYS Forge talk (Post)
I need to combine two 8 bit CANbus messages to 16 bits signed int then convert to decimal Decimal from signed 2's complement. I've been using the below code to read for new messages, combine them then assign them to a variable What is the best way to do this for from signed 2's complement? fbRxMessage351(Data := RxMessage351Data); IF fbRxMessage351.NewMessage THEN ChargeVoltage := (WORD_TO_REAL((RxMessage351Data[0]) + ((RxMessage351Data[1]) * 256))) * 0.1; END_IF
Last updated: 2024-08-16

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 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 ralfki on User management CODESYS Forge talk (Post)
Hello eschwellinger, at first thank you for your answer. So the only ways to activate the user management are CodeSys delevelopment enviroment and the Codesys Automation Server. So there is no function to activate the user management via code? Do you have an idea how to get back the users when somebody replaced the PLC. Our customers have only our own developed visualization and they also don't want to install further softwares. Do you maybe have a solution for this
Last updated: 2024-09-04

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 jwhaley on C0007 Errors CODESYS Forge talk (Post)
I ended up figuring it out It wasn't in my code. It kept taking me to 2 of my visualizations but it wasn't going to anything specific. Figured out it was some arrows that I had made to buttons for a mouse click to go to the other visualizations. I removed the text in the assign box but didn't remove the action "change shown Visualization from the list. If I deleted the images all together, the error went away. That's how I thought to go look at that.
Last updated: 2024-10-10

<< < 1 .. 46 47 48 49 50 .. 54 > >> (Page 48 of 54)

Showing results of 1326

Sort by relevance or date