Search talk: detect unused code

 
<< < 1 .. 49 50 51 52 53 54 > >> (Page 51 of 54)

Post by pazderai on CanOpen write issue CODESYS Forge talk (Post)
Thank you for an answer. Unfortunatelly, it doesn't work. The slave needs command byte as follows 0x22. It means expedited transfer where s-bit is not set, therefore data length is not specified. If I use segmented mode by CiA405.SDO_WRITE_DATA it produce command byte as follows 0x21 which is unfortunately supported by the slave and it returns with error 0x05040001 - SDO Abort Code -Client/server command specifier not valid or unknown. I can use CAN API low level to overcome this problem where it is possible to set 0x22 as a command byte, but than I can use user interface to set the communication probably, because I thing that machine expert uses library CiA405.SDO_WRITE for setting the slave. Or am I wrong?
Last updated: 2024-07-16

Post by ucconversions on displaying all incoming CAN bus messages CODESYS Forge talk (Post)
Hello Im using CAN API Im receiving CAN messages with no problem. below is my code. METHOD ProcessMessage VAR_IN_OUT ( Incoming message ) Message : CAN.RxMESSAGE; END_VAR VAR i: USINT; END_VAR recvCANid := Message.udiCanID; IF recvCANid = 16#18FF8247 THEN UserVarGlobal.g_countMsg_RPMset := UserVarGlobal.g_countMsg_RPMset + 1; FOR i := 0 TO 7 DO myDataFF82[i] := Message.abyData[i]; END_FOR END_IF but in this way I can only display CAN messages which I know its ID. I want to display all incoming CAN messages for example first incoming CAN message - I assign it into a variable Message1. second incoming CAN message - I assign it into a variable Message2. third incoming CAN message - I assign it into a variable Message3. Can you give me guidance? Thank you BR
Last updated: 2024-07-18

Post by peterned on Programatically restart Codesys OPC UA server? CODESYS Forge talk (Post)
Hi, I'm using a Festo Codesys PLC (CPX-CEC-C1-V3), which is connected to a HMI panel. Both exchange data via OPC UA. Occasionally, the HMI stops displaying data, and looks as if there is no connection. If the HMI stops, the only way to make it work again is to restart the PLC. Restarting HMI has no effect. When the PLC is restarted, HMI starts working normally again. Is it possible to restart the OPC UA server from PLC code? I hope this will make fixing the HMI possible without a PLC restart. Thanks
Last updated: 2024-07-19

Post by shrikantp007 on new to codesys help on modbus with ardunio modbus rtu CODESYS Forge talk (Post)
Hello , I am new to codesys ,working with it for just 15-17 days so ,i think i am able to installed it and configure it ,not i want to use ardunio program (smart dustbin ,college project using motor and Ultrasonic Module HC-SR04 and servo motor). i use ardunio program to write code with chatgpt to work ardunio as a modbus rtu as i dont have ethernet or wifi shild ,i wrote program in ariduno but now don have idea what change i have to make in codesys to comunicate as modbus slave it give error with bus error ,where i can get all errors ? Thanks in advance :)
Last updated: 2024-07-21

Post by mubeta on Reset problem with CMZ SD/SVM drive CODESYS Forge talk (Post)
In a recent project with SoftMotion 4.15.0.0, where I integrated two SD drives from CMZ (from catalogue EDS and not imported), on CANopen bus, I found that the SoftMotion MC_Reset function does not reset the drive faults. Even if the drive is in fault, either on the device or on the drive at the CoDeSys level, the function does not reset, instead reporting the error code: no error to reset. Finally, I had to connect the reset bit of the ControlWord directly to a tag in my program. Something I never had to do on other drives: Lexium, etc. all reset simply with MC_Reset.
Last updated: 2024-07-24

Post by askic on Generate FBs from source CODESYS Forge talk (Post)
Hello, I'm coming from Siemens (TIA) world and currently learning Codesys. I'd like to know if there is an option to add external txt file with ST code for creation of a function block and then use this file as a source file from which FB will be generated? For example, in TIA, there is an option add external source file to the project structure and then use option "Generate blocks from source". This would create a FB. Does Codesys have something similar? This external source file would look like this: FUNCTION_BLOCK Scaling VAR_INPUT x, k, n : REAL; END_VAR VAR_OUTPUT y : REAL; END_VAR VAR END_VAR y := k*x+n; END_FUNCTION_BLOCK
Last updated: 2024-07-31

Post by hazarath on How extract JSONElement containing Array data CODESYS Forge talk (Post)
I want to extract each element of an Array. Can someone help me with this. When I use JSONElementToString (part of JSON Utilities SL), I am seeing output as "ARRAY" instead of actual data. Here is the JSON content that I want to read : { "value1Unit": { "units": "M" }, "data": { "stepSize": 300.23, "points": [6,8] } } I would like to read each item of the element "points" i.e. 6 and 8. Here is the code I used, // Reading the content as JSON reader ( xExecute := execute , pwData := ADR ( converted_value ), jsonData := jsonDataStorage ); // Get the JSON Element jsonDataStorage.FindFirstValueByKey( wsKey := fidKeyVar, diStartIndex := searchElem, jsonElement => jsonElement ); JSON.JSONElementToString ( element := jsonElement , wsResult := valueWstring ); The content of the output of valueWstring is shown as "ARRAY" instead of the array items i.e. 6 and 8 Please can someone help me.
Last updated: 2024-07-30

Post by malie on Bibliothek konnte nicht aufgelöst werden CODESYS Forge talk (Post)
Ich hab noch etwas rausgefunden, falls jemand anderes noch ähnlich lustige Probleme hat. CoDeSys kann sich an der Windows UAC vorbeischleichen. Sprich man öffnet die CoDeSys IDE ohne Umweg über den CoDeSys Installer (in dem man gefragt wird ob man mit Administrator Rechten arbeiten will) und ist manchmal Admin. Deshalb kam ich nicht auf die Netzwerklaufwerke. Ich hab keine Ahnung warum das so ist. Abhilfe hab ich mir mit dem Registrykey geschaffen mit dem man auch als Admin auf Netzwerklaufwerke zugreifen darf. Einfach folgende Code in eine "DateinameMeinerWahl.reg" Datei kopieren und mit Rechstklick der Registry hinzufügen. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "EnableLinkedConnections"=dword:00000001
Last updated: 2024-09-23

Post by timvh on Clarifications regarding the appropriate runtime system to use CODESYS Forge talk (Post)
If you are not using any specific Raspberry Pi functionality, then probably the "universal" Control Linux ARM SL is the approriate runtime to run on the Pi. For the license it doesn't matter which runtime version you choose, because this is not hardware based anymore, but application based. Best is to use the latest version of CODESYS. To determine which license you need, double click on your device, go to the tab License metrics.... Generate the code for your application and see which license you need based on the metrics of your application.
Last updated: 2024-09-24

Post by timvh on Visuutils FbOpenDialog(Extended) not open Dialog from POUs CODESYS Forge talk (Post)
I had a similar situation recently where this didn't work, but read to the end to see the solution. The reason is that CODESYS only downloads visualisations (dialogs) if they are part of the project or linked to the project. In your case the dialog is not loaded onto the controller. But the solution is pretty simple: Double click on the Visualization Manager in your application. Select the Tab "Visualizations". Here you can see that your dialog is not "checked". Do this manually and load your project on the controller. Then your code should be able to open the dialog, because now it exists on the controller.
Last updated: 2024-09-28

Post by timvh on FB string and naming CODESYS Forge talk (Post)
I see, you want to initialize the FB. To be able to initialise it like you described, you need to add the FB_Init method to your FB. (right click on the FB, select add object --> method). Then press the arrow down, to select the FB_Init (overwrite default implementation). In the VAR_INPUT section of this method, add the variable --> Tag : STRING; Then in the code section of this method add: THIS^.Tag := Tag; // copy initial value to local variable in FB Search Google if you want to know more about FB_Init. PS, reflection + instance path, is also an option if you want to get the full name of the instance (path) of the Function Block. See: https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_instance_path.html
Last updated: 2024-09-30

Post by struccc on HTML5 Controls - string(>80) values CODESYS Forge talk (Post)
Dear all, does anyone have experience with HTML5 controls recently? CODESYS 3.5.20.30 / Visualization 4.6.0.0 I'd like to create a simple lightweight text editor, with proper multiline handling, cut & paste, scrolling, etc. And it seems to work fine, just have problems with strings longer than 80 bytes.... Declaring a variable sText1 : STRING(8000) and referencing it in the HTML5 Controls corresponding value property works perfectly one way: the code receive the data as a string (See log1)... (Note TypeID 1000...) Also sending back the data (seems to work (See log2) except it doesn't change the value of the bound variable. Probably the issue is with using SendSimpleValue method... Naturally, I could do a workaround, but maybe there is a more standard way to implement this... Please let me know if you have any suggestions.
Last updated: 2024-10-23

Post by niallel on CamBuilder and first boundary position not zero CODESYS Forge talk (Post)
Hi, I've read the CamBuilder documentation and it shows to use the left boundary of the first segment as SMCB.BoundImplicit(), so that the transition is as smooth as possible. With this it sets X and Y to 0. My first slave position is not 0 (say for example it's 100), so I would set it with SMCB.Bound(0,100). My question is that when the cam goes back to the start (Periodic := TRUE) , will it blend with the last position (360, 100) if I do this? I imagine it will, but the documentation isn't clear as the information in the Periodic Cams only says to set Smooth Transition in the cam properties - but when I'm defining it with code there isn't an option for Smooth Transition to be set. Hope this makes sense? Many thanks,
Last updated: 2024-10-23

Post by bertcom on Converting each character to a string into ASCII CODESYS Forge talk (Post)
Good afternoon, I have a project where i need to split a string and send it in ascii code to an Domino Printer. Concept: i get an String from an Zebra scanner looking like this : " R002043;5410761402862;Oil Plus 2C Comp.A - Gris Belge;1286193824;" To start is the ";" the seperator. i found some functions to delete the ";" in a string. this is okay but now i want to convert each digit in the string into ascii like this: R=82 0=48 0=48 2=50 0=48 ... This because the printer wants to receive a string like this: <esc>OQ001TE 82 48 48 50 48 ...<eot></eot></esc> Anyone who can help me with setting me on the right track with some advice?
Last updated: 6 days ago

Post by bertcom on Converting each character to a string into ASCII CODESYS Forge talk (Post)
Good afternoon, I have a project where i need to split a string and send it in ascii code to an Domino Printer. Concept: i get an String from an Zebra scanner looking like this : " R002043;5410761402862;Oil Plus 2C Comp.A - Gris Belge;1286193824;" To start is the ";" the seperator. i found some functions to delete the ";" in a string. this is okay but now i want to convert each digit in the string into ascii like this: R=82 0=48 0=48 2=50 0=48 ... This because the printer wants to receive a string like this: <esc>OQ001TE 82 48 48 50 48 ...<eot></eot></esc> Anyone who can help me with setting me on the right track with some advice?
Last updated: 6 days ago

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 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 .. 49 50 51 52 53 54 > >> (Page 51 of 54)

Showing results of 1326

Sort by relevance or date