Hi Thank you very much for your answer. Is there a program to drive the multiplexer.
Hello, Is there a simple example of using an I2C multiplexer (PCA9548A). I found Stefan's post but I can't find a simple example or documentation. My goal is to use the multiplexer to manage 6 or 8 analog output modules (MCP4725). Thanks in advance.
Hi Julien I think there is no property to resolve your problem. I try myself your example and it works very well, droplist is drawn under combobox. But I discovered something, the combobox must have enought place to develop the droplist. If Combobox is placed on the bottom of the page the drop list is drawn above the combobox, because it has no place to draw under it.
Hello. With CODESYS, there is no device description for Eaton PLC, or Schneider one, or no other. To program an Eaton PLC you have to use Xsoft-CODESSYS-3, a software from Eaton. You can get an evaluation version here : http://applications.eaton.eu/sdlc/?lx=11 But to download your program and use it with a real PLC you must get a licence from Eaton. CODESYS is free of charge, but many manufacturer version are paid (Eaton, Schneider, Wago, ...) BR
Thanks Ingo, I tried your stuff, but, for me , it work as all others I tried. That is to say, I get a blinking Led whatever settings I use. Finally I tried a MCP4725 chip and I get a a variation of the light intensity of my led, without flashing... ๐๐ The problem is that I can only address 2 circuits of this type on the I2C bus.๐ฎ I noticed that most of the examples found with the PCA9685 circuit use servo motors or motors for which the notion of blinking seems not to be a problem... Or I really don't...
Hello, I'm trying to drive LEDs (intensity variations) with a raspberry, a PCA9685 module communicating by I2C. I tried the PWM examples provided with the raspberry runtime, I tried the various (very succinct) examples found on the forum, nothing works.๐ The only thing that works is to use the outputs of the PCA9685 and make them flash quickly, which shows me that my PCA9685 module is properly addressed and working. How to find relevant information about libraries, for example "Raspberry I2C AdafruitPWM"....
Hi, J think you can't read file in only one time. You have to read number by number, until you reach the end of file. Depending the way you used to write your file : 1ยฐ) If each number as the same format you can define what you want to read by the length of a number 2ยฐ) if you used a separation character, you can read character by character and concat characters into a string, until you reach the end of line or this special separating character. 3ยฐ) if you write your file with columns (Excel) you...
Hi Each time a new version of CODESYS Development System V3 arrives, I have to download this new version and some other packages as : Device Reader, Memory Tools, Package Designer, CODESYS Control for Raspberry Pi Is there a way to easily find all the new packages in the same version. Thank you in advance for your ideas
Hi, When you configure the command to open a dialog box, you can specify X and Y position. So the simplest solution is to set X and Y position of the dialog box for each command button. There are some examples of mouse position management in the CODESYS store ("Visualization Elements" for example). You can therefore obtain the position of the mouse and calculate the display position of the dialog box. BR
Hi, When I use an Array like yours : Myarray : ARRAY[0..9] OF INT; And I set 'Max. array index' to 2, I got 4 lines in the table. You can also : - use a variable (for example : diIndexAff) as 'Max. array index and It works dynamically. calulate the value of the variable like this : VAR diIndexAff:DINT; END_VAR (Max value calculation minus 2) diIndexAff:=UPPER_BOUND(Myarray,1)-2; I did not try with the second try (_array : ARRAY[*] OF INT;). Hoping to help you. BR.
Hi, You can declare an ARRAY, for example: MyArray AT %IW0: ARRAY [0..100] OF INT; And declare an index MyIndex :INT; And then you can reach the variable you want read or write MyArray[MyIndex] BR
Hi, One idea : You can use "network variables" to share data between the two PLC and display data from PLC2 by web visualization on PLC1. See here : https://help.codesys.com/webapp/_cds_f_networkvariables;product=codesys;version=3.5.16.0 Another idea : Use "Remote TargetVisu", see here : https://help.codesys.com/webapp/_visu_execute_remote_target_visu;product=core_visualization;version=3.5.16.0 BR
Sorry, I didn't pay attention to the client you were using. The CoDeSys V2 OPC server works in OPC DA and the CODESYS V3 OPC server works in OPC UA. I'm glad to have helped you. This is the purpose of the forum. BR
Yes you can call a function. You also can simply replace a variable by an equation. For example, instead to use a variable for "change color" property, you can write something like that : iValeur1>=25 AND iValeur1<=241 So you can avoid to create a special variable managed in a program module, it can be very usefull. But it can also make more difficult to understand a complete application, because the program is "hidden" in a lot of modules (PRG, FB, FUN) and in several visualization objects. BR
Hi, The OPC Configurator is used to configure the OPC server. As soon as you save the configuration this starts the OPC server and you can then close the configurator. When you want to connect with your OPC client, you should see "CoDeSys OPC02" or "OPC Server for CoDeSys V2.0" which is the server on which to connect. Please note, I discovered that the name of your CoDesys project must not contain spaces. And when you define this name in the OPC configurator, you only have to put the name, without...
Hi, It seems that the length of a chain must be defined only by a constant. So you can only write : testName : STRING[10]; And not : testLength : BYTE:=10; //Even if we initialize the value testName : STRING[testLength]; //Not OK Even in the case of a variable declaration (not a structure), BR
Hi, PLCWinNT is a real soft PLC. It is fully operationnal, but without licence it runs during two hours. To test a program it is fully sufficiant. To use it, you need : 1ยฐ) Choose PLCWinNT in Target Setting. (Ressources -> Target Setting) 2ยฐ) Uncheck the simulation option (Online Menu) 3ยฐ) Define Communication parameters (Online Menu) Address IP is Localhost (Internal IP addresse of your PC) or the real IP address of your PC. 4ยฐ) Start PLCWinNT 5ยฐ) Login (Online Menu), if there is no program on the...
Hi, Now, there is a way to do responsive design. You can find a Responsive Design Example in the CODESYS Store : ;https://store.codesys.com/responsive-design-example.html BR
Hi, In simulation mode there is not any communication between your CoDeSys application and outer. You must use the soft PLC (PLCWinNT, installed on your PC with CoDeSys) ) to communicate with another application. (OPC server, ...) BR
Hello, 1ยฐ) You can copy a selected area from excel and paste it into CODESYS only if your Global Variable List (or Local List) is in Textual view. For example, if My excel part is : A | B | C ---------- | ---------- | ------ iVar1 | INT | Comment 1 iVar2 | INT | Comment2 When I past into a GVL, I get this : VAR_GLOBAL iVar1 INT Comment 1 iVar2 INT Comment 2 END_VAR But then you need to correct format, by adding special caracters ":;(",for example : iVar1 : INT; (Comment 1)* 2ยฐ) I think there is no...
Hi, I think you have two ways to do that : 1ยฐ) Expensive solution : With "CODESYS Visual element toolkit" which can ordered via the 3S sales department. Expensive but more efficient, you can add a program to your object. 2ยฐ) Free solution : With a visualization page with parameters - create a visualization page, called SpecialLamp (for example !), with several object : circle, text display, ... - define variables into the Interface Editor of this page. - use this variables to animate your objects....
Hi, As you said this option has been deleted from from the current versions of CODESYS. But, there is a solution I used. You can dowload a library called "DebugLogger.library" here : https://forge.codesys.com/lib/debuglogger/home/Home/ In this library there is a Parameter List. You can then copy or export this library into your own library and modify his name and the content to adapt the parameters to your needs. But be CAREFUL and only modify the usage parameters once in your project, otherwise...
Hi, With a button in the visualization you can't force a physical input. So it will works in simulation mode, but in real situation physical input will takes priority ! If you want to control an output (or whatever variable) with a physical input and with a button, you have to use 2 variables. For example, a very simple one !! : VAR MyButton:BOOL; ( to use with the button in a visualization page) MyInput AT %IX0.0:BOOL; (Physical input) MyOutput AT %QX1.1:BOOL; (Physical output) END_VAR (Program...
Hello, This is normal operation of the simulation mode. You have to press the button once so that it takes the correct value. To avoid this, you can initialize the variable associated with the button to the false value. BR
My previous remark is still right, and you saw it with your example in C++ In any case, even with a pointer, if you try to move an array into another (whatever the type of data), the destination array must have the same structure as the source array. When you use only the first source table level, it works well, because system take the two first element ( Position and Width) and forget the third, because destination table consist of 2 elements. But when you use the entire table, system don't know...
Hi, "cannot convert type 'ARRAY[0..9] OF BOX' to type 'ARRAY[*] OF Object" I think the error is that you try to transfer an ARRAY of BOX into an ARRAY of Object. But a BOX contains 3 elements (Position, Width, Color) and an Object contains only 2 elements (Position, Width) ! System don't know what to do with "Color" !! You have to use a same type of ARRAY, or to transform Object type into Box Type. For example : FUNCTION_BLOCK Transform_Object_To_Box VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR_IN_OUT...
Hi, "cannot convert type 'ARRAY[0..9] OF BOX' to type 'ARRAY[*] OF Object" I think the error is that you try to transfer an ARRAY of BOX into an ARRAY of Object. But a BOX contains 3 elements (Position, Width, Color) and an Object contains only 2 elements (Position, Width) ! System don't know what to do with "Color" !! You have to use a same type of ARRAY, or to transform Object type into Box Type. For example : FUNCTION_BLOCK Transform_Object_To_Box VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR_IN_OUT...
Hi, "cannot convert type 'ARRAY[0..9] OF BOX' to type 'ARRAY[*] OF Object" I think the error is that you try to transfer an ARRAY of BOX into an ARRAY of Object. But a BOX contains 3 elements (Position, Width, Color) and an Object contains only 2 elements (Position, Width) ! System don't know what to do with "Color" !! You have to use a same type of ARRAY, or to transform Object type into Box Type. For example : FUNCTION_BLOCK Transform_Object_To_Box VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR_IN_OUT...
Hi, "cannot convert type 'ARRAY[0..9] OF BOX' to type 'ARRAY[*] OF Object" I think the error is that you try to transfer an ARRAY of BOX into an ARRAY of Object. But a BOX contains 3 elements (Position, Width, Color) and an Object contains only 2 elements (Position, Width) ! System don't know what to do with "Color" !! You have to use a same type of ARRAY, or to transform Object type into Box Type. For example : FUNCTION_BLOCK Transform_Object_To_Box VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR_IN_OUT...
Hi, You can acces a bit into a word (or other type as UINT, INT, ...) only with a direct value, a constant, or a BIT data type into a structure. Please see : https://help.codesys.com/webapp/_cds_operands_variables_accessing_bits;product=codesys;version=3.5.15.0 For your example, you can write : VAR_GLOBAL CONSTANT iMyBit :UINT:=2; END_VAR (Program) wOutputs.iMyBit := TRUE; wOutputs.5 := TRUE; BR
Hello FabioPD, Before posting this idea, I tested it in a standard configuration and it works. What is a standard configuration, for me : - Periodic MainTask 20 ms calling PLC_PRG - Periodic VISU_TASK 100 ms - 3 visualization pages. - Tests in simulation mode and with CODESYS Soft PLC. - Target visualization and Web visualization. BR
Hello, I'm trying to do the same thing and I don't understand how to do. Into CODESYS HELP they spoke about ParameterList here : https://help.codesys.com/webapp/_cds_cmd_save_project_as;product=codesys;version=3.5.15.0 , in the chapter "Before saving a project as a library:" "A parameter list is a special type of global variable list." yes, but how to get it ? BR
Hello, If you want to knows each page change, you can write something like that : PROGRAM PLC_PRG VAR stMem_Page_Visu:STRING; (To memorize the name of the last page) iCompteur:INT; (Only to test th program) END_VAR (Program) (If the current page is different from the last page, you do what you want to do ...) IF VisuElems.CURRENTVISU<>stMem_Page_Visu THEN iCompteur:=iCompteur+1; (In this example I add 1 in a counter) END_IF ... (Here you can have some other parts of you program) ... (At the end,...