Post by talhaali on Alarm status in logic
CODESYS Forge
talk
(Post)
Hi, I am trying to access active alarms in code(As alarm count variable updates only when we go to to alarm table frame in visualization). I wrote following code but it is not working: VAR iCountActiveAlarms : INT; parritfActiveAlarms : POINTER TO ARRAY[0..0] OF IAlarm; itfAlarmManagerClientAll : IAlarmManagerClient; END_VAR AlarmManager.g_AlarmHandler.GetActiveAlarms( itfAlarmManagerClient :=itfAlarmManagerClientAll, iCountActiveAlarms => iCountActiveAlarms, parritfActiveAlarms => parritfActiveAlarms); The Value is always 0. Please help.
Last updated: 2024-06-06
Post by timvh on Array to String
CODESYS Forge
talk
(Post)
The new (UTF8) string library is faster and can handle large strings. https://content.helpme-codesys.com/en/CODESYS%20String%20Libraries/_strlib_start_page.html PS, in CODESYS, the maximum string length is not 255 characters. The String functions of the standard library are limited to strings of 255 characters. But you can use other (memory) functions to handle strings larger than 255 characters.
Last updated: 2024-07-22
Post by timvh on Array to String
CODESYS Forge
talk
(Post)
The string_Util_Intern is not the library I referred to. With a CONCAT function (also with the string util library) a search is done for the NULL character. If you concatenate 20000 characters to one string, then the longer the string, the longer it takes to find this NULL character.
Last updated: 2024-07-24
Post by dhumphries on Not able to see input data coming from eip adapter on codesys
CODESYS Forge
talk
(Post)
Does the device have a green icon next to it when the PLC is running? If not you have some kind of communication problem, wireshark may be picking up some data but the scanner may not be configured correctly to receive the data. Check the T>O and O>T bytes and make sure they match on both the scanner and adapter. I've had very little success loading a .eds file and having the configuration work without some manual configuration. If you have a green icon, have you enabled the device to always update variables?
Last updated: 2024-03-02
Post by kazuhiro on Problems using MySql Library and SysProcessExecuteCommand2 together
CODESYS Forge
talk
(Post)
I use fbMsSQL_compact(FUN) of the MySQL Library to write data to the database. There is no problem when writing data using only fbMsSQL_compact(FUN). However, when I try to write data obtained using SysProcessExecuteCommand2 to the database using fbMsSQL_compact(FUN), an error message "Dest server on ip address:xxx.xxx.xxx.xxx and port:1433 is unreachable" appears and writing is not possible. From what I have researched, it seems that writing is not completed in one cycle of fbMsSQL_compact(FUN), and when SysProcessExecuteCommand2 is executed first in the second cycle, the work done in one cycle of fbMsSQL_compact(FUN) is reset. Could you please give me some advice?
Last updated: 2024-06-18
Post by kazuhiro on Problems using MySql Library and SysProcessExecuteCommand2 together
CODESYS Forge
talk
(Post)
I use fbMsSQL_compact(FUN) of the MySQL Library to write data to the database. There is no problem when writing data using only fbMsSQL_compact(FUN). However, when I try to write data obtained using SysProcessExecuteCommand2 to the database using fbMsSQL_compact(FUN), an error message "Dest server on ip address:xxx.xxx.xxx.xxx and port:1433 is unreachable" appears and writing is not possible. From what I have researched, it seems that writing is not completed in one cycle of fbMsSQL_compact(FUN), and when SysProcessExecuteCommand2 is executed first in the second cycle, the work done in one cycle of fbMsSQL_compact(FUN) is reset. Could you please give me some advice?
Last updated: 2024-06-18
Post by damian177 on Problem with downloading OPC UA tags by Data Source Manager
CODESYS Forge
talk
(Post)
Hi, In Codesys V3.5 SP20, using Data Source Manager I am trying to connect to the OPC UA server and receive tags from it. The connection is ok, but the Codesys have a problem with downloading Tags group. The window (downloadingTags.jpg in attachement) never stop. After waiting for a while, I disconnect the connection and only the Server group remains downloaded, with OPC UA server diagnostic data (and this is read in Codesys). Of course, I tried connected via another OPC UA client : UaExpert , and everything works as it should, all tags are downloaded (Uaexpert.jpg screen). Has anyone on the forum encountered the OPC UA client configuration in Codesys? Is it possible to manually request the appropriate tags from the OPC server for reading in Codesys?
Last updated: 2024-09-03
Post by shabroz-gill on Exception when OPCUA datasource disconnects from Server
CODESYS Forge
talk
(Post)
If i loose the network and the opcua data source suddenly looses connection with the server, i get an exception and my application stops working. I am using the latest version of the communication add v4.5.2.0 Is this a known issue? This makes the datasource unusable because it is inevitable that we will loose connectivity at some point, and the datasource crashing everything due to that seems to be a deal breaker. I can provide more details is someone from codesys is reading this. You can recreate is by just shutting off the Opc server after the codesys data source is connected and reading data from it. The codesys app does not crash everytime and sometimes it is able to reconnect without crashing, so you may have to try this a few times to see the exception. Best regards
Last updated: 2024-09-16
Post by taqamert on CANopen PDO Issue with Pressure Sensor in Codesys
CODESYS Forge
talk
(Post)
Hello everyone, I am using an IFM CR0303 model PLC, which has a tilt sensor and a pressure sensor connected via CANopen. Both sensors are from the same brand (ATEK). I can read data from the tilt sensor without any issues, but I am unable to read data from the pressure sensor. I have added the EDS file in the PLC configuration and adjusted the node-ID settings. When I check with the PCAN-View application, I can see that the selected PDOs are coming through, but the data is not reaching the Codesys side. What could be the issue, and what can I try to resolve it? Can anyone help me?
Last updated: 2024-10-22
Post by usacodesysuser on How to connect serial devices ?
CODESYS Forge
talk
(Post)
@eschwellinger do you have any examples of using a USB barcode scanner? I have read through the forums here and I am unable to find how to get the barcode data to populate in a text field without having to first click into the text field to activate it. Is there a library that allows you to access the barcode data? I am really new to this in general any help is greatly appreciated, hopefully you have a pretty clear example
Last updated: 2024-01-06
Post by hoatran on Use third party actuator with IO-Link Master (IFM)
CODESYS Forge
talk
(Post)
The generic sensor FB is for controlling the sensor via its cyclic input (PDI) and output (PDO). In this case, ifm raw cyclic input and output data are WORDs (16 bits total) The PDO data from the Buerkert unit are SINT (8 bits) In this case, I would use the unpackword fb from the CAA memory library to unpack the valve feed back value into the appropriate location.
Last updated: 2024-04-23
Post by yannickasselin on How to sort JSON object in codesys
CODESYS Forge
talk
(Post)
Just adding: sSubscriberdata := ''; Right before your memcopy should fix the extra characters. It is because your are copying 36 characters into a string which can contain more than 36 characters and there is garbage left in the extra characters. Regarding the parsing of json, I usually build a structure that mirrors the json data and use the available methods in the IIoT library to parse the data and fill the structure.
Last updated: 2024-05-08
Post by veneto on OPC UA Client
CODESYS Forge
talk
(Post)
Ciao damian177, provo a chiederti un'informazione. Sul mio progetto Codesys(ver.3.5 SP17) non Γ¨ visibile l'oggetto "Data Source Manager". Il PC con il progetto Codesys(client) Γ¨ collegato via rete TCP ad un PLC Siemens1200(server). Sul PC con Codesys ho installato UAexpert(client) e riesco a vedere le variabili del PLC1200. Riesci ad aiutarmi a capire come mai non Γ¨ visibile l'oggetto "Data Source Manager"? Molte grazie
Last updated: 2024-09-06
Post by mgabryel on Problems with CAN 2.0 comunication on Wago PLC (Codesys 3.5)
CODESYS Forge
talk
(Post)
Hello, I am trying to program CAN Bus comunication on WAGO PLC (more precisely on WAGO Touch Monitor model TP600). I am using for this purpose library "WagoAppCanLayer2" from Wago company. My IDE for programming this device is CODESYS V3.5 SP19 Patch 2 + (64-bit). My program is written in Structured text using function blocks from previously mentioned library. Here is code of this program: 1) Variables declarations: PROGRAM PLC_PRG VAR oOpenInterface : WagoAppCanLayer2.FbCanL2Open :=( udiBaudrate := 125000 ); xInterfaceIsOpen : BOOL; sInterfaceInfo : STRING; oReceive : WagoAppCanLayer2.FbCanRx29BitFrame :=( xBufferMode := FALSE, wCanId := 16#181 ); xRecv : BOOL; sReceiveInfo : STRING; oSend : WagoAppCanLayer2.FbCanTx29BitFrame :=( dwCanId := 16#100, //was 16#201 xRtrFrame := FALSE ); xSend : BOOL; sSendInfo : STRING; oCanDiag : WagoAppCanLayer2.FbCanErrorInfo; xRst : BOOL; aSendData : ARRAY [1..8] OF BYTE; bSendLen : BYTE; TON_0 : TON; TON_1 : TON; END_VAR 2) Program body: oOpenInterface( xEnable := NOT xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE ); sInterfaceInfo := oOpenInterface.oStatus.GetDescription(); xInterfaceIsOpen S= oOpenInterface.xValid AND NOT oOpenInterface.xError; oReceive( xEnable := xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, xRxTrigger := xRecv ); sReceiveInfo := oReceive.oStatus.GetDescription(); IF NOT xRecv THEN IF oReceive.bRxNBytes > 0 THEN oReceive.aRxBuffer[1]; oReceive.aRxBuffer[2]; oReceive.aRxBuffer[3]; oReceive.aRxBuffer[4]; oReceive.aRxBuffer[5]; oReceive.aRxBuffer[6]; oReceive.aRxBuffer[7]; oReceive.aRxBuffer[8]; END_IF xRecv := TRUE; END_IF aSendData[1] := 224; aSendData[2] := 13; aSendData[3] := 14; aSendData[4] := 15; aSendData[5] := 222; aSendData[6] := 13; aSendData[7] := 14; aSendData[8] := 15; bSendLen := 8; TON_0(IN:= NOT TON_1.Q, PT:= T#2S , Q=>xSend, ET=> ); TON_1(IN:= TON_0.Q, PT:= T#2S , Q=>, ET=> ); oSend( xEnable := xInterfaceIsOpen, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, aTxBuffer := aSendData, bTxNBytes := bSendLen, xTxTrigger := xSend ); sSendInfo := oSend.oStatus.GetDescription(); oCanDiag( xEnable := TRUE, I_Port := IoConfig_Globals.WAGO_CAN_LAYER2_DEVICE, xTriggerResetCounter := xRst, xValid=> , xError=> , oStatus=> , wBusState=> , wBusDiag=> , uiRxOverflowsL2=> , uiTxOverflowsL2=> , uiRxOverflows=> , uiMsgTimeouts=> , uiBusOffs=> , uiBusWarnings=> ); Program first opens comunication on CAN 2 device and then periodically try send one CAN data frame. After starting program CAN 2 interface is properly open. The xSend variable is toggling with period 2s. When program sends data an "Tx overflow" error appears. When I am watching CAN_H line on DSub 9 socket i am not able to see proper CAN frames - see screenshot attached to this message. Could somebody help me determine what is wrong with this program. Best regards
Last updated: 2024-08-02
Post by reinier-geers on Softmotion general
CODESYS Forge
talk
(Post)
Hi, Im busy using softmotion. But its reading data , but no respons on the commands. Most examples has Softmotion General exis pool. How can get that?
Last updated: 2023-12-19
Post by kislov on Visu Plugin 4.5.0.0, "Visu, Webvisu: Improve diagnosis"
CODESYS Forge
talk
(Post)
Hi. I have question about new feature in Visu Plugin 4.5.0.0: https://www.codesys.com/fileadmin/data/Images/System/Releaseinformation/Release-Notes-CODESYS-Visualization-4500.html VIS-3409 Improvement Visu, Webvisu: Improve diagnosis (legacy) Please tell me how I can activate this diagnosis feature.
Last updated: 2023-12-20
Post by hclai on Table Content with Multilanguage
CODESYS Forge
talk
(Post)
I have an data structure which intend to list in a table and let user to add the content to the table. How can we able to support for displaying different language in the content of the table? which is dynamic to the user input.
Last updated: 2024-01-10
Post by smartcoco on Bit / Bool data types in function parameters
CODESYS Forge
talk
(Post)
Memory addressing is measured in bytes, with BOOL occupying one byte. BIT is quite unique as it occupies one bit. So, try not to use BIT in the program. You can use the Unpack function to solve your problem.
Last updated: 2024-01-18
Post by ewi04 on Git - User identification data is lost when codesys is closed
CODESYS Forge
talk
(Post)
With git 1.4.0.0 it has gotten even worse. Now i have to enter the information every commit. Great.. Doesn't that bother anyone?
Last updated: 2024-01-26
Post by davidbo on I2c write is BeforeWriteOutputs needed?
CODESYS Forge
talk
(Post)
I have made an I2C library where writing happens by calling write8 I now see that I do not call BeforeWriteOutputs at all, however it seems to work data are sent at least for an hour. So is BeforeWriteOutputs needed
Last updated: 2024-02-07
Post by mondinmr on Direct Pointers in IOMapping for EtherCAT with IoDrvEthercatLib.ETCSlave_Dia
CODESYS Forge
talk
(Post)
Using SDO, I can read the EtherCAT mappings and offsets from various registers like 0x1c12, 0x1c13, etc. When I obtain registers mapped in the PDOs and various offsets, I could technically access directly to the statusword, controlword, etc., if they are mapped. I have noticed that on IoDrvEthercatLib.ETCSlave_Diag I can find pointers to the input and output buffers. However, although the input buffer can be easily read by referring to what has been obtained from the SDOs, it is not possible to write to the output buffer, as it is overwritten in each cycle by the data from the IOMapping task. Is there a way, knowing an instance of IoDrvEthercatLib.ETCSlave_Diag, to obtain the pointer to the first data in the IOMapping? The offsets are identical to those of the PDOs, but obviously the data is a copy. For me, the cleanest thing would be to access the pointers on IOMapping, for DS402a devices to retrieve the key data and point them to internal references. I need to know this as, having developed our own motion library, I would like to simplify the initial setup by eliminating unnecessary and nonsensical mappings that can lead users to unnecessary errors. In the current version that we have been using for years, we have to map everything manually. I would like to pass only the slave reference to the FB_init constructors and eliminate the mapping.
Last updated: 2024-02-12
Post by sumit on Not able to see input data coming from eip adapter on codesys
CODESYS Forge
talk
(Post)
Yes, green icon is there, this time I tried by enabling the device to always update variables but results are the same. I have attached the screenshot and eds file I am using.
Last updated: 2024-03-06
Post by rckalex on Data Source Limit
CODESYS Forge
talk
(Post)
There appears to be a limit to the number of OPC Servers that can be connected simultaenously. 1-10 work but adding an 11th makes one of the previously linked ones unavailable. Is this a soft setting that can be adjusted? Using 3.5.18.30 on Win x64
Last updated: 2024-03-06
Post by rckalex on Data Source Error 418
CODESYS Forge
talk
(Post)
Trying to connect to a Codesys V3 datasource but am unsuccessful. The error information for the datasource reads: Failed (not nearer specified) Error ID: 418 Can anyone shed light on what that error means?
Last updated: 2024-03-06
Post by sumit on Not able to see input data coming from eip adapter on codesys
CODESYS Forge
talk
(Post)
i-campbell, Thank you the suggestion, issue was the windows firewall not allowing the UDP traffic to pass through for EIP. thanks again
Last updated: 2024-03-07
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
.