Search talk: compare function block

 
<< < 1 .. 23 24 25 26 > >> (Page 25 of 26)

Post by fenicklar on Login problem with FileTransfer on Raspberry Pi 5 CODESYS Forge talk (Post)
Hello everyone, I'm currently trying to set up a FileTransfer function from a Webvisu to my Raspberry Pi 5 on Codesys 3.5 SP 19 Patch 6. I went in the files CODESYSControl.cfg and CODESYSControl_User.cfg and added : [CmpWebServerHandlerV3] AllowFileTransferServices=1 And it seems to be working. However, I cannot access my several Webvisu without putting my login. That's a problem because one of my webvisu is in kiosk mode on the raspberry itself and there is nokeyboard attached, it's just an information screen, but I can't view it. Is there a wey to enable the File Transfer without requiring to login ? Thank you for your time
Last updated: 2024-03-18

Post by mani-i4point0 on Issue with WebVisu on Raspberry PI CODESYS Forge talk (Post)
Hi, I am running Codesys Runtime by purchasing 'Codesys control for raspberry pi MC SL', I am trying to use the Variables from my GVL's. Few of the variables used as a Pushbutton form the Visualization. These 'BOOL' Variable getting unlatched automatically even though there is no write function in the Overall project. All of them are 'Read' functions, at the same time few other BOOL variable behaviors are seems to be fine. I have tried, clean all and download, serval time restarted the hardware. Happy to share any any information. Your input to resolve this issue would be highly appriciated. Version Details: codesyscontrol 4.8.0.0, armhf codesyscontrol based on SDK 3.5.19.0
Last updated: 2024-03-20

Post by albzen on EtherCat Slaves diagnosis CODESYS Forge talk (Post)
Hello everybody, I'm working on a RunTime Plc (Codesys 3.5.16/18.20) connected to an EtherCat bus with many devices. The bus has some communication fault but I don't know how understand which is the device or the cable that has the trouble. To understand the cause of the problem I would like to read the WKC (Working counter) of the devices (0x0300...0x030C), how is explained in EtherCat documents, but it seems that the read of the counter is disabled. Attached there is an extract of the Ethercat document. Can anyone give me some advice about how and with function can I read it. Thank you in advance!
Last updated: 2024-03-29

Post by albzen on EtherCat Slaves diagnosis CODESYS Forge talk (Post)
Hello everybody, I'm working on a RunTime Plc (Codesys 3.5.16/18.20) connected to an EtherCat bus with many devices. The bus has some communication fault but I don't know how understand which is the device or the cable that has the trouble. To understand the cause of the problem I would like to read the WKC (Working counter) of the devices (0x0300...0x030C), how is explained in EtherCat documents, but it seems that the read of the counter is disabled. Attached there is an extract of the Ethercat document. Can anyone give me some advice about how and with function can I read it. Thank you in advance!
Last updated: 2024-03-29

Post by alexgooi on Modbus writing on value change CODESYS Forge talk (Post)
The way I usally tackle this is by syncing only words (then you are able to use the FB above). If you then want to write a Boolean simply type it like this. Value[1].0 := Bool1; Value[1].1 := Bool2; Value[1].2 := Bool3; Uints have the same number of bits than a INT/WORD so these ones will work as well (they are only represented diffrently). A Real will work but you will loose some infomration in the conversion. If you want to keep the information you can convert 2 words to a float with a function (for example with the IEEE-754 standard) . In this way the syncing to the server is very simple and in the Codesys Program you decide what part of the word you want to use.
Last updated: 2024-04-03

Post by pethun on Upgrade from codesys 3.5.19 to 3.5.20 CODESYS Forge talk (Post)
Hi We upgraded our ptoject from 3.5.19 to 3.5.20 but we get an error message in the latest version. We made our own trend function and its related to this we get error message: Trend_Menu Device: PLC Logic: Application: C0032: Cannot convert type 'RTS_SYSTIMEDATE(systimertc, 3.5.20.0 (system))' to type 'RTS_SYSTIMEDATE(systimertc, 3.5.17.0 (system))' The variables are defined as follow: start : SysTimeRtc.SYSTIMEDATE; end : SysTimeRtc.SYSTIMEDATE; The code that creates the error is the variable start and end IF xAssign THEN xAssign := FALSE; xPanEnable := FALSE; xZoomEnable := FALSE; drs.liFrom := VisuTrendStorageAccess.TrendStorageConvertToTimestamp(start, 0 (us)); drs.liTo := VisuTrendStorageAccess.TrendStorageConvertToTimestamp(end, 0 (us)); drs.m_itfDateRangeSelectorClient.SetCurrentRange(drs.liFrom, drs.liTo); END_IF I cant understand really what the error message means and what can be the cause of the error? It compiles fine in dthe older codesys 3.5.19. If anyone has some experience of this please help us out? We must upgrade due to the new licenses. Thanks
Last updated: 2024-04-20

Post by pethun on Upgrade from codesys 3.5.19 to 3.5.20 CODESYS Forge talk (Post)
Hi We upgraded our ptoject from 3.5.19 to 3.5.20 but we get an error message in the latest version. We made our own trend function and its related to this we get error message: Trend_Menu Device: PLC Logic: Application: C0032: Cannot convert type 'RTS_SYSTIMEDATE(systimertc, 3.5.20.0 (system))' to type 'RTS_SYSTIMEDATE(systimertc, 3.5.17.0 (system))' The variables are defined as follow: start : SysTimeRtc.SYSTIMEDATE; end : SysTimeRtc.SYSTIMEDATE; The code that creates the error is the variable start and end IF xAssign THEN xAssign := FALSE; xPanEnable := FALSE; xZoomEnable := FALSE; drs.liFrom := VisuTrendStorageAccess.TrendStorageConvertToTimestamp(start, 0 (us)); drs.liTo := VisuTrendStorageAccess.TrendStorageConvertToTimestamp(end, 0 (us)); drs.m_itfDateRangeSelectorClient.SetCurrentRange(drs.liFrom, drs.liTo); END_IF I cant understand really what the error message means and what can be the cause of the error? It compiles fine in dthe older codesys 3.5.19. If anyone has some experience of this please help us out? We must upgrade due to the new licenses. Thanks
Last updated: 2024-04-20

Post by bjarne-pagaard on Codesys v3.5 Sint to byte CODESYS Forge talk (Post)
Hi A SINT is a short (signed) integer. It is already only 1 byte - so you should have no problem casting it to a byte like so: bMyByte := TO_BYTE(sintMyShortInt); If you have a regular INT you want to put in 2 bytes - there are a lot of ways you can do this. A Union is certainly one of them. You could have a union with 2 memebers: An array of 2 bytes as one member, and an integer value as another member. Another way would be to look at MEMCPY to put the value into your CAN-message. .. or create a function to take your input value as input, and giving you 2 individual bytes as output. This could be handy if you need to change the byte-order. Integer data types: https://help.codesys.com/webapp/_cds_datatype_integer;product=codesys;version=3.5.17.0 -Bjarne
Last updated: 2024-04-24

Post by gseidel on CNC / G01 Speed is very slow (or go-stop motion) in Continuous short segment . CODESYS Forge talk (Post)
Hi k2saki, I would recommend to have a look at SMC_SmoothMerge, followed by SMC_SmoothPath. SmoothMerge will combine the small G1 elements to longer splines, SmoothPath will avoid stops between the splines. https://content.helpme-codesys.com/en/libs/SM3_CNC/Current/SM_CNC_POUs/SoftMotion-CNC/SoftMotion-Function-Blocks/SMC_SmoothMerge.html For SmoothMerge to work, you have to configure a tolerance, i.e. by how much it may deviate from the lines. To graph the output of the interpolator, you can use the trace. (Add a trace object below the application, and add the variables you are interested in to the trace.) Best regards, Georg
Last updated: 2024-04-30

Post by k2saki on CNC / G-Code streaming processing ( to start quickly in long G-Code File ) CODESYS Forge talk (Post)
Is it possible like G-Code streaming processing (like FANUC or SIEMENS DNC Function )? Or Does anyone know the tips for CODESYS Motion to start moving long Long G-Code File quickly? I have to wait long time after "Start" button to start moving, I have to wait finishing interpreting whole G-Code file, ( and I have to prepare huge buffer to store. ) Now, I'm working on my CNC Project using SMC_ReadNCFile2, and SMC_NcInterpreter to preprocess G-Code. I tried to set SMC_Interpolator.xExecute to true to Start while after SMC_NcInterpreter processed more 50-line of G-Code, but that not worked, I had to wait SMC_NcInterpreter processed all lines to start SMC_Interpolator. G-Code have about 2000 lines of XY of G01 (or more over.. ) of short segment that a CAM software has exploded from NURBS Curve.
Last updated: 2024-05-03

Post by xiaolo on Raspberry Pi 5 CODESYS Forge talk (Post)
Does Ver. 4.12 support Raspberry Pi 5? I have three issues. The first issue is that Codesys cannot detect the RPI 5 when I want to download the runtime. When assigning the IP Address manually then I can download the runtime. The second issue is that I cannot connect to the RPI to download a program. Sometimes the window pops up and it ask for the user credentials, but it is still not connecting. The third issue is that I cannot connect to an ESP32 configured as a Modbus Slave with a Raspberry Pi 4B. I can connect to the ESP32 via a Radzio! Modbus Master Simulator. I am also missing the function Write Holding Registers in the setup of the slave. Are this known issues and when it will be solved?
Last updated: 2024-07-12

Post by amy123 on Alarm Manager Example Alarm Client doesn't Populate CODESYS Forge talk (Post)
Hello, I tried to run the example project from https://forge.codesys.com/prj/codesys-example/alarm-manager/home/Home/ However, I can not get the interface for Alarm History 12 Alarm Manager client to populate with any alarms. 'udiResult := AlarmManager.g_AlarmHandler.RegisterClient(itfAlarmManagerClient12, ADR(arritfAlarmsFromHistory12), iMaxCountAlarmsFromHistory12);' when I look at itfAlarmManagerClient12 its always empty. What is confusing is that when I simulate 2 alarms, iCountActiveAlarms 12 has a vlaue of 2, associated with itfAlarmManagerClient12 - so that appears to work. And yet, its useless as the ProcessAlarms Function can't extract anything from the empty array. I dont understand how these arrays are supposed to be populated and why its not working. Any help would be greatly appreciated!
Last updated: 2024-07-15

Post by paulg on Converting hex bytes to float CODESYS Forge talk (Post)
I'll be capturing a hex stream over serial into a RasPi and I'd like to convert a group of bytes into a float. I see this is available (https://content.helpme-codesys.com/en/CODESYS%20Development%20System/cdsoperatorrealto.html) but not its inverse (i.e. BYTE_TO_REAL). The packets will be 18 bytes but I'll be selecting 4 byte segments from the middle, swapping byte endianness (i.e. changing 0x51847641 to 0x41768451), and converting to float; I believe they adhere to IEEE 754. Is there a pre-built function for some or all of this, or do I need to follow (https://forge.codesys.com/forge/talk/Engineering/thread/dc5829c7ea/)? Thanks!
Last updated: 2024-08-02

Post by c3po on SNMP Communication with WAGO 750-8212 PFC CODESYS Forge talk (Post)
Hello folks, my problem is a bit bigger for just one question. So let's start with the easiest. But first, my system setup: It's a WAGO 750-8212 PFC with some I/O-modules. I try to communicate with the controlsystem over SNMP using the IIoT library from codesys. https://content.helpme-codesys.com/de/CODESYS%20Examples/_ex_iot_snmp_service.html Is there some expirience with this kind of communication? It's just about transfering some data from PFC to network and setting some analogsettings from network to the PFC. So my easiest question: Do I ever need the SNMP_Agent or can I use the SET / GET function as standalone, without the agent? (maybe some more questions will follow, if someone will answer to my request) thanks so far
Last updated: 2024-08-21

Post by struccc on Problem Update new version Master ethercat CODESYS Forge talk (Post)
Hi, I had some issues as well migrating to the new version. What I have learnt: - Have to check all the libraries in the library manager, if they are the proper versions. - Some other parts of the application, maybe an old library referenced by another one can keep the old Ethercat libraries.... Use the "Placeholders" function on the library manager - See if there is a new version available of the slave "devices". Might just have to update them ... I had problems moving from 4.7 to with 4.8, especially with the 2nd adapter for redundancy - some devices failed to initialize properly.... So I have just downgraded those libraries now. P.
Last updated: 2024-10-28

Post by pistola on Case Function - Multiple Conditions, Is it possible? CODESYS Forge talk (Post)
Looking at the help (https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_st_instruction_case.html). I don't think it is possible but I figured I'd ask. I'm looking at have a case that evaluates two variables, instead of having multiple If Else statements I was hoping I could just use a case. Example * Case Var1 & Var 2 of 10 & 10: Instruction Code 10 & 20: Instruction Code 20 & 20: Instruction Code End_Case Obviously I tried typing as noted above and Codesys threw an error. But I was wondering if there was a different way of programming to make something like this work? If not I'll just use a bunch of If Else Statements, Thanks.
Last updated: 2024-11-03

Post by riccardo on VisuElems.CurrentUserGroupId is not stable CODESYS Forge talk (Post)
GoodMorning everyone. I have a system that, in case of alarm, have to block. When the operator logs in must have to acknoledge the alarm and should operate in the system freely. To perform this I detect the logged User by (VisuElems.CurrentUserGroupID <> 0) with a similar code to the the following: PROGRAM AlarmMngt VAR alarm : BOOL:= FALSE; Ack : BOOL:= TRUE; PushBottonOpening : BOOL:= FALSE; Valve : BOOL := FALSE; Flag: BOOL := FALSE; END_VAR IF alarm AND Ack AND (NOT Flag) THEN valve := FALSE; PushBottonOpening := FALSE; Ack := FALSE flag := TRUE; ELSIF (NOT alarm) AND Ack THEN flag := FALSE; END_IF (* if the system is in alarm but there is a logged operator that acknowledge the alarm the system allows the valve opening.*) IF (VisuElems.CurrentUserGroupID <> 0) AND Ack AND Alarm AND PushBottonOpening THEN Valve := TRUE; ELSIF (VisuElems.CurrentUserGroupID = 0) AND Alarm THEN valve := FALSE; END_IF The problem I have is in the last 5 lines of the code: Even if there is a logged in user, the GroupID variable is subjected to a refresh that cyclically set for an instant it to 0 and this close the valve making difficult to the user to work Now I solved it creating a time hysteresys cycle but it is not a good solution. Someone is able to explane me why the GroupID variable is sobjected to this refresh and how to stabilize to avoiding it? Thank you in advance, Riccardo
Last updated: 2023-11-10

Post by annd on Migration von "CODESYS Control for PFC200 SL" zu WAGO FW26 "CODESYS V3.5.19.2" CODESYS Forge talk (Post)
Hallo, da Wago nun von eCockpit zum offenen "CODESYS Development System V3" wechselt, möchte ich meinen bestehenden 750-8212 von der PFC200 SL auf die Wago Firmware umstellen. Welche Schritte sind dabei notwendig? Den Controller würde ich auf die aktuelle FW 26 updaten und die 3.5.19.2 von Wago mit den Descriptions verwenden. Reicht es im Codesys Projektbaum mit "Gerät aktualisieren" auf den Wago Controller zu wechseln? Es wird dann statt dem "Pfc200Bus"ein leerer K-Bus und ein leerer Com-Port angezeigt. Müssen die einzelnen Module dann darunter neu angelegt und alle E/A Variablen manuell neu eingetragen werden? Das exportieren und danach wieder importieren funktioniert nicht, weil die Namen bzw. Adressen unterschiedlich sind. Ist das so richtig? Kann der Block "Modbus_COM_Port - Modbus_Master_COM_Port - Modbus_Slave" so bleiben wie bisher oder muss das auch unter dem neuen COM-Port neu angelegt werden? Für ein paar Hinweise wäre ich dankbar. Schöne Grüße, annD
Last updated: 2023-11-17

Post by annd on Migration von "CODESYS Control for PFC200 SL" zu WAGO FW26 "CODESYS V3.5.19.2" CODESYS Forge talk (Post)
Ich hab's hinbekommen: Nach dem Controller Update hab ich ein neues Projekt gemacht und nur den PFC200(8212) eingefügt (es erscheint dann ein leerer Kbus und eine serielle Schnittstelle COM1). Dann hab ich mich am Controller eingeloggt und den Kbus (Rechtsklick: Geräte suchen) mit allen Modulen automatisch ergänzen lassen. Bei den leeren Modulen hab ich dann das E/A-Abbild in csv exportiert. Dasselbe hab ich bei meinem alten "PFC200 SL" Projekt gemacht. Und dann in Excel alle Variablennamen in die leeren csv kopiert und danach wieder im neuen Projekt importiert. Dann hab ich noch alle Programmblöcke, Tasks, Visualisierungen und auch Modbus TCP Master u. Slave und auch Modbus COM Port Master und Slave in das neue Projekt kopiert. Weiters hab ich alle notwendigen Bibliotheken im Bibliotheksverwalter eingefügt. Dann noch ein paar kleine Fehler korrigiert (ich musst einen anderen Block zum Lesen der Uhrzeit nehmen) bis ich das neue Projekt fehlerfrei übersetzen konnte. Dann konnte ich es auf den Wago Controller übertragen und direkt starten. Es sieht so aus, dass alles läuft. Gruß annD
Last updated: 2023-11-18

Post by reinier-geers on License problem gateway CODESYS Forge talk (Post)
The hole setup is made by 3s. So its a comination of one not two. If Epis decide not to support extra licence whats then the funtion of providing an option with a single license ?? So the idee by 3s has a flod. Epis change the system to add the Stick. I send controller inc stick to Epis. On my software i can see the stick. An then you tel me i need a other license to use an license ?? Makes completly no sense. Codesys should be flexible but is not. I tried Delta. But has no HMI and has its own Codesys ?? Why ?? Then i tried Crist. The block there own system by a password. But dont know the password and cant switch it off. At the end the want me to pay for support to solve ther own made problem. So i send it al back. The extra license is adviced by 3s . Now a few month later still no working solution.
Last updated: 2024-05-01

Post by ihatemaryfisher on Sorting array of any-sized structure CODESYS Forge talk (Post)
In my machine's operation, I need to display multiples tables containing arrays of structured variables. The arrays change during operation, and my supervisor has advised me to write a new bubble-sort for each array. I think I can make a function to sort an array of any data type. This was my own project, and I'm a relatively new coder. I want to know the weaknesses in my approach, and a better method, if one exists. As far as I can test, the function accepts an array of a structured variable of any size, and sort it by any VAR in that structure. But it relies heavily on pointers, which I've heard are bad practice? Function call: // SORT BY BYTE-SIZED VAR IF xDoIt[6] THEN FUNBubbleSortSansBuffer( IN_pbySourcePointer := ADR(astArray[1]), // address of first byte in first element of array IN_pbyComparePointer:= ADR(astArray[1].byCompByte), // points to first byte of the comparing variable (variable you sort by) IN_uiStructureSize := SIZEOF(TYPE_STRUCTURE), // size, in bytes, of the structured variable IN_uiCompareSize := SIZEOF(astArray[1].byCompByte), // size, in bytes, of the comparing variable (variable you sort by) diArrayElements := UPPER_BOUND(astArray,1), // number of elements in array IN_xSmallToLarge := xSortOrder // whether to sort by small2large or large2small ); END_IF Function: FUNCTION FUNBubbleSortSansBuffer : BOOL VAR_INPUT IN_pbySourcePointer : POINTER TO BYTE; // points to beginning of array (first byte of first element) IN_pbyComparePointer: POINTER TO BYTE; // points to first byte of the comparing variable (variable you sort by) IN_uiStructureSize : UINT; // size, in bytes, of the structured variable IN_uiCompareSize : UINT; // size, in bytes, of the comparing variable (variable you sort by) diArrayElements : DINT; // number of elements in array IN_xSmallToLarge : BOOL; // whether to sort by small2large or large2small END_VAR VAR j : DINT; // repeat iteration over array until array ends i : DINT; // iterarte over array, swapping when necesary k : DINT; // iterator from 1 to size of structure (stepping 'through' a single element in array) dwSize : DWORD; // internal var for use in MEMUtils.MemCpy(<size>) // FOR SORTING BY BYTE VAR pbySourcePointer : POINTER TO BYTE; pbySourcePointer2 : POINTER TO BYTE; pbyComparePointer : POINTER TO BYTE; pbyComparePointer2 : POINTER TO BYTE; pbyPointerToBuffer : POINTER TO BYTE; // pointer to single byte buffer byBufferByte : BYTE; // single byte buffer END_VAR dwSize := UINT_TO_DWORD(IN_uiStructureSize); // get structure size (number of bytes) pbyPointerToBuffer := ADR(byBufferByte); // assign pointer to address of buffer byte (because MEMUtils.MemCpy requires a pointer input) CASE IN_uiCompareSize OF // depending on the size of the VAR to sort by (current functionality for BYTE and WORD/INT 1: // BYTE (8 BIT) FOR j := 1 TO diArrayElements DO // for number of elements in array FOR i := 1 TO (diArrayElements-1) DO // same thing, but row[i+1] row is included in swap logic pbySourcePointer := IN_pbySourcePointer + dwSize*(i-1); // point at #1 byte in array element[i] pbySourcePointer2 := pbySourcePointer + dwSize; // point at #1 byte in array element[i+1] // NOTE: because of memory locations, each array element is offset from one another by a number of bytes equal to the size of the structure // We can "walk" from array[i] to array[i+1] via steps equal to the size of the structure // e.g., ADR(array[i+1]) == ADR(array[i]) + SIZEOF([array datatype]) pbyComparePointer := IN_pbyComparePointer + dwSize*(i-1); // point to sorting variable in array element[i] pbyComparePointer2 := pbyComparePointer + dwSize; // point to sorting variable in array element[i+1] // using sort order (small -> large/large -> small) IF SEL(IN_xSmallToLarge, (pbyComparePointer2^ > pbyComparePointer^),(pbyComparePointer2^ < pbyComparePointer^)) THEN // This is where it gets tricky. We've identified pointers for the starting bytes of aArray[i] and aArray[i+1] // and we know the size of aArray[i]. We are going to swap individual bytes, one at a time, from aArray[i] and aArray[i+1] // this allows us to use only a single byte var as a buffer or temporary data storage // e.g., consider a structure consisting of a word, a byte, and a string. it is stored like this // |------WORD-------| |--BYTE-| |STRING------...| // astArray[1] == 1000 0100 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 0001 0010 0100 1000 0011 1100 0101 0101.... etc // performing a single swap (copy into a buffer, etc.) of the first byte of each array element creates this // astArray[1] == 0001 0100 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 1000 0010 0100 1000 0011 1100 0101 0101.... etc // incrementing the pointer adresses for the swap by 1 and swapping again swaps the next byte in each array element // astArray[1] == 0001 0010 0010 0001 1100 0011 1010 1010.... etc // astArray[2] == 1000 0100 0100 1000 0011 1100 0101 0101.... etc // continuing this from k to SIZEOF(TYPE_STRUCTURE) results in a toally swapped row FOR k := 1 TO IN_uiStructureSize DO // copy single byte[k] of array element 1 to buffer MEMUtils.MemCpy(pbyDest := (pbyPointerToBuffer), pbySrc := (pbySourcePointer+k-1), dwSize := 1); // copy single byte[k] of array element 2 to 1 MEMUtils.MemCpy(pbyDest := pbySourcePointer+k-1, pbySrc := (pbySourcePointer2+k-1), dwSize := 1); // copy buffer to byte[k] array element 2 MEMUtils.MemCpy(pbyDest := (pbySourcePointer2+k-1), pbySrc := pbyPointerToBuffer, dwSize := 1); END_FOR END_IF END_FOR END_FOR
Last updated: 2023-08-17

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 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 rcaponi on Codesys Control RTE V3. Remote Control CODESYS Forge talk (Post)
Hello, I would like to have, if possible, some clarification on this function. That is, I would like to understand if it is useful for managing, fom my development PC, the RTE runtime executed on a remote control. This is what the help says: Remote PLC: Opens the Remote Configuration dialog. By enabling or disabling the Control remote PC, not local option, you determine whether a PLC is used that is on a remote or local PC. Accordingly, the menu commands Start PLC, Stop PLC, and PLC Configuration refer to the local PC or a PC reached on the network. For the remote PC, specify the Target PC address, Port number, and a Timeout value (in ms) for the connection (Remote Timeout [ms]). But does this mean that I also need to install the RTE runtime on my development PC? Is it possible to have some more information? Best regards Roberto Caponi
Last updated: 2023-09-22

Post by timvh on VisuElems.CurrentUserGroupId is not stable CODESYS Forge talk (Post)
I'm not sure what you are trying to do, but getting the CurrentUserGroupID like this will not work, because there could be multiple Visualization Clients and each can have a different user that is logged in. Also when you go online with CODESYS and open an Visualization, this is counted as a client. Probably this is the reason you see it changing. What you can to is "iterate" over all clients and then see which user is logged in on which visualization Client. For this you need to add the Visu Utils library to the project and call the FbIterateClients. See https://content.helpme-codesys.com/en/libs/Visu%20Utils/4.4.0.0/VisuUtils/VisuActionUtilities/Function-Blocks/FbIterateClients.html fbClientIteration( xExecute := x_Execute, itfClientFilter := VU.Globals.AllClients, itfIterationCallback := fbIterator, xDone => x_Done, xBusy => x_Busy, xError => x_Error, eError => e_Error); The fbIterator, in the example above, should be an instance of an FB which you have created yourself and this must implement VU.IVisualizationClientIteration. For example: FUNCTION_BLOCK FB_ITERATOR IMPLEMENTS VU.IVisualizationClientIteration Then automatically the corresponding methods will be called. In the HandleClient Method, you will get an interface to the client(s) and then you can get the current user through this interface: itfClient.UserGroupId You can also get the UserName: itfClient.UserName
Last updated: 2023-11-14

<< < 1 .. 23 24 25 26 > >> (Page 25 of 26)

Showing results of 649

Sort by relevance or date