Search talk: detect unused code

 
<< < 1 .. 53 54 55 56 57 58 > >> (Page 55 of 58)

Post by pernockham on Slider instance value when accessed through "execute ST-code" CODESYS Forge talk (Post)
I have a time which I want to modify with a slider. I have confirmed it is possible to set the value of the slider by to_real(time) (I can see that the slider changes according to 'my_time_value's value). Slider variable: to_real(my_time_value); However I fail to access the current slider instance value when I want to write back the value as time (write to a variable will not work as I need a type-conversion before assignment). my_time_value := to_time(slider-instance-value); I tried with this^.? but could not see anything interesting and also THIS^.GEN_Instance.? but nothing resemble what could be the sliders value. Anyone that knows? Thanks!
Last updated: 2025-02-06

Post by itsthefabs on (no subject) CODESYS Forge talk (Post)
Hallo zusammen, ich nutze eine Wago 8212 als Modbus Client (in früheren Codesys Versionen hieß der Modbus Master) und habe einen weitere Wago 8212 als Modbus Server (früher Modbus Slave). Bisher habe ich für den Client den Funktionsblock FbMbMasterTcp aus der WagoAppPlcModbus-Library genutzt. Zukünftig würde ich das allerdings gerne über das Anhängen eines Modbus-Geräts am Ethernet-Knoten im Projektbaum realisieren. Zum besseren Verständnis habe ich ein Bild beigefügt. Der Modbus mit dem Server läuft auch. Kommt es allerdings zum Fehler des Modbus, z.B. kurzzeitig keine Verbindung oder timeout, wird der Fehler nicht automatisch quittiert. Ich muss dann manuell über den Status des Server-Knotens einen Button mit "Bestätigen" drücken. Im Betrieb kann ich mich aber nicht jedes Mal einloggen um einen Fehler zu quittieren. Gibt es hier irgend einen Trick, wie ich das aus dem Programm-Code quittieren kann? Vielen Dank schon einmal.
Last updated: 2025-02-26

Post by tyleretn on Codesys 3.5 SP18 P4 Freezing on Library Update CODESYS Forge talk (Post)
I have created a library with both code and visualizations to be used in multiple other projects. After I update the library version into the library repository, I have much difficulty updating the version into the main project. I can always update the library version in the Library Manager just fine. My issue, is sometimes Codesys will freeze when opening the visualization that uses the library visualizations. Sometimes it opens, but freezes when I try to access the library visualizations from the Visualization Toolbox. I try letting Codesys run for upwards of 4+ hours and it is stuck in this state. On very rare cases I have no issues and can continue with my work. I haven't found a consistent reason or work around. Has anyone else had this happen?
Last updated: 2025-02-27

Post by struccc on Problem Reading Registers via Modbus from non Codesys device CODESYS Forge talk (Post)
Hi, Might be a good idea first to try out the connection and the device with some handy software, like Modbus Poll. There you can see better, what's really going on... - Is it really connected? - What error code does it return? - Can it read from the register address? - Maybe try Input registers and Holding Registers - can make a difference - Sometimes register addresses are messed up: shifted +-1 (mixing of 2 standards) - Sometimes register addresses start with offset 30000, 40000 ... - Are you using the right protocol? - Is it RTU or TCP? Maybe ASCII? - Can even have a look at the data packets, etc... All this is easier to figure out first with some modbus utility... and then to set it up in CODESYS should not be an issue. P.
Last updated: 2025-03-09

Post by spiessli on Objects in OPC UA Information Model CODESYS Forge talk (Post)
Hi, I have an OPC UA information model with objects defined in it. I can import the model and use the data types defined in it and create instances of these types. These instances are accessible at Root > Objects > DeviceSet > CODE[...] > Resources > Application > GlobalVars > OPC_UA_Symbols for created instances and at [...] > Programs > PLC_PRG for mapped instances. The object defined in the information model is accessible in UA Expert by the name I have defined in the information model (Manipulator) at Root > Objects > Manipulator. How can I assign values to the Variables defined in the object "Manipulator"? Cheers, spiessli
Last updated: 2025-03-27

Post by imdatatas on Programmatically change Tappet on a cam CODESYS Forge talk (Post)
Yes, There is. As explained "Manual creation of CAM structure" on below section. Likewise tappet structure also can be create manual and value of the switching point can be change during IEC program running. https://content.helpme-codesys.com/en/CODESYS%20SoftMotion/_sm_basic_cam_programmatic_creation.html Just create a cam table and define some tapped points as sample for your project. Then on project compile, the created cam tapped data is converted internally into a global variable list. By clicking "Display generated code" in the "cam editor", you can display the automatically created global variables for both cam & tappets. Regards, Imdat
Last updated: 2025-04-02

Post by benemenn on OPC UA Method - How to wait for result? CODESYS Forge talk (Post)
so from what i've learned. Codesys OPCUA Server can only provide OPC UA Methods, when they are created in an XML Model beforehand. So you have to create the XML Model with OPC UA Methods. Then load that model into codesys and create the IEC Blocks. This is automated Code and will create all the variables and Methods from your XML Model. Then they will be displayed on discovery with an OPC UA Client. As far as I understood. There is no way for Methods to be shown in OPC UA when not using an external XML Informationmodel. Codesys can not yet create the informationmodel on itself. Regards
Last updated: 2025-04-02

Post by benemenn on OPC UA Method - How to wait for result? CODESYS Forge talk (Post)
so from what i've learned. Codesys OPCUA Server can only provide OPC UA Methods, when they are created in an XML Model beforehand. So you have to create the XML Model with OPC UA Methods. Then load that model into codesys and create the IEC Blocks. This is automated Code and will create all the variables and Methods from your XML Model. Then they will be displayed on discovery with an OPC UA Client. As far as I understood. There is no way for Methods to be shown in OPC UA when not using an external XML Informationmodel. Codesys can not yet create the informationmodel on itself. Regards
Last updated: 2025-04-02

Post by elsmart on Sequential read and triggering of Modbs RTU channels in application CODESYS Forge talk (Post)
Hello I need some help understanding how to use Modbus RTU (COM port) in Codesys enviroment. I defined a Modbus Server device (slave) in device tree and added some channels to read from (function 3). Also I set trigering mode to Application. I have a POU in which I want to trigger each channel one after the other something like this (C code for better visualisation): for (int i = 0; i < channelsCount; i++) { triggerChannel(channelsArray[i]); // Start transmission while(channel.xBusy); // Wait for transmission to complete } I have found ModbusChannel function block documentation but examples are scarce. I don't understand how rising edge triggering works. What would be the best solution for achieving sequntial channel triggering? What is the common way to read multiple Modbus channels once every time a specified POU is executed?
Last updated: 2025-05-16

Post by edson-bueno on IFM Controller Connection Issue CODESYS Forge talk (Post)
Hi, Could you please send an print of your ethernet adapter info? Ip addr Subnet Mask Default Gateway Also, check if the gateway service is active in your windows. Win+R > services.msc > Look in the list CODESYS Control Win V3 x64 Gateway OR CODESYS Gateway V3 Hook up the M12 code D into the ETH port, supply the controller, it should apperars to you. Make sure when you try to connect with the controller, the target of your project has to match with the controller. Otherwise, click on the device in the devices tree > Communications Settings tab > Device > Options > And disable "Filter Network Scans by Target ID". Good luck.
Last updated: 2025-05-29

Post by tk096 on Max lines of code, codesys CNC ? CODESYS Forge talk (Post)
Hi, this is a bug in CODESYS Softmotion. Due to this bug the size is limited to a maximum of 32767 elements. However, we recommend to use way smaller buffer sizes. You could use a small buffer (it should be big enough so that it does not run empty when the interpolator processes the elements). In the beginning you fill the buffer in PLC_PRG until it is full. Afterwards, you start the interpolator. The interpolator processes the elements and removes them as soon as it travels past them. In PLC_PRG you check whether new elements can be stored in the buffer (NOT QUEUE.bFull). If the buffer has space, you generate the next elements and add them to the buffer (SMC_AppendObj()). I hope this helps you.
Last updated: 2025-06-04

Post by viksym on How to get the motor scaling value from code CODESYS Forge talk (Post)
Is there a way to see what value is set as the "Work travel distance per motor rotation" that is set in the Scaling menu of the axis ? I am working on my own homing function block for sensorless (hardstop) homing and I want to make it be universal between different axes with different motor's scaling for distance per rev so I need to know this value from the axis itself. I know I could do it by just creating an input variable for the function block but I'm leaving that option as a last resort.
Last updated: 2025-06-12

Post by levih on FbHTTPs_Get how to get data from a website and use it in codesys CODESYS Forge talk (Post)
You get an array of DWORD into your receive buffer. You need to process this into usable data, before you can fit it into your DUT. I've made it work using FbWrite_ToIEC_ByRule in stead of Fb_JSON_ParseAndModify. I've attached images of the code. You receive the data into ARRAY[0..1023] OF DWORD. Then you use that array as the input for fbWrite_ToIEC_ByRule. To get the output from this you define a rule to fit the expected data structure including nesting levels. The you feed the rule into FbWrite_ToIEC_ByRule and then you can set the output to be of your DUT type.
Last updated: 2025-06-16

Post by fefefede on Get the numer of day CODESYS Forge talk (Post)
Hello i tro to create a program to turn on or off the air condition in relationship temperature and numer of day. I can't get the number of day. I try this after installing SysTime library but this not work and have this error on debug ------ Build started: Application: Device.Sim.Device.Application ------- Typify code... Generate code... [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0032: Cannot convert type 'Unknown type: 'SysTimeCore(TRUE)'' to type 'TIME' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0035: Program name, function or function block instance expected instead of 'SysTimeCore' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0032: Cannot convert type 'Unknown type: 'DayOfWeek(CurrentTime)'' to type 'INT' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0035: Program name, function or function block instance expected instead of 'DayOfWeek' [INFORMATION] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0181: Related position Build complete -- 4 errors, 0 warnings : No download possible PROGRAM PLC_PRG VAR Temperatura: UDINT; AriaCondizionata: BOOL := FALSE; CurrentDayOfWeek: INT; //Variabile Giorno CurrentTime: TIME; GiornoDellaSettimana: INT; DayOfWeek: INT; END_VAR CurrentTime := SysTimeCore(TRUE); // Ottieni l'ora corrente CurrentDayOfWeek := DayOfWeek(CurrentTime); CASE GiornoDellaSettimana OF 1: // Azioni per Lunedì 2: // Martedì se più 10° accend altrimenti spegni IF Temperatura >= 10 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 3: // Mercoledì se più di 50° accendi altrimenti spegni IF Temperatura >=50 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 4: // Giovedì se più di 40° accendi altrimenti spegni IF Temperatura >=40 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 5: // Venerdì se più di 50° accendi altrimenti spegni IF Temperatura >=50 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 6: // Sabato se più di 25° accendi altrimenti spegni IF Temperatura >=25 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 7: // Domenica sempre spenta AriaCondizionata := FALSE; END_CASE
Last updated: 2023-09-14

Post by s1ack on Wago PFC200 Ethernet / IoDrvEthernet Issue? CODESYS Forge talk (Post)
CODESYS Control for PFC200 4.13.00 CODESYS IIoT Libraries SL 1.11.0.0 Application Based License: CODESYS Control Standard M I have (2) projects with similar code base and both using Wago PFC200. On the second project I am seeing 2 things that I have not been able to resolve: 1) Errors in the log under the Ethernet Item: IoDrvEthernet: [PCI\E1Q51CE62] Could not be found on target! Please check the Ethernet settings. 2) Exception for CPU Load. "Processorload watchdog: plcload=100, maxplcload=95" I have slowed down cyclic tasks on this project, even though on the first project there is actually more code - and it does not exhibit this behavior. In looking at the CPU loading via Linux 'TOP' command there appears to be 20% idle. So plenty of headroom (my opinion). In an effort to troubleshoot I have duplicated the target hardware on my bench. It ran overnight without a CPU load exception. On the test system, I have tried (3) version of the ethernet device. 3.5.16.0 3.5.17.0 and 4.2.0.0 Presently the log does not show the error, but status says the module reports an error. I really do not know if this issue is related to the CPU load exception. The issue does not appear to effect ethernet communications (ModbusTCP or SNMP or Webvisu or PuTTy into Linux Shell). On my test bench I have ModbusTCP slave simulators for all ModbusTCP slaves, but only (1) of the (5) SNMP devices present.
Last updated: 2025-01-21

Post by trusty-squire on SysProcessCreate2 on Linux runtime CODESYS Forge talk (Post)
Hi, I'm trying to launch a continuously running python script from Codesys and monitor the script status inside the Codesys runtime (running on a Linux enviroment). For now I'm testing with the below to emulate a continuously running Python script: #test.py i = 0 while True: i += 1 I'm able to successfully run the script using SysProcessExecuteCommand2 (I can see the Python process running in the task manager). However, this "freezes" the Codesys execution of the task - it sits on that command and will not continue until the Python script ends. I've proven this works by using the task monitor to kill the process, then Codesys continues on happily through the task. What I want to do is use SysProcessCreate2 to set up the Python script as a background task and monitor the process using SysProcessGetState. This always results in the error "ERR_OPERATION_DENIED". I know that I'm able to execute commands (as above), so my config should be correct. Is SysProcessCreate2 functional on a Linux environment? Is there something in the config file I'm missing? Here's my "working" code that uses SysProcessExecuteCommand2: VAR bTest : BOOL; sCommand : STRING := '/usr/bin/python3 /var/opt/codesys/PlcLogic/Application/test.py'; refCommand : REFERENCE TO STRING REF= sCommand; sOutput : STRING; refOutput : REFERENCE TO STRING REF= sOutput; result : RTS_IEC_RESULT; END_VAR IF bTest THEN SysProcessExecuteCommand2( pszCommand:= refCommand, pszStdOut:= refOutput, udiStdOutLen:= SIZEOF(sOutput), pResult:= ADR(result) ); bTest:= FALSE; END_IF And here's the code that always results in the ERR_OPERATION_DENIED error: VAR bTest : BOOL; sApp : STRING := '/usr/bin/python3'; sCommand : STRING := '/var/opt/codesys/PlcLogic/Application/test.py'; refApp : REFERENCE TO STRING REF= sApp; refCommand : REFERENCE TO STRING REF= sCommand; hResult : SysProcess.RTS_IEC_RESULT; hHandle : SysProcess.RTS_IEC_HANDLE; END_VAR IF bTest THEN hHandle := SysProcessCreate2( pszApplication:= refApp, pszCommandLine:= refCommand, ulFlags:=SYSPROCESS_CREATEFLAG_HIDDEN, pResult:= ADR(hResult) ); bTest:= FALSE; END_IF Here's the relevant section from the config file at /etc/codesyscontrol/CODESYSControl.cfg: [SysProcess] Command=AllowAll Appreciate any support or ideas. Thanks!
Last updated: 2025-03-16

Post by martinlithlith on Device User Logon and No device is responding.. Pi4b codesys 3.5 SP19 2 + (64-bit) CODESYS Forge talk (Post)
Hi! Im slowly starting to loose it and i need som help! After a few night of reading up and testing i´m still stuck as a rock and you guys and girls are my last resort for this project. Basic facts; Win 11 Codesys 3.5 SP19 2 + (64-bit) Raspberry pi 4 model b 2 gb Raspian release 11 aarch64 What keeps me up late at night; Username and Password when trying to connect to device and device only beeing connectable for a few seconds. Some of the things I have tried; Username and passord; Credientials from the raspberry Administrator Administrator admin admin Admin Admin administrator administrator Usernames and passwords that I sometimes use (this was a longshot i know, but i was running out of ideas and energy). :) Epand filesystem, activating i2c, spi, 1-wire I can start the gateway and start the runtime. I cant install the edgearm64, arm64 runtime package eventhough I guess i should, i get code [ERROR] Error output: dpkg: error processing archive /tmp/codesysedge_edgearm64_4.8.0.0_arm64.deb (--install): [ERROR] Error output: package architecture (arm64) does not match system (armhf) [ERROR] Error output: Errors were encountered while processing: [ERROR] Error output: /tmp/codesysedge_edgearm64_4.8.0.0_arm64.deb code as a respons. I have tried to Reset Origin Device - no change. I have tried to remove the /etc/CODESYSControl_User.cfg [CmpUserMgr] but i could not find it and i was not sure if i should add it instead but i did not want to mess somthing up. I have tried to create a second gateway with the specific ip if the pi, that did not help. Could it be that i´m currently connected to the pi through WIFI? I can ping the pi and I can connect and control it through VNC. When i scan to select gateway target (scan edge gateway) i find 17-21 devices but can find the pi throug the mac adress. I started of trying to use the "CODESYS Control for Raspberry Pi SL" (I have a license sience earlier) as i read somewhere that this could be used on a Pi4 as well but now i´m trying with the MC SL, no changes, same problem. Right now - gateway version 4.8.0.0 (edgearmHF, armhf), Runtime Package 4.5.0.0 (raspberry, armhf). Any sugestions are very welcome! As mentioned above, theese are some of the things that i have tried/done - but i have been going at this for a while. Best, Martin
Last updated: 2023-09-10

Post by spiessli on Raspberry Pi 4 with Legacy Drivers and Codesys 3.5.19 Patch 4 CODESYS Forge talk (Post)
Hi, I wanted to use the Adafruit Hat for the Raspberry and get acquainted with Softmotion using servos for RC models. This did work great with Codesys 3.5.19 Patch 1, but with Patch 4 and 5 i get errors. I suspect changes in the SoftMotion library have broken dependencies in the legacy drivers, might that be true? Thanks for any hint, spiessli Here the error log: ------ Übersetzungslauf gestartet: Applikation: Device.Application ------- Code typisieren... Code erzeugen... [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0032: Typ 'Unbekannter Typ: 'ConfigGetParameterValueLREAL(pParam, 0)'' kann nicht in Typ 'LREAL' konvertiert werden [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0046: Bezeichner 'ConfigGetParameterValueLREAL' nicht definiert [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0035: Programmname, Funktion oder Funktionsbausteinstanz an Stelle von 'ConfigGetParameterValueLREAL' erwartet [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0032: Typ 'Unbekannter Typ: 'ConfigGetParameterValueLREAL(pParam, 0)'' kann nicht in Typ 'LREAL' konvertiert werden [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0046: Bezeichner 'ConfigGetParameterValueLREAL' nicht definiert [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0035: Programmname, Funktion oder Funktionsbausteinstanz an Stelle von 'ConfigGetParameterValueLREAL' erwartet [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0032: Typ 'Unbekannter Typ: 'ConfigGetParameterValueLREAL(pParam, 0)'' kann nicht in Typ 'LREAL' konvertiert werden [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0046: Bezeichner 'ConfigGetParameterValueLREAL' nicht definiert [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0035: Programmname, Funktion oder Funktionsbausteinstanz an Stelle von 'ConfigGetParameterValueLREAL' erwartet [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0032: Typ 'Unbekannter Typ: 'ConfigGetParameterValueLREAL(pParam, 0)'' kann nicht in Typ 'LREAL' konvertiert werden [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0046: Bezeichner 'ConfigGetParameterValueLREAL' nicht definiert [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0035: Programmname, Funktion oder Funktionsbausteinstanz an Stelle von 'ConfigGetParameterValueLREAL' erwartet [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0032: Typ 'Unbekannter Typ: 'ConfigGetParameterValueLREAL(pParam, 0)'' kann nicht in Typ 'LREAL' konvertiert werden [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0046: Bezeichner 'ConfigGetParameterValueLREAL' nicht definiert [FEHLER] sm3_drive_servo, 4.6.0.0 (3s - smart software solutions gmbh): GetStandardConfigParams AXIS_REF_SERVO: C0035: Programmname, Funktion oder Funktionsbausteinstanz an Stelle von 'ConfigGetParameterValueLREAL' erwartet Übersetzung abgeschlossen -- 15 Fehler, 0 Warnungen : Kein Download möglich
Last updated: 2023-12-19

Post by ara32 on CODESYS 4 Linux: CODESYS Forge talk (Post)
Hello! I managed to correctly launch CODESYS Developer Studio 3.5.17, almost all functionality works. The only issue remaining is that when connecting to a device and obtaining its public key, the NCryptEncrypt function is called, which is not fully implemented in the DLL source code, resulting in the connection not being established. Currently, the code of this function in the Wine repository looks like this: SECURITY_STATUS WINAPI NCryptEncrypt(NCRYPT_KEY_HANDLE key, BYTE *input, DWORD insize, void *padding, BYTE *output, DWORD outsize, DWORD *result, DWORD flags) { struct object *key_object = (struct object *)key; TRACE("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx)\n", key, input, insize, padding, output, outsize, result, flags); if (flags & ~(NCRYPT_NO_PADDING_FLAG | NCRYPT_PAD_OAEP_FLAG | NCRYPT_PAD_PKCS1_FLAG | NCRYPT_SILENT_FLAG)) { FIXME("Flags %lx not supported\n", flags); return NTE_BAD_FLAGS; } if (flags & NCRYPT_NO_PADDING_FLAG || flags & NCRYPT_PAD_OAEP_FLAG) { FIXME("No padding and oaep padding not supported\n"); return NTE_NOT_SUPPORTED; } if (key_object->type != KEY) return NTE_INVALID_HANDLE; return map_ntstatus(BCryptEncrypt(key_object->key.bcrypt_key, input, insize, padding, NULL, 0, output, outsize, result, flags)); } The program crashes due to the NCRYPT_PAD_OAEP_FLAG flag. I'm not proficient in C++, but I attempted to add handling myself, and here's the result: SECURITY_STATUS WINAPI NCryptEncrypt(NCRYPT_KEY_HANDLE key, BYTE *input, DWORD insize, void *padding, BYTE *output, DWORD outsize, DWORD *result, DWORD flags) { struct object *key_object = (struct object *)key; TRACE("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx)\n", key, input, insize, padding, output, outsize, result, flags); if (flags & ~(NCRYPT_NO_PADDING_FLAG | NCRYPT_PAD_OAEP_FLAG | NCRYPT_PAD_PKCS1_FLAG | NCRYPT_SILENT_FLAG)) { FIXME("Flags %lx not supported\n", flags); return NTE_BAD_FLAGS; } if (flags & NCRYPT_NO_PADDING_FLAG) { FIXME("No padding not supported\n"); return NTE_NOT_SUPPORTED; } BCRYPT_OAEP_PADDING_INFO oaepInfo = { 0 }; oaepInfo.pszAlgId = BCRYPT_SHA1_ALGORITHM; NTSTATUS status = BCryptEncrypt(key_object->key.bcrypt_key, input, insize, &oaepInfo, NULL, 0, output, outsize, result, flags); if (key_object->type != KEY) return NTE_INVALID_HANDLE; return map_ntstatus(BCryptEncrypt(key_object->key.bcrypt_key, input, insize, padding, NULL, 0, output, outsize, result, flags)); } Now, when calling the connection, it crashes with the error "bcrypt:BCryptEncrypt flags 0x4 not implemented." Can anyone help with enhancing this functionality or at least point me in the right direction?
Last updated: 2024-03-22

Post by greenwood on CODESYS Control Raspberry Pi mit Servotreiber T6 von StepperOnline CODESYS Forge talk (Post)
Hallo, ich versuche, eine Modbus-RTU-Kommunikation zwischen meinem Raspberry Pi mit CODESYS Control für Raspberry Pi 64 SL und einem Servotreiber von StepperOnline, Typ T6, herzustellen. Die Verbindung ist wie folgt: RJ45-Stecker am Servotreiber -> Kabel mit RJ45 an einem Ende und USB-A-Stecker am anderen Ende -> Seriell-zu-USB-Konverter -> Raspberry Pi. Der Seriell-zu-USB-Konverter und die Kabel habe ich zusammen mit dem Motor und Treiber von StepperOnline gekauft und sie sind dafür gedacht, den Servotreiber mit einem Computer zu verbinden, auf dem deren Setup-Software läuft. dmesg | grep tty auf dem Pi sagt mir, dass der USB-zu-Seriell-Konverter auf ttyusb0 ist. Ich weiß nicht, wie man das in einen COM-Port übersetzt, ich habe COM 1 genommen. Ich habe ein Projekt in Codesys erstellt und ein Modbus_COM-Gerät hinzugefügt, einen Modbus_Master_COM_Port und einen Modbus_Slave_COM_Port angehängt. Auf der Registerkarte "Allgemein" des Modbus_COM habe ich die folgenden Werte eingestellt: Slave address 1 Baud rate 9600 Parity None Data bits 8 Stop bits 2 Ich habe den Servotreiber auf die gleichen Werte eingestellt. (Ich habe auch andere Werte getestet, aber mit dem gleichen Ergebnis). Auf der Registerkarte "Modbus Slave Channel" des Modbus_Slave_COM_Port habe ich einen Kanal hinzugefügt und die folgenden Werte eingetragen: Access type Read Holding Registers (Function Code 3) Read Register offset 0x0000 Length 1 Ich habe noch keinen Code geschrieben, weil ich noch nicht herausgefunden habe, wie man die Kommunikation programmiert. Wenn ich das Projekt zum Raspberry Pi herunterlade scheint der Modbus_Master_COM_Port zu laufen (grünes Symbol), aber der Modbus_Slave_COM_Port nicht (rotes Dreiecksymbol). Wenn ich einen anderen COM-Port eintrage, haben sowohl der Master als auch der Slave das rote Dreiecksymbol. Ich habe dies auch mit meinem Windows-PC unter Verwendung von Codesys Control Win 64 versucht und die gleichen Ergebnisse bekommen. Ich wäre dankbar für jede Hilfe oder Tipps, wie ich den Grund dafür herausfinden kann, warum der Servotreiberreiber nicht reagiert.
Last updated: 2024-05-31

Post by george32 on CSV file and string manipulation. CODESYS Forge talk (Post)
Dear folks, I think I have a rather simple question but I could not find the right answer to my question: I have made with Excel a CSV file where I would like to have some general data regarding my program variables. I have made an program what let me read the file. The string I am currently get is at follows: 'IP_Adres;192.168.45.12$R$NPort_number;2000$R$NCycle_time;43$R$NStart_Standard_IO;20$R$N' Now I want to split the string in multiple part, which I later would connect to the right variable. By Google and experimenting I have reached to the following code for the first part of the splitting proces: // Splitting the BOM of the string: Received_string := FileReadString; IF LEFT(STR:=New_string,3)= '' THEN Received_string_without_BOM :=RIGHT(STR:= Received_string,SIZE:= (LEN(STR:= Received_string))-3); END_IF //Splitting the remaining string in part for later declaration. WHILE index = 0 DO index_split_part := FIND(STR1:= Received_string_without_BOM,STR2:= '$R$N'); Part_of_String[index]:=LEFT(STR:=Received_string_without_BOM, SIZE:= index_split_part); index := index + 1; END_WHILE However in the splitting proces I could not understand what is really happening. I understand that the Find() function returns the first value the $R$N in the Received_string_without_BOM. This would mean that the index_split_part := 23 I|P| _ |A |d|r|e|s|;|1_|9 |2 |. |1 |6 |8 |. |4 |5 |. |1 |2 |$ |R |$ |N |P | 1|2| 3 |4 |5|6|7|0|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27| So the next part is to read the first 23 characters of the Received_string_without_BOM with the LEFT() function. I expected that the outcome the following was: 'IP_Adres;192.168.45.12$'. However the outcome is: 'IP_Adres;192.168.45.12$R'. I do not understand where the R after the $ sign comes from, because its place is 24 so it would not be added to the part_of the_string[index]. If I hard coded value 24 for the size it gives me the following return: 'IP_Adres;192.168.45.12$R$N'. I would expect everything till the R but the code adds the $N also to the string. I hope someone could explain to my what I am seeing wrong in my point of view? With kind regards, George
Last updated: 2024-09-27

Post by sunfloweeerrry on Edgelogix-rpi-1000-cm4102032 SPI port connection to PiFace I/O Driver in CodeSys. CODESYS Forge talk (Post)
Hello, I hv a problem. Couldn't solve this for 2 days now. So I'm quite new at CodeSys and I have to use the spi port x30 on the edgelogix rpi 1000. So what I have to do is just 'add device' at the SPI where I hv to pick the 'SPI master' after that I hv to change the parameters according to the edgelogix I did found in the spidev.h but nothing got updated so I 'add device' again where I pick the PiFace I/O Driver and I put my variables at the I/O Mapping, which i put the input startbit at the in part and led at the out part. I want to make the led blink according to my structured text code but somehow the hardware didn't connected with the CodeSys spi port. Nothing happens. Any idea what I have to do?
Last updated: 2023-08-18

Post by rossanoparis on After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working CODESYS Forge talk (Post)
Hello at all. After un upgrade of "CODESYS Control for Raspberry Pi MC SL" from v4.7 to v4.9 SysFileOpen function stopped working. I'm not able to read or write files from the PLC application. Before this upgrade all worked fine. I've read this thread [ https://forge.codesys.com/forge/talk/Engineering/thread/3da9ded84e/ ] Despite I followed that indications I couldn't get my code working again. Perhaps I'm missing something or I didn't understand how to use placeholders at all. Is there a different syntax to use for "SysFileOpen" in order to use placeholders? Thanks in advance for your help. Information Compiler: CODESYS V3.5 SP19 Patch 2 Runtime: codesyscontrol 4.9.0 HW: KUNBUS RevPi Connect S Below the paths I want to access (The entire CODESYSControl_User.cfg file is attached) [SysFile] PlaceholderFilePath.1=/home/pi/hpca/bin, $hpcabin$ PlaceholderFilePath.2=/home/pi/hpca/cfg, $hpcacfg$ PlaceholderFilePath.3=/home/pi/hpca/logs, $hpcalogs$ PlaceholderFilePath.4=/home/pi/hpca/resources, $hpcares$
Last updated: 2023-08-22

Post by garyl on Comments in arrays and assigning RST coil's to 600 outputs CODESYS Forge talk (Post)
Hello all, im working on a project that requires me to convert an old automation direct DirectSoft PLC d2-250-1. One of the problems im encountering is that all of the comments are attached to members of the different addresses. When i convert the addresses (1777 "C" registers, 777 X registers, and 20,0000 V registers) im running into difficulties keeping the inputs/outputs correct since they are missing documentation. Is there a good way to retain the comments of the indexes in the array? Secondly, initially i was declaring the "C" and "V" addresses individually and this worked to retain the comments as to which register did what, however i ran into a problem when one rung reset (or set to 0) approximately 600 C Addresses. Since each tag is separately declared this proved to be nearly impossible without a literal wall of code that attempted to crash the program. So i converted all of the registers (C,X,Y,V) into separate structs, declared them as arrays and pointed all of the original call outs in the program to the newly defined structs. However i have now lost comments and the program is very hard to follow. Thanks for any help with this issue.
Last updated: 2023-08-31

Post by oi18ct on ARM SL Development Board Recommendation CODESYS Forge talk (Post)
Hello codesys forum, My company is looking at developing a solution with Codesys ARM SL. The requirements will not tax the capabilities of Codesys. I would like to buy an AMR 7 or 8 Dev Board for experimenting. I am looking for a recommendation as I have minimal experience with Linux. Any input from the forum would be most appreciated as the hardware requirements as provided by Codesys for ARM SL seem pretty minimal (basically a arm7 or 8 with Debian is all). Our needs are small in scale- something like 8 digital inputs, 6 digital outputs, 2 analog inputs and 1 analog output. A small gui will be published via web visualization for external display (no local display). Communications with ModbusTCP and uart/RS485. It may be necessary to access i2c and make c or python calls to some existing code that is pretty small. Something like the EMCraft STM32MP1 SOM Starter Kit or Octavo Systems OSD32MP1-RED development board? Ideally something that has a path to a SoM for production. Kontron appears to have some interesting options too. Just having a hard time deciding where to start. Thanks in advance... LC
Last updated: 2023-11-11

<< < 1 .. 53 54 55 56 57 58 > >> (Page 55 of 58)

Showing results of 1438

Sort by relevance or date