Fehler 4043: Labelformat ungültig!! Was muss ich tun???
CODESYS Forge
talk
(Thread)
Fehler 4043: Labelformat ungültig!! Was muss ich tun???
Last updated: 2006-07-20
Was sollte es eigentlich nach einem RETURN weitergehen ?
CODESYS Forge
talk
(Thread)
Was sollte es eigentlich nach einem RETURN weitergehen ?
Last updated: 2006-04-19
EtherCAT Motor Drive seems was affected by Modbus TCP
CODESYS Forge
talk
(Thread)
EtherCAT Motor Drive seems was affected by Modbus TCP
Last updated: 2013-07-10
Post by duvanmoreno24 on Modbus writing on value change
CODESYS Forge
talk
(Post)
Hi all, I want to know if someone has an idea of how I can write on value change in Modbus Codesys. I have a Wago PLC and I was used to work with E-cockpit which it was quite easy to do that without the necessity to trigger any value when there was a change in the variable ( I will put how easy is ). how you can see just changing the trigger in "On value Change" will do that channel writing automatically when It detects a change in those arrays. On the other hand, in Codesys if I enable the rising edge in Codesys It ask me to put a bool variable and if triggers is going to write that value. That is making me that I have to create a function or a logic to detect the change, the problem I have is that doing that is very tedious. I first approach I got it was to create a Function who returns a bool when the value change, but I tried to keep the old value but what is happening is that in Functions all the data is erased every cycle so I can not keep any Old value. so in the Main program the trigger is going to be TRUE all the time due, the old value is cero every cycle. The second approach I got it was using a function Block (POU_1) and it works but I dont want to instance that function for every Channel or value that I want to check if the value change, Basically if I have 200 values to write trhough modbus I have to create 200 instances of that function which I think it is not practicall at all. It should be a better way to implement this as e-Cockpit from Wago Does. However, I haven't been able to know how.
Last updated: 2024-03-26
Post by squiggleypuff on Can't Add New Version of Modbus TCP Master
CODESYS Forge
talk
(Post)
Turns out Modbus was working despite the pre-compiler errors; I was reading the wrong addresses of the slave device, which was why I was seeing all 0s. Thanks for ignoring me.
Last updated: 2024-04-09
Post by ahuckphin on Issues with Modbus Slave with Raspberry Pi
CODESYS Forge
talk
(Post)
I have a DFRobot RS485 temperature & humidity sensor (SEN0438) connected to my Raspberry Pi via a USB to RS485 adapter. I am able to connect and read the sensor data when running a python code locally. However in Codesys, I encounter this error "A bus error has occurred." and "There was no response in time". Could this be because of Modbus Server Channel and Modbus Server Init configuration on my part? Admittedly I am new to Codesys. To get to this stage, I: 1. added some lines to CODESYSControl_User.cfg 2. added "Modbus_COM" in Codesys and set "Serial Port Configuration" under "General" 3. added "Modbus_Master_COM_Port" in Codesys and checked transmission mode is set to "RTU" 4. added "Modbus_Slave_COM_Port" in Codesys and checked server address is set to 1 (also set 1 in my sensor) 5. added 1 channel and 1 init for "Modbus_Slave_COM_Port" under "Modbus Server Channel" and "Modbus Server Init"
Last updated: 2024-07-10
Post by andrax on CodeSys Raspberry pi I2C driver not found
CODESYS Forge
talk
(Post)
Hi, Communication with the ADS1115 is actually simple. 1. write config 2. write address pointer 3. read conversation register The ADS1115 works like a multiplexer. This means that you do this individually for each channel that you want to read. e.g: Channel 1: write config > write address pointer > read conversation register Channel 2: write config > write address pointer > read conversation register Channel 3: write config > write address pointer > read conversation register Channel 4: write config > write address pointer > read conversation register then you start again from the beginning You can also omit individual channels or read only one. It doesn't matter. I have written the driver so that I can also use it on the TCA9548. The driver is from Stefan Dreyer. In your case, the driver works and communication with the ADS1115 is running. As you can see, the cfgWrong:=FALSE If you could not write or read data, cfgWrong:=TRUE; This means that either something is wrong with your ADS1115 or you have connected something incorrectly. Question: what voltage do you want to measure?
Last updated: 2024-11-08
Post by manuknecht on Detect "Cancel" Press in FileOpenSave Dialog
CODESYS Forge
talk
(Post)
When using the FileOpenSave dialog and using the Visu_FbFileListProvider FB as an In/Output I could not manage to detect the difference of pressing the "Load" button on the dialog vs. pressing the "Cancel" button. In both cases, the selected file is updated if the dialog is closed when checking using the Visu_FbFileListProvider.GetSelectedFileName() command. How can I prevent reading or writing of a file when the "Cancel" button was pressed?
Last updated: 2023-09-19
Post by jeffgamsby on Accessing ModbusTCP addresses from python
CODESYS Forge
talk
(Post)
Hi, I am new to modbusTCP and I am trying to access Input registers from codesys (3.5.SP13). The offset is 16#0000 and I am trying to access Channel 1[24] %IW24 to pull analog values. I am using pyModbusTCP and I need to supply a modbus address and the number of registers to read. What does 16#0000 mean in terms of the actual offset, how do I translate this number plus the channel to access this info via python? Any help would be appreciated, thank you.
Last updated: 2023-09-20
Post by egau on Git - User identification data is lost when codesys is closed
CODESYS Forge
talk
(Post)
It bothers me for sure.
Last updated: 2024-04-04
Post by ewi04 on Git - User identification data is lost when codesys is closed
CODESYS Forge
talk
(Post)
Hallo, it's not a big problem, but it is a bit annoying. The git user identification data is lost when codesys is closed. So I have to enter the information again and again. Is there a way to save the data? Environment: Codesys V3.5 SP19 Patch 4 (64Bit), Git 1.3.0.0 Thanks
Last updated: 2023-11-22
Post by mondinmr on Direct Pointers in IOMapping for EtherCAT with IoDrvEthercatLib.ETCSlave_Dia
CODESYS Forge
talk
(Post)
I have found a very interesting solution using: IoConfigTaskMap IoConfigConnectorMap IoConfigChannelMap The first is the list of IO tasks. The second is the connector for each IO module in the IOMap. The third is the individual input or output on the IOMap. One of the properties of the connector is another pointer to a connector, which corresponds with the connector of the EtherCAT slave. Through this information, it is possible to understand to which EtherCAT slave an IO connectormap corresponds. I am attaching an FB that allows for the construction of an IO map and finding the pointer to the actual IOs in the IOMap based on the bitoffset. FUNCTION_BLOCK IOExplorer VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR inputChannels: COL.LinkedList; outputChannels: COL.LinkedList; ulintFactory: COL.UlintElementFactory; END_VAR METHOD inputAtBitOffsetOfConnector : POINTER TO BYTE VAR_INPUT conn: POINTER TO IoConfigConnectorMap; bitOffset: UDINT; END_VAR VAR it: COL.LinkedListIterator; itf: COL.IElement; elem: COL.iUlintElement; channelInfo: POINTER TO ADVChannelInfo; bitOffsetR: UDINT; END_VAR inputChannels.ElementIterator(it); WHILE it.HasNext() DO it.Next(itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} channelInfo := TO___UXINT(elem.UlintValue); {warning restire C0033} IF channelInfo^.connectorField = conn THEN IF bitOffsetR = bitOffset THEN inputAtBitOffsetOfConnector := channelInfo^.addr; RETURN; END_IF bitOffsetR := bitOffsetR + channelInfo^.size; ELSE bitOffsetR := 0; END_IF END_WHILE inputAtBitOffsetOfConnector := 0; END_METHOD METHOD outputAtBitOffsetOfConnector : POINTER TO BYTE VAR_INPUT conn: POINTER TO IoConfigConnectorMap; bitOffset: UDINT; END_VAR VAR it: COL.LinkedListIterator; itf: COL.IElement; elem: COL.iUlintElement; channelInfo: POINTER TO ADVChannelInfo; bitOffsetR: UDINT; END_VAR outputChannels.ElementIterator(it); WHILE it.HasNext() DO it.Next(itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} channelInfo := TO___UXINT(elem.UlintValue); {warning restire C0033} IF channelInfo^.connectorField = conn THEN IF bitOffsetR = bitOffset THEN outputAtBitOffsetOfConnector := channelInfo^.addr; RETURN; END_IF bitOffsetR := bitOffsetR + channelInfo^.size; ELSE bitOffsetR := 0; END_IF END_WHILE outputAtBitOffsetOfConnector := 0; END_METHOD METHOD scanIO VAR_INPUT END_VAR VAR numTasks: DINT := IoConfig_Globals.nIoConfigTaskMapCount; tType: WORD; ioTask: POINTER TO IoConfigTaskMap; numCon: WORD; connector: POINTER TO IoConfigConnectorMap; numCh: DWORD; channelInfo: POINTER TO ADVChannelInfo; iTsk: DINT; iCon: WORD; iCh: DWORD; i: DINT; _tmpConnList: COL.IList; elem: COL.IUlintElement; itf: COL.IElement; tmpCh: POINTER TO ADVChannelInfo; lastE: DINT; e: COL.COLLECTION_ERROR; e1: Error; END_VAR VAR_INST lF: COL.ListFactory; END_VAR IF outputChannels.CountElements() > 0 OR inputChannels.CountElements() > 0 THEN RETURN; END_IF _tmpConnList := lF.CreateDynamicList(16, 16); //Iterate through all IO tasks FOR iTsk := 0 TO numTasks - 1 DO ioTask := ADR(IoConfig_Globals.pIoConfigTaskMap[iTsk]); //Store the type of the task (Input or Output) tType := ioTask^.wType; numCon := ioTask^.wNumOfConnectorMap; //Iterate through all connectors of the task FOR iCon := 0 TO numCon - 1 DO connector := ADR(ioTask^.pConnectorMapList[iCon]); numCh := connector^.dwNumOfChannels; //Iterate through all channels of the connector FOR iCh := 0 TO numCh - 1 DO //Create a new channel info object and fill it with the address, connector and size of the channel //Connectors is address of field connector in this case like EtherCAT slave //Address is the address of the IOMap //Size is the size of channel data in bits in IOMap channelInfo := __NEW(ADVChannelInfo); channelInfo^.addr := connector^.pChannelMapList[iCh].pbyIecAddress; channelInfo^.connectorField := connector^.pConnector; channelInfo^.size := connector^.pChannelMapList[iCh].wSize; //We put the channel info a temporary ordered list //Order is based on the address of IOMap lastE := TO_DINT(_tmpConnList.CountElements()) - 1; FOR i := 0 TO lastE DO _tmpConnList.GetElementAt(udiPosition := TO_UDINT(i), itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} tmpCh := TO___UXINT(elem.UlintValue); {warning restire C0033} //If the address of the channel is smaller than the address of the channel in the list IF tmpCh^.addr > channelInfo^.addr THEN //Insert the channel in the list at the current position _tmpConnList.InsertElementAt(TO_UDINT(i), ulintFactory.Create(TO_ULINT(channelInfo))); //Clear the channel info pointer channelInfo := 0; //Exit the loop i := lastE + 1; END_IF END_FOR //If the channel info is not 0, it means that the channel was not inserted in the list IF channelInfo <> 0 THEN //Add the channel to the end of the list elem := ulintFactory.Create(TO_ULINT(channelInfo)); _tmpConnList.AddElement(elem); END_IF END_FOR //Iterate temporary list and add the channels to the input or output list lastE := TO_DINT(_tmpConnList.CountElements()) - 1; FOR i := 0 TO lastE DO _tmpConnList.GetElementAt(udiPosition := TO_UDINT(i), itfElement => itf); __QUERYINTERFACE(itf, elem); {warning disable C0033} tmpCh := TO___UXINT(elem.UlintValue); {warning restire C0033} //If type is input, add the channel to the input list IF tType = TaskMapTypes.TMT_INPUTS THEN e := inputChannels.AddElement(ulintFactory.Create(TO_ULINT(tmpCh))); //If type is output, add the channel to the output list ELSIF tType = TaskMapTypes.TMT_OUTPUTS THEN e := outputChannels.AddElement(ulintFactory.Create(TO_ULINT(tmpCh))); ELSE __DELETE(tmpCh); END_IF END_FOR //Clear the temporary list _tmpConnList.RemoveAllElements(); END_FOR END_FOR END_METHOD
Last updated: 2024-02-13
PLCopen XML Import - Creation of object failed... The given key was not present in the dictionary
CODESYS Forge
talk
(Thread)
PLCopen XML Import - Creation of object failed... The given key was not present in the dictionary
Last updated: 2019-01-31
CODESYS Control Win SL: Error Preparation was not successful: could not open network adapter
CODESYS Forge
talk
(Thread)
CODESYS Control Win SL: Error Preparation was not successful: could not open network adapter
Last updated: 2023-05-19
ooops... this runtime was built for raspberry pi (-12, 0x00000BB8, 0xFFFFFFFB)
CODESYS Forge
talk
(Thread)
ooops... this runtime was built for raspberry pi (-12, 0x00000BB8, 0xFFFFFFFB)
Last updated: 2023-06-30
[SOLVED] Install ESI file: Index was outside the bounds of the array
CODESYS Forge
talk
(Thread)
[SOLVED] Install ESI file: Index was outside the bounds of the array
Last updated: 2017-12-15
Internal error:System.NullReferenceException: The object reference was not set to an object instance.
CODESYS Forge
talk
(Thread)
Internal error:System.NullReferenceException: The object reference was not set to an object instance.
Last updated: 2024-05-24
Internal error:System.NullReferenceException: The object reference was not set to an object instance.
CODESYS Forge
talk
(Thread)
Internal error:System.NullReferenceException: The object reference was not set to an object instance.
Last updated: 2024-05-24
Uninstall Codesys2.3 got RUNDLL There was a Problem Starting error
CODESYS Forge
talk
(Thread)
Uninstall Codesys2.3 got RUNDLL There was a Problem Starting error
Last updated: 2024-07-15
Post by gilbertamine on Comparing Arrays of structure
CODESYS Forge
talk
(Post)
If I knew it was this simple... Exactly what I was looking for ! Thanks you very much.
Last updated: 2024-08-23
Post by laazik2 on v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Post)
I am actually wondering as well if there are plans to fix it or not? As adding two modbus devices creates it's own problems with connection limits and other issues, which some slave devices have.
Last updated: 2023-09-05
Post by mozburg on v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Post)
Has there been any progress on this issue? Currently running sp19 patch 5 with all packages updated but unable to add more channels...
Last updated: 2024-01-18
Post by dim54 on MBChannel
CODESYS Forge
talk
(Post)
Hello! I am interested in the Modbus Slave channel parameter uiReadLength to use in the ST-program (see picture). How to read the value of uiReadLength in a ST-program? Only Edwin the Great and Terrible can answer this question.
Last updated: 2024-01-22
Post by vincentger on v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Post)
Any resolution on this? I have currently 75 channels in my project that i brought up from SP18, which means i am 65 Channels above the new limitation?
Last updated: 2024-04-09
Post by jacobwago on v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Post)
Hello All, The solution is updating SP19 Modbus version from 4.3.0.0 to 4.4.0.0 (see attached image for bug fix). Thank you,
Last updated: 2024-09-30
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND
or OR
.