You can generate a boot application ("Online" -> "Create boot application" when NOT logged in into the PLC). But debugging is supported only through Codesys.
You can also build the slider yourself if your display tells you touchscreen coordinates and you do not plan to support mouse. It's a bar (= rounded rectangle), a line and some math on touch coordinates.
Hi Syoma, adapter support on Linux is related to SocketCAN support in kernel, so Peak will definitely work. I read online that the Ixxat proprietary SocketCAN driver has some problems, so I'd stay away from that. Codesys support of CAN layer 2 is a bit hairy, you can refer to the library documentation here: https://help.codesys.com/webapp/hGcF55fadXXw7LxTlfIUoErJcVQ%2Ffld-CAN-Low-Level;product=CAA%20Can%20Low%20Level%20Extern;version=3.5.17.0 whereas for CANopen you can just drop a CANbus device...
Here you are: https://help.codesys.com/webapp/JMeheH6MvY4aZSJh5TgzrbLOrZE%2FPackBytesToDword;product=CAA%20Memory;version=3.5.17.0 It is just the Codesys WebHelp, you could have searched for PackBytesToDword.
Is there anyone who can make an educated guess on the error?
Hello, is there any restriction on DataSources for Codesys Runtime embedded (specifically running on a control unit with CAN communication)? Selecting "Codesys application V3" as DataSource type, then filling the required data in, then clicking "Next" in the wizard, results in a "The key was not found in the dictionary" error (see the attached picture). Clicking "Finish" results in the DataSource added, but then clicking on "Update variables" results in a "No browse information" error. It does not...
IIRC I read in this forum that the open ComboBox is implemented as a dialog and raises OnDialogClosed, and OnDialogClosed is raised for every dialog that is closed in the current visualization. But I cannot find the post...
Do you have something attached to OnDialogClosed for the time fields?
TCP ports are 11740 through 11743 (all four), UDP ports are 1740 through 1743. https://help.codesys.com/webapp/_cds_cmd_login;product=codesys;version=3.5.16.0
I thik you activated "Use CurrentVisu variable" in Visualization Manager. This synchronizes all the visualizations.
Do you know why DTClogger seems not to work if passed a custom logger with these options? DM1_logOptions : CmpLog.LogOptions := (szName := 'J1939_DM1', bEnable := 1, uiType := CmpLog.LogTypes.LT_NORMAL OR CmpLog.LogTypes.LT_TIMESTAMP_RTC OR CmpLog.LogTypes.LT_NO_DISABLE OR CmpLog.LogTypes.LT_DUMP_ALWAYS, // LT_DUMP_ASYNC as in LT_STD results in the same uiFilter := CmpLog.LogClass.LOG_INFO OR CmpLog.LogClass.LOG_WARNING OR CmpLog.LogClass.LOG_ERROR OR CmpLog.LogClass.LOG_EXCEPTION, iMaxEntries :=...
That's possible, but it involves some ugly hardware-dependent trickery. Can you share the platform the Codesys runtime is running on? Both OS and processor.
Then Codesys is using localtime and Windows is expecting UTC whereas it gets localtime.
Codesys is probably using UTC timestamp, whereas you are probably in UTC+2 (CEST?) timezone, and Windows adjusts timestamps to the local time.
You can use TextListUtils library functions: https://help.codesys.com/webapp/zMPpTI1nAvRGy8loA2Ct-mmN6GE%2Ffld-TextListUtils;product=TextListUtils;version=3.5.17.0 For getting the default one, you can use CmpDynamicText library (not documented online, but easy to figure out).
You can see in the CFC part that aslSchedule is 0, so the function block did not receive "mySchedule" position in memory. Maybe the culprit is a stale connection (shown connected but actually not), try to delete and reconnect it.
Ooook, did not try but just looked the docs. From the error it seems that aslSchedule is VAR_IN_OUT, so just put the array without ADR and [1].
It is a pointer to the first element of an array. Declare an array in your code, like mySchedule : ARRAY [1..32] OF Schedule := [(usiSwitch := 1, todFirstOn := ..., todLastOn := ..., byDayFlags := 2#0010_1001), ...]; and then assign ADR(mySchedule[1]) to aslSchedule. A tip: instead of posting screenshots of online help, post the link.
Sorry, they're terms borrowed from C++, that has a very complex template system (in fact, it is a programming language itself embedded in another programming language). It can perform any computation (an extremely crude definition of Turing completeness) at compile time (bounded only by compiler limitations), and support recursion (defining something in term of {an usually smaller version of} itself). Anyway these are things that a PLC does not need to have in my opinion. But being able to write...
Sorry, they're terms borrowed from C++, that has a very complex template system (in fact, it is a programming language itself embedded in another programming language). It can perform any computation (an extremely crude definition of Turing completeness) at compile time (bounded only by compiler limitations), and support recursion (defining something in term of {an usually smaller version of} itself). Anyway these are things that a PLC does not need to have in my opinion. But being able to write...
Has anyone ever wanted a basic template support in Codesys? I mean, no recursive definitions, no compile time Turing completeness, just symbolic datatype declarations and POU generation. I often find myself copypasting some POUs only to change datatypes, especially with array-based stuff and constrained memory/performances.
Obligatory XKCD: https://xkcd.com/1172/
Perhaps it's a stupid answer, but have you tried setting the property "Text format" to "Line break"? https://help.codesys.com/webapp/_visu_elem_rectangle;product=core_visualization;version=3.5.15.0#element-property-text-properties
Yes, because it is Codesys application that controls GatE enabling. The same might happen if you connect to the Codesys Gateway directly via Wifi (even not via GatE, just using AP functionality), since AP functionality is controlled by Codesys application too. I never had enough time to play with WiFi of 6200, hence the "might"... As long you have something "i_Enable"d from Codesys, this would cease to work when you stop the application, and that's not going to change. There are some workarounds,...
Hi Cole, are you downloading through GatE? Because when Codesys application is stopped, also GatE connection is, and so you cut yourself out.
https://help.codesys.com/webapp/_cds_cmd_view_whitespace;product=codesys;version=3.5.17.0
The way checksum is calculated is written in the J1939-71 standard. Deutz, Volvo, John Deere, ..., all use the same checksum calculation for TSC1 message. Also mind, the checksum is moved to the high nibble via a SHL (the code of @pmacmahon, which is correct), not to the low nibble via a SHR. The counter valid values are 0 to 7 and 15 (last one meaning "Not Available") as per the J1939-71 standard.
You should recheck your coefficients, because 2^16 is not 4096 and 2^24 is not 65536. Or just use the PackBytesToDWord function which is more explicative in source code.
You should recheck your coefficients. Or just use the PackBytesToDWord function which is more explicative in source code.
Use CAA Memory PackBytesToDword function: https://help.codesys.com/webapp/s6roH8o4mLnj5nlRX9QvTFobNAo%2FPackBytesToDword;product=CAA_Memory;version=3.5.12.0 optionally followed by a DWORD_TO_DINT cast if you have a signed value in two's complement. Also, INT is two bytes. You want DINT (4 bytes).
No, it is not deleted. But why do you require a struct that has a pointer to struct? Couldn't you just embed stSub in stMain as a member?
Your code tries to SDO read an object from the local node (DEVICE = 0), but you have not created a CANopen local device. In any case, you seem not to have clear the distinction between CAN (the bus) and CANopen (one of the various application protocol built on top of CAN). In particular, your message is illegal to use in a CANopen network: the only message that can have ID 1 is the Global Failsafe Command (GFC) that has DLC 0 (thus no payload), that has a very special meaning. It is however totally...
I cannot help you about EIP because I never used it (just know something about it). Simulation mode works inside the IDE, and it executes 61131 code and visualizations (with some differences to the real TargetVisu). No communication with the external world. The other is the real Windows SoftPLC, which needs a license to work, full featured. But if you are developing for a PLC that's not x86-based (ARM, POWER, Aurix, ...) like I usually do, if you want to test your logic locally the two ways are 1)...
IoDrvEtherCAT library.
1) It depends on the throughput you need to have, but I think they should work fine. 2) It is so at least from Codesys 3.5.10 3) I cannot help you ;-) 4) AFAIK fieldbuses do not work in simulation mode, so you are out of luck. But you can start the runtime on your PC (Codesys Control Win V3) and use your PC as test device, it works for 30 minutes; after that time you can close and reopen it to make it working again.
It seems strange. It keeps the length it had at the opening zoom level, but mine start to work just after resizing. Maybe your monitor is still too large? It will wrap only if does not fit horizontally.
Same window, in the LD tab there is the "Networks with line breaks" option, which makes Codesys wrap rungs. It is a bit ugly, though.
If you use absolute movement and place the objects at 0,0 you can achieve the same effect. But this not solves your problem of "accidentally moving" some elements.
https://help.codesys.com/webapp/_cds_operands_variables_accessing_bits;product=codesys;version=3.5.15.0 The index must be a constant.
Search for the "CAN gateway for 3.5 units" in the Start Menu. Instructions in the Epec Programming & Libraries Manual under "Getting Started" -> "Going Online and Downloading Application" -> "Codesys 3.5" (via CAN for EC44, SC52, SL84 and via Ethernet for 5050, 6200, XS6C). If you use the web version of the manual, the green lines toggle visibility of their section when clicked. Or you can just write me officially ;-)
Search for the "CAN gateway for 3.5 units" in the Start Menu. Instructions in the Epec Programming & Libraries Manual under "Getting Started" -> "Going Online and Downloading Application" -> "Codesys 3.5" (via CAN for EC44, SC52, SL84 and via Ethernet for 5050, 6200, XS6C). If you use the web version of the manual, the green lines toggle visibility of their section when clicked.
You need to use the method Initialize passing the pointer to the WSTRING and the proper __SYSTEM.TYPE_CLASS, i.e __SYSTEM.TYPE_CLASS.TYPE_WSTRING.
Both on 32bit and 64bit, and I have 32 GB of RAM and a Core i7-10875H. Two instances eat up about 10% CPU each, three go to 15% - 20% each while sitting in the background, whereas one instance eats only 1-2% of CPU usually. The graphical editors are slowed down too.
Hi all, has anyone noticed a spike in CPU usage (and slow autocompletion) whenever two instances of Codesys are open at the same time?
I am using some control units based on SPC57xx, and they works great.
Have you looked into diagnosis API for J1939? https://help.codesys.com/webapp/8LVZD-HU9xCDZg4RnKWx5CheJCc%2Ffld-Diagnosis;product=IoDrvJ1939;version=3.5.16.0 There are ready made function blocks Read_DM1 and Read_DM2. Anyway it is not that difficult to use it.
If you select a local directory in the left pane, select the file you want to transfer in the right pane, and push the "<<" button that is mid-height between panes, what happens?
You can use the scripting engine: https://help.codesys.com/webapp/idx-scriptingengine;product=ScriptEngine;version=3.5.16.0 IecLanguageObjectContainer enable creation of POU, DUT, GVL, interfaces and so on. You can add devices, but IIRC you cannot change their mappings (however you can import automatically a CSV). Or you can go the XML (PLCopen or native) route.
Hello Marcel, the interface has DialogOpened and ActionDone method only (deducted from autocompletion)? Asking because, as you can see from the images, the interface is hidden (and the tooltip on DialogOpened suggesting to read IDialogOpenedListener documentation for further information sounds like a joke...)
Hello Marcel, the interface has DialogOpened and ActionDone method only (deducted from autocompletion)? Asking because, as you can see from the images, the interface is hidden.
Hi all, in Visu Utils there is a FbOpenDialogExtended which has a parameter itfDialogOpenedListener of type IDialogOpenedListener, however that is not exposed anywhere and thus not implementable. Anyone knows why? Codesys 3.5.14.0 with target Codesys 3.5.14.7.
Hi all, anyone knows why SFC PRGs in Codesys Safety SIL2 (non-safe section) could generate the Struct initialization is not allowed for non safe datatypes: <PRG name>__<random number>__GVL__INIT initializes <first step name> error? This happens when running the application on the controller, not when compiling, and the step ("Init") is empty (no action, no code, just a placeholder). Codesys Safety SIL2 3.5.10.0.
Hi all, anyone knows why SFC PRGs in Codesys Safety SIL2 (non-safe section) could generate the "Struct initialization is not allowed for non safe datatypes: <prg name="">__<random number="">__GVL__INIT initializes <first step="" name="">"? This happens when running the application on the controller, not when compiling.</first></random></prg>
Hi Edwin, IDE 3.5.14.0 with target 3.5.14.7 and yes, it is enabled (otherwise the "IEC objects" change to their non-diagnostic counterparts).
Hi all, I have a problem using device diagnostics (see the attached images): the compiler tells me that the device are not of the diagnostic variant even if the IEC object in the device pane claims it is equipped with diagnostic interfaces.
It is an opt-in: https://help.codesys.com/webapp/_cds_using_pous_for_implicit_check;product=codesys;version=3.5.14.0
Sorry, it was "Source Address", not "Destination Address", my bad. You set it in "Preferred address" in "General" tab.
18 = priority 6 FF48 = PGN 65352 A4 = destination address 164
Well, you need to build the ParameterGroup only once, so you can just call it the first cycle with xExecute = FALSE and from the second one with xExecute = TRUE, and connect ReceiveWatchdog.xEnable to ReceiveParameterGroup.xDone (if you want to be sure, interpose a latch between them).
You would better use the PDO offset tecnique: add a fixed offset to the node-ID such as 32 and so PDO will become 180+NID, 280+NID, 380+NID, 480+NID, 1A0+NID, 2A0+NID, 3A0+NID, 4A0+NID, 1C0+NID, 2C0+NID, 3C0+NID, 4C0+NID, 1E0+NID, 2E0+NID, 3E0+NID, 4E0+NID, for a total of 16 TPDOs (RPDOs follows the same scheme: x00, x20, x40, x60). Beckhoff uses this other mapping: https://infosys.beckhoff.com/english.php?content=../content/1033/el6751/2519238027.html&id= And compared to MPDOs saves a lot of bandwidth....
ReceiveParameterGroup is for "building" the needed data structure. You should pipe itfParameterGroup into ReceiveWatchdog: https://help.codesys.com/webapp/8LVZD-HU9xCDZg4RnKWx5CheJCc%2FReceiveWatchdog;product=IoDrvJ1939;version=3.5.14.0
Thank you!
Thanks. I am on 3.5.14, so I cannot see definition of VisuElems.Visu_DialogResult (I noticed that it is '6' for Yes and '7' for no, STRING since the formatter is %s, right?). Is it defined in an enumeration? Also, I still wonder why not the implementers just use a VAR_IN_OUT variable instead of requiring this hairy workaround. I am puzzled, I am sure there IS a reason, but I cannot understand what it is.
Hi all, anyone knows how to get the Yes/No or Ok/Cancel answer from the VisuDialogs.MessageBox? Digging into the library, the related visualization has only input, no output or in_out, so it must have another way to communicate which button was pressed (if not, what's the point to have two buttons in the first place?), but I was not able to find it. It should be opened by pressing on a (visualized) button. Or am I forced to make a custom dialog from scratch to return the pressed button?
Has anyone interfaced DM1 with Codesys Alarm Management? For "known"/handled DTC (i.e. most common ones) a separate path is viable, but for obscure/very infrequent ones just showing an alarm with SPN and FMI is fine for my application. However, I cannot directly use DM1_Read DTC list because in case there are two active DTC, and the first goes inactive, the second takes the first place in the array and so screws the alarm handling.
If you add data through the I/O area, the PDOs in your project result locked, whereas if you manually add indices into the Object Dictionary and then proceed to mapping onto your GVL, then they are editable. Though I do not know why. P.S.: the .project file is enough ;-)
Could you post your project?
If I understand correctly, you are locked up now. I'd bet you did the following: 1) Created a CANopen local (slave) device in your Codesys project. 2) Did the mapping. 3) Exported its EDS. 4) Installed the EDS as a device into the Codesys device repository. 5) Added a CANopen Manager (master) in the tree. 6) Added the just installed device underneath the CANopen Manager. 7) Maybe deleted the local device (wrong thing) Just redo points 2, 3, 4, and 6 and you will be fine.
Well, you have imported an EDS to have PDO mappings locked.
Since it was created by Codesys a couple of hours ago: CreatedBy=CODESYS V3.X, DeviceEditorCANbusDevice.plugin, V3.5.14.0 ModificationTime=08:30PM ModificationDate=05-22-2020 ModifiedBy=CODESYS V3.X, DeviceEditorCANbusDevice.plugin, V3.5.14.0 I assume that you can change the PDOs in the CANopen slave editor and then reexport and reimport the EDS.
Subindices of indices 1600h - 1603h, that store RPDOs mappings (and for what is worth their cousins 1A00 - 1A01 for TPDOs), all have AccessType const. The EDS says "you can change the IDs (140x and 180x), but not the mappings", and Codesys respects that.
Yes, in fact I talk about a projection of the various faults to the fieldbus. If you have e.g. a CANopen network you can also project the fault bits onto 1003h array in object dictionary and send one or more EMCY message(s) in an independent program (better than mapping faults onto two, three or more fieldbuses in the same program). I talked about DM1 because the OP talked about reporting errors via J1939, but the approach is fieldbus independent.
I'd not use a global error variable. Each fault should have its fault bit with its own resetting/acknowledging logic. Since you mention J1939, have you thought of implementing a DM1/DM2-like system? With a program (not a FB) executed after the logic, you "project" the fault bits (that could be global or local) into a DM1 list and then send it as per J1939 customary.
It misses Topcon and STW devices, for example.
It misses Topcon devices, for example.
https://devices.codesys.com/device-directory.html?no_cache=1
Please, can you fix the guide? It is not so clear that FB must be invoked manually after setting data (one would expect that is called implicitly by Codesys during the task).
CANL2 = CAN Layer 2 = messages over CAN without attached interpretation of IDs and content. https://www.kvaser.com/can-protocol-tutorial/ for example.
CANL2 is just raw CAN, without an application protocol on top like CANopen, DeviceNet or J1939 (a.k.a. NMEA2000 for most parts). Your reasoning is absolutely sound, but I advise you first to study available options and understand the principles behind their architecture and then choose. Experimenting is a beautiful thing, as long you understand what you are doing. You typically use CANopen to make a network, so that devices interoperate in a specific way. CANopen provides solutions to a variety of...
...if it is the only CANopen device, why would you even set up that as CANopen slave? There are plenty of valid reasons, but what are yours? You can just use CANL2ConfigX children (see target documentation for that), if you do not need a slave.
You are probably using asynchronous mode (254 or 255), usually they are "on event", where event is usually logical OR between "on any mapped variable change" and "on Event Timer event" and "manual triggering" (typically for 254). "Inhibit time" means "do not send me more than 1 message over an Inhibit Time interval". I do not think that Codesys stack support manual triggering. You could, in theory, set the same interval (beware of different units!) for both. For a more robust solution, you could...
Should be 0x701 with payload 00, not 10 and it is the CANopen bootup message. 0x0 - 01 00 is NMT start all (remember some post above?). Really, Wikipedia page (https://en.m.wikipedia.org/wiki/CANopen) is helpful here. The project you posted compiles with 0 warnings, 0 errors. If you need help you need also to post at least a snippet where those warnings occur. Your RPDO1 has 8 bytes, not 4.
You can refer to this page of the online help: https://help.codesys.com/webapp/_cds_device_tree_device_editor;product=codesys;version=3.5.14.0#device-tree-in-online-mode
It is not an acknowledge message, but a message acknowledge. https://www.kvaser.com/about-can/the-can-protocol/can-messages-13/ See the ACK slot in the message frame? The sender writes 1 (recessive bit), if any node has correctly received the message it writes 0 (dominant bit). If the sender reads 1, noone has received a valid message (could be corrupted), so it retransmits the message for a hundred times and then concludes there is an error (faulty controller, bus disconnected, ...)
As I said, you do not need it in most cases. I just tried it without and it works, just connect terminators and a probe to acknowledge messages (diagnostics about bus not running are due to noone acknowledging CANopen bootup message). CANL2ConfigX is needed if you want to exchange messages not related to a CAN fieldbus, but seldom is needed to force FlexCAN configuration.
Your code is fine. If you correctly terminate the bus the CANbus device diagnostic will go away, and sending the NMT start or calling CANopen_device.SwitchToOp() will start the CANopen slave.
Support email address is in the manuals (not writing there, not willing spam bots to have it easy). Have you got one PLC programmer in your team, or at least a good programmer? He/she should be able to assist you.
Usually people of Opus support team (in Geisenheim) are nice and answer very fast. Strange. Your distributor, on the other hand, does not seem professional. Tech support for products we distribute is my second job (my first is programming them) and I won't ever leave an email unanswered.
BSP (board support package) is the collection of files you can find under Customer Files\Device\OPUS_A3 in the file you downloaded from their site and that you should load on the display through the service procedure (Manuals\Software\OPUS_devices_update_manual_V1.10.pdf) The .chm I am referring to is Manuals\Software\TargetDataStorage_3.5.14.7.chm . If it seems empty, is because Windows by default blocks .chm viewing. Just right click on it, choose Properties and near OK/Cancel buttons check "Disable...
For standard CAN bus device (and CANopen configuration) there is Codesys help (good although not the best) and a bit more documentation (especially libraries) on https://help.codesys.com . For Topcon Codesys Target there is a .chm in the BSP that should be integrated into Codesys help (last node, Add-ons) when you install Target files, though it is an autogenerated reference manual. They have a collection of example projects that your distributor could give you, and also a training presentation....
See the "Driver" node, that in your project has a child node "Keyboard"? Right click on it and select "Add device", then add CANL2Config0 or CANL2Config1 as mentioned above and set up device parameters according to your network.
Is the bus wired correctly? Resistors, H/L not switched, and so on? Try to add a Driver/CANL2Config0 (for first CAN port) or CANL2Config1 (for second CAN port) and set CANbus parameters inside it.
The last I have is for 3.5.11, but it works straight for 3.5.14 if you update the main device to the last target. Nothing has changed on Topcon side. Can you show exactly which errors Codesys raises? [not the shortened version, and also the page on CANopen slave where the error occurs]
The last I have is for 3.5.11, but it works straight for 3.5.14. Nothing has changed on Topcon side. Can you show exactly which errors Codesys raises? [not the shortened version, and also the page on CANopen slave where the error occurs]
Hi, Topcon does not support 3.5.15 yet. They're releasing the .15 runtime in fall. For now you must use .14 IDE.
So you advise against using "Device Applications"? What is their purpose, then?
Is there anyone who knows?
I am trying to set up a FB for I/O Channel for interfacing with a CANopen I/O Slave (whose EDS I have already imported). After copying the example FB as-is from the help, I proceed as following: I select one of the outputs of type INT (since the example FB is for an INT output) I click su "Add FB for I/O channel" * I am greeted with an empty selection window My project uses device applications, maybe is this that causes the issue?