Post by docker on Canopen connection. Unknown node id.
CODESYS Forge
talk
(Post)
hi, i am currently trying to adapt an i/o device for a project. the node id is unknown and there is no eds file available. no data is being emitted from the device as a giveaway, the baudrate is known but useless without the node id. is there an sdo request available to determine the id? i cannot get the device to leave pre op status even with a global nmt request. please help. no hair left.
Last updated: 2023-09-25
Post by eschwellinger on OPCUA Ctrl-Node fehlt
CODESYS Forge
talk
(Post)
.. du schreibst Runtime 4.10 damit meinst du die PFC200 SL Runtime aus dem CODESYS Store?
Last updated: 2023-12-04
Post by user0815 on Web Socket Client SL -Bibliothek Fehler
CODESYS Forge
talk
(Post)
Sobald ich probiere eine Nachricht von Node-RED an Codesys zusenden.
Last updated: 2023-12-18
Post by pernockham on Linking to IO during runtime with hot swap?
CODESYS Forge
talk
(Post)
I have a project where a single PLC shall control multiple nodes (up to 10 units?) with IO connected through profinet. Ideally each node should be identical however with time I see situations were different setups/configurations will be used. Codesys PLC (GVLs) |Profinet | |--PNIO-node-1--| | | AIO, | | DIO, | | CNT etc. | |--PNIO-node-2--| | | AIO, | | DIO, | | CNT etc. Ideally I think of a configuration through yaml/xml-files (the assignment/linking of the profinet nodes towards GVL-variables in the PLC as well as scaling, channel configration etc.). Would be grateful if someone could suggest library/-ies that can handle the following: - Verify what IO is connected to a device/node. - Hot-swap/assign link for IO towards GVLs, either automatically or through a HMI.
Last updated: 2024-10-11
Post by snhatton on OPC UA: How to change NodeId ?!
CODESYS Forge
talk
(Post)
You can change the node id by adding the following to /etc/CODESYSControl.cfg: [CmpOPCUAProviderIecVarAccess] CustomNodeName=MyPLC123 Then restart the runtime and the new Node name will appear with the connection. I don't know if it's possible to remove the |var| from the name. I hope this helps!
Last updated: 2023-12-11
Post by davidredondo on Send file from codesys to...... ftp, cloud, etc
CODESYS Forge
talk
(Post)
Hi all, I am also looking for a solution to transfer a csv file from ifm HMI-PLC to some cloud and finally to node-red, for example. Do any of you advise me how to do it? Thanks
Last updated: 2023-11-08
Post by eschwellinger on OPCUA Ctrl-Node fehlt
CODESYS Forge
talk
(Post)
..dann mal im WBM alles deaktivieren, da der OPC UA Server ja direkt im PFC200 SL RUntime integriert ist und nicht über die WBM Oberfläche zu konfigurieren ist.
Last updated: 2023-12-05
Post by jst69 on Python script: Launch Codesys, Execute Script, Exit Codesys
CODESYS Forge
talk
(Post)
Dear all: Question about scripting: I am creating a .NET program that is supposed to Open codesys, open template project, export a bunch of pou, then exit codesys. Launch works, Open project works, Export works, But how do i tell codesys to close itself? I can tell windows to terminate codesys, but i would prefer to do it properly. from __future__ import print_function import sys import System proj = projects.primary # We're interested in POU nodes: POUGuid = Guid("6f9dac99-8de1-4efc-8465-68ac443b7d08") # We collect all POU nodes in that list. pous = [] # From the parent node on, we recursively add POU nodes: def CollectPous(node): if node.type == POUGuid: pous.append(node) else: for child in node.get_children(): CollectPous(child) # Now we collect all the leaf nodes. for node in proj.get_children(): CollectPous(node) # We print everything just to know what's going on. for i in pous: print("found: ", i.type, i.guid, i.get_name()) # And now we export the files. for candidate in pous: # We create a list of objects to export: # The object itsself objects = [candidate] # And sub-objects (POUs can have actions, properties, ...) objects.extend(candidate.get_children()) # And the parent folders. parent = candidate.parent while ((not parent.is_root) and parent.is_folder): objects.append(parent) parent = parent.parent # Create an unique file name: if len(sys.argv) == 1: filename = "parent\\%s.export" % (candidate.get_name()) else: filename = "%s\\%s.export" % (sys.argv[1],candidate.get_name()) # print some user information print("exporting ", len(objects), " objects to: ", filename) # and actually export the project. proj.export_xml(objects, filename) proj.close() print ("script finished.") System.exit(0) // Dont work .NET: public static void Export(string path,string proj) { if (checkSettings()) { var p = new System.Diagnostics.Process(); p.StartInfo.FileName = Properties.Settings.Default.CSVersion +"\\CODESYS\\Common\\CODESYS.exe"; p.StartInfo.Arguments = " --Profile=" + qoute(Properties.Settings.Default.CSProfile) + " --culture=en" + " --project=" + qoute(path + "\\" + proj) + " --runscript=" + Properties.Settings.Default.LastOpenProjectPath + "\\INPUT_DATA\\SCRIPT\\Export.py" + " --scriptargs:" + qoute(path) ; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = false; p.Start(); p.StandardOutput.ReadToEnd(); p.CloseMainWindow(); p.Close(); } }
Last updated: 2024-01-16
Post by nano on Modbus TCP/IP slave communication errow
CODESYS Forge
talk
(Post)
please tell us the exact error message from diagnostic. U can view it at devicetree in the node-element diagnostic from modbus-configuration. u also can activate the function auto-reconnect in master and increase a little bit the timeout and the repetition to male thw communication a little bit more robust
Last updated: 2024-02-04
Post by koehler on Codesys 3.5.12 Module not Found
CODESYS Forge
talk
(Post)
Hi there, I am getting troubles with a project. In the Hardware configuration I got some Lenze drives 9400. One of them got as status " Module not Found". Connection are good. ID Node of the Canopen network is also good. I don't find any reason for this status, nor any options to check.
Last updated: 2024-04-17
Post by user0815 on Web Socket Client SL -Bibliothek Fehler
CODESYS Forge
talk
(Post)
Hallo zusammen, ich hoffe ihr könnt mir weiterhelfen. Meine Codesys Version ist die V3.5 SP19 Patch 4 und die Zielsystemversion ist die 4.10.0.0 . Ich verwende Codesys ohne Lizenz. Ich probiere eine Verbindung über Web Sockets zwischen Node-RED und Codesys aufzubauen. Dabei kommt folgende Fehlermeldung und folgender Logeintrag. Ansonsten stehen keine Fehlermeldungen im Log. Ich weiß nicht wieso sich die demo mode Zeit nicht zurücksetzt beim neu starten der RUN-Time. Schöne grüße
Last updated: 2023-12-19
Post by yofi on Configuring an Encoder
CODESYS Forge
talk
(Post)
I have a raspberry pi trying to add encoder to it using that free encoder node. I simply dont understand where the encoder channel A/B suppoded to be mapped when i got to I/O mapping on encoder I get nothing to where to set the channels for the encoder or is there any blocks from a library or how is it that you use an encoder with Codesys it doesn't seem clear at all
Last updated: 2024-05-25
Post by user0815 on Kommunikation zwischen ROS2 und CODESYS über Web Sockets
CODESYS Forge
talk
(Post)
Hallo zusammen, ich hoffe ihr könnt mir weiterhelfen. Meine CODESYS Version ist die V3.5 SP19 Patch 4 und die Zielsystemversion ist die 4.10.0.0 . Ich verwende CODESYS ohne Lizenz. Ich probiere eine Verbindung über Web Sockets zwischen ROS und CODESYS aufzubauen. Der Client von CODESYS verbindet sich mit dem Ros Bridge Server aber ich weiß nicht wie ich dem Ros Server sage welches Topic er publishen soll. Über Node-Red habe ich eine Verbindung aufbauen können. Dafür habe ich "node-red-contrib-flowake-ros-nodes" verwendet. Den Daten Austausch habe ich mit mit Wireshark angeschaut und nun probiere ich den mithilfe von CODESYS nachzubauen. NAch dem sich der Client verbunden hat muss folgende Nachricht übermittelt werden:"{"op":"call_service","id":"call_service:/rosapi/topic_type:1","type":"rosapi/TopicType","args":{"topic":"/cmd_vel"}}." Ich vermute es funktioniert über Frames aber ich weiß nicht wie ich es umsetzten soll. Besten Dank für die Hilfe und schöne Grüße
Last updated: 2024-01-03
Post by dogulas on OPC UA C# client connecting to OPC UA CODESYS server
CODESYS Forge
talk
(Post)
Noob alert! I’m just getting my feet wet with CODESYS. I have a “Hello World” project in the CODESYS IDE. I’m using the Win SoftPLC on the same computer. I’ve added a Communication Manager under the Application node. Under that is “OPC UA Server -> IEC Symbol Publishing 01”. I also added “OPC_UA_Symbols -> Information Model”. I’m not sure I need the second thing. I was grasping at straws. I also set up several dummy symbols in the IEC Symbol Publishing 01 node. In my C# application, I am trying to get an instance of EndpointDescription from CoreClientUtils.SelectEndpoint(“opc.tcp://localhost:1217/Gateway-1”, useSecurity: false, 15000). I wasn’t sure about the “Gateway-1”. I found that in the CODESYS IDE under the project -> Communication Settings. When I execute the previous method call in C#, I get: “BadSecureChannelClosed”. I have no idea what that means. Any pointers to documentation are welcome.
Last updated: 2024-08-16
Post by esave on OPC UA Server with on Codesys + OPC UA Client on Labview
CODESYS Forge
talk
(Post)
Hello everyone I want a communication between my PLC as an OPC UA Server and Labview on my PC as the OPC UA Client. I have an Festo CPX-E-CEC-C1-PN PLC and I have the OPC UA Toolkit from Labview. I created some Variables for testing (see picture 1) on Codesys. I tried to use this Labview block diagram (see picture 2) but I cant connect the PLC to it. What do I have to type in the Server Endpoint URL and what in the Node ID? Is this a good way for communication with a PLC to a PC? If not is there another way?
Last updated: 2024-04-12
Post by ricola on Change default node Id name on Raspberry Pi
CODESYS Forge
talk
(Post)
EDIT : https://forge.codesys.com/forge/talk/Engineering/thread/cb5a492aa0/ hyplcmotion - 2022-12-16 Found out how! Needed to connect to PFC200 via Putty, and open CodesysControl.cfg with “sudo nano /etc/CODESYSControl.cfg”. Then adding following command to the end of file, and use the name you want, save/close CODESYSControl.cfg, and reboot your PLC. [CmpOPCUAProviderIecVarAccess] CustomNodeName= PFC200 Hi! , I'm digging up this issue cause we have still this long name within current versions on CodesysControl. Is it a lock for "demo" licences or can it be changed in some way ? This DeviceSet name is too way long with spaces inside, not easy to handle with string parsing... Cheers !
Last updated: 2024-10-10
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 yannickasselin on MQTT QoS 1 & 2
CODESYS Forge
talk
(Post)
Hello, I am using Codesys sp20p3 and IIoT library 1.11. I am trying to test QoS 1 & 2 and I have some issues. I am using mosquitto as the broker. I am also using some other MQTT clients like Node-Red and TwinCAT. They all work as expected for every QoS levels. I only have issues with Codesys MQTT client. In the Codesys client, if I subscribe to a topic as QoS 1 or 2, and a client publishes to this topic, I receive the message. But if I disconnect the Codesys client from the network and a client publishes to the subscribed topic, when I reconnect Codesys client to the network, I don't receive the messages as expected. Also there does not seem to be an auto-reconnect feature. So I have to manually set the mqttClient.xEnable bit to FALSE then back to TRUE in order to reconnect to the broker, then I also have to set the subscribe.xEnable to FALSE and back to TRUE in order to re-subscribe to the topic, but even then, I don't receive the messages that were published while I was disconnected. What am I doing wrong? I set the cleanSession bit to FALSE and I give my client a clientID. With the TwinCAT MQTT Client, I do the same thing and everything works as expected. It even auto-reconnects to the broker. I would expect Codesys MQTT Client to be as reliable as TwinCAT. Maybe I am doing something wrong? I also noticed that when trying to publish a QoS 1 or 2 message while disconnected from the broker, it does not work. In TwinCAT, I am still able to publish. The messages are stored in the client and published once reconnected to the broker. I would expect to be able to do the same thing in Codesys. Is this all possible? Am I doing something wrong? Thank you
Last updated: 2024-10-26
Post by yannickasselin on MQTT QoS 1 & 2
CODESYS Forge
talk
(Post)
Hello, After some more tests, here is what I found out. It seems we have to increase the uiKeepAlive and tPingInterval parameters. If I increase the uiKeepAlive value to 60s and the tPingInterval to 30s, then if I disconnect the ethernet cable from Codesys and publish some messages to which Codesys subscribes to and then reconnect within 30s, I will get the messages. If I don't reconnect the cable within 30s (ping interval), the client goes in error with "ACKNOWLEDGE_TIMEOUT". When this happens, it will not automatically reconnect after reconnecting the cable. I have to disable and re-enable the client but I will not get the published messages. I need to do more tests because there are a lot of weird things happening when playing with the ping interval and the keep alive. It is not clear to me what does what. I even ended up not receiving messages anymore, even if I disabled and re-enabled the mqtt client. The client did not give any error. The only way I was able to get messages again was by modifying my client ID. After that, if I try to re-use one of the old client IDs, nothing works (publish, subscribe) and I get a TCP_INIT_ERROR and sometimes a TCP_READ_ERROR. I need more explanation/documentation about these weird behaviors. Maybe it is the way I use it, maybe it is related to the broker (I am using Mosquitto with default parameters). When using a Node-Red client, everything works perfectly. I am trying to achieve the same behavior with Codesys but it seems impossible so far.
Last updated: 2024-10-30
Post by mubeta on Some 'pathetic' errors in SoftMotion program
CODESYS Forge
talk
(Post)
Hello everyone, I have a very simple program for the process, but it's driving me crazy and I can't see the problems I'm left with: Short topological description: Dual Core Berghof controller with softmotion runtime version 3.5.19.30; Two axes with servodrive on canopen bus, clocked distributed from master; Ethercat I/O node; 2 ms ethercat task, 2 ms canopen bus cycle time; I/O objects of the canopen master and canopen drives connected to the ethercat task cycle; Problem 1: Two separate programs each manage their own axis and drive, with separate state machines. A first axis moves primarily in velocity, except having to position itself absolutely at a predetermined point at the end of the job; the second axis, on the other hand, is a paper unwinder that changes, for each job cycle, from actions in absolute, relative, and cam displacement with the master axis. Well, the state machine of both axes was written in such a way as to call running the useful FB and change it on state change in this way: CASE i_stateMachine OF 0: o_Power(Enable := TRUE, bRegulatorOn := FALSE, bDriveStart := FALSE, Axis := o_PaperUnwinderAxis); o_MoveAbs(Execute := FALSE, Axis := o_PaperUnwinderAxis); o_MoveRel(Execute := FALSE, Axis := o_PaperUnwinderAxis); o_CamSelect(Execute := FALSE, Master := o_MachineAxis, Slave := o_PaperUnwinderAxis, CamTable := cam_PaperUnwinder); o_CamIn(Execute := FALSE, Master := MachineEncoder, Slave := o_PaperUnwinderAxis); o_CamOut(Execute := FALSE, Slave := o_PaperUnwinderAxis); o_SetPosition(Execute := FALSE, Axis := o_PaperUnwinderAxis); IF ... THEN i_StateMachine := 10; END_IF; 10: o_Power( Enable := TRUE, bRegulatorOn := TRUE, bDriveStart := TRUE, Axis := o_PaperUnwinderAxis ); IF o_Power.Status THEN i_StateMachine := 20; END_IF; 20: (* Avanzamento carta *) o_MoveAbs( Execute := TRUE, Position := o_Somewhere, Velocity := 25.0, Acceleration := 3666.7, Deceleration := 3666.7, Jerk := 48000.0, Direction := MC_DIRECTION.positive, Axis := o_PaperUnwinderAxis ); IF o_MoveAbs.Done THEN o_MoveAbs(Execute := FALSE, Axis := o_PaperUnwinderAxis); i_StateMachine := 30; END_IF 30: d_HomingPosition := ...; o_SetPosition( Execute := TRUE, Position := d_HomingPosition, Mode := FALSE, Axis := o_PaperUnwinderAxis ); (* ... *) IF o_SetPosition.Done = TRUE THEN o_SetPosition(Execute := FALSE, Axis := o_PaperUnwinderAxis ); o_LogServer.Append(sMessage := '...', lscClass := LOGSERVER_CLASS.ALWAYS, sdt := o_CommonsMgrData.systime.sdtLocal); i_StateMachine := 40; END_IF; 50: ... The code above is a sketchy example of what I wanted to write. But it gives me a spot problem: in some, the state change results in a drive error, which is unrecoverable except with a reinitialization via SM3_ReinitDrive(). Things are improved a little if in the program I always run the call of all softmotion blocks in this way: o_Power(Axis := o_PaperUnwinderAxis); o_Jog(Axis := o_PaperUnwinderAxis); o_Halt(Axis := o_PaperUnwinderAxis); o_MoveAbs(Axis := o_PaperUnwinderAxis); o_MoveRel(Axis := o_PaperUnwinderAxis); o_CamIn(Master := MachineEncoder, Slave := o_PaperUnwinderAxis); o_CamOut(Slave := o_PaperUnwinderAxis); If I don't execute all the calls of all the motion FBs used, when exchanging machine state often (but not always), the axis goes into error with event id THE_FB_WASNT_CALL... Done a little diagnostics it seems that the FBs return the bDone, before they are completely terminated. I tried doing the machine state exchange not with the bDone bit of the FBs, but with the 'standstill' state of the axis. It didn't seem to change anything. Problem 2: During the use SM3_ReinitDrive() I get the erro in the log: "NetID 0: SDO read error for object 16#607C..." Assuming that the device involved it's one of the two servodrive, (no others device are present in the network), I don't found any object 0x607C in the 'possible object list in/out' of the two drive, and I don't understand where this object can be listed. So any ideas and suggestions regarding these two issues will be very, very welcome. If you need the source project, I am willing to send it.
Last updated: 2024-07-17
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
.