Post by bjarne-pagaard on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20)
CODESYS Forge
talk
(Post)
Hi, I would like to divide a project into multiple applications - as a minimum: one handling visualization and Alarm Manager, one handling I/O and plant control logic. But how to exchange variables between the applications? What have you done to get such a solution? In versions 3.5.19 and earlier, you can have Child applications, where the children can access a GVL in the Parent application. Children apps is no longer possible in 3.5.20 - but you can have 'sibling' apps - Several apps directly under PLC Logic, that is. But how do they best communicate? The Communication Manager / Data Sources Manager is sort of possible via OPC UA, but it seems like overkill and with some limitations - for example no ARRAY OF STRUCT possible this way. If you have separate devices in your project, you can exchange data via 'CODESYS ApplicationV3', but not other applications in the same device (see attachment Datasources.png). You can do it via 'Select the project type'->'Other Project' and select the same project file, but this leads to crashing the Development system when working with the variables afterwards. It would be great to hear your thoughts / experiences on this topic - Bjarne
Last updated: 2024-09-27
Post by bjarne-pagaard on Communication between applications on same device/controller/runtime (Win RTE 3.5.20.20)
CODESYS Forge
talk
(Post)
Thanks for this - I have now been looking in to just having an extra (non-RTE) runtime on the same machine, as you suggest. I will probably proceed this way. Even though it still seems very odd to me, that variable exchange to a different runtime is easier than between applications on the same controller. There will be some fun with the licensing, it seems. Does anyone know if it is possible to specify which license container/specific license the runtime is going to use at runtime. Let's say I have two available licenses with different resources available, for example one license allows multicore and multiple EtherCAT channels, but not many visu tags (for the RTE). Another with less resources but a lot of visu tags (for the Visu controller). Let's say the program in one of the controllers could be fully licensed by either of the two available licenses, but picks the 'largest' first. A bit later, the larger application starts, but is left with the smaller license.. How can I make sure that the 2 runtimes select the right license at startup?
Last updated: 2024-10-01
Post by z870623 on About CPU Loading
CODESYS Forge
talk
(Post)
I am running a runtime environment on an ARM A35 dual-core processor (1.5GHz) and have encountered some issues. The CPU load (both CPU0 and CPU1) occasionally spikes above 50% before returning to normal, and this happens around 2-3 times per minute. At the same time, I’ve noticed that the Max Cycle Time in the Codesys monitoring screen shows much worse performance compared to the A53 (1.2GHz), with nearly double the cycle time. The optimizations I have made so far are as follows: Set the CPU to performance mode. Isolated CPUs: CPU0 is dedicated to running Linux services and the runtime itself, while CPU1 runs the EtherCAT task and the MainTask. Despite CPU1 only running these two tasks, the utilization still increases above 50%, which I find unreasonable. Additionally, I performed tests using cyclictest both without and with the runtime running. The performance is shown in the following image: From the results, I believe the CPU performance should be fine, but I am unsure why the monitoring results are not as expected. The testing outcomes should ideally be as close as possible to the cyclictest results. Does anyone have related solutions to this issue?
Last updated: 2024-10-14
Post by s1ack on Request a dark mode for CODESYS
CODESYS Forge
talk
(Post)
and other colors have to be licensed? Introducing Code-Based Licensing Code Basic S: White text w/ grey background (ST only) Code Basic M: White text w/ dark gray background (ST Only) Code Basic L: White test w/ black background (ST Only) Code Standard S: 2 Colors of light syntax highlight colors w/ black background. (ST Only) Code Standard M: 4 Colors of light syntax highlight colors w/ black background. (ST only) Code Standard L: 6 Colors of light syntax highlight colors w/ black background. (ST only) Code Performance S: 2 Colors of light syntax highlight colors w/ user definable background. (Entire IDE) Code Performance M: 4 Colors of light syntax highlight colors w/ user definable background. (Entire IDE) Code Performance L: 6 Colors of light syntax highlight colors w/ user definable background. (Entire IDE) You get the gist... I used to be a big fan of CoDeSys. Recent re-entry after 5 years away, not so much.
Last updated: 4 days ago
Post by falif461 on ╭☞[] Temu Coupon Code $100 Off⤁ {"acq557317"} $100 Off for New and Existing users→_→
CODESYS Forge
talk
(Post)
Temu Coupon Code $100 Off Colombia ➥ {acq557317} & {acq557317} , TEMU Coupon Code "acq557317" | $100 OFF & 50% DISCOUNT, TEMU Coupon Code "acq557317" ,is an all in one opportunity, which also offers $100 Off & 50% Discount! The TEMU Coupon Code "acq557317" offers an impressive $100 discount and a 50% discount on purchases for both new and existing customers. This special offer is a fantastic opportunity to save significantly on your TEMU shopping experience. By using the Coupon Code "acq557317" in Colombia , you can unlock the $100 coupon bundle, which provides $120 worth of savings. This means that you can enjoy a $100 discount on your order, as well as access to exclusive deals and additional savings opportunities. ⇦ Exclusive Temu coupon Codes ,,,acq557317,,,,, ➤ Offers → Discounts, Student Deals & More ╰┈➤ Best Temu Coupon Codes Colombia ➤ "acq557317" ⇨ "acq557317" ➥ Up to 50% Off Retrieve ➲$100➲ TEMU Coupon Code ➥【acq557317】 or 【acq557317】⇒{Colombia } || AUG/SEP 2024 To redeem the TEMU $100 Coupon Code, simply follow these steps: Sign up for a TEMU account on their website or mobile app. Add items worth $100 or more to your shopping cart. During checkout, enter the Coupon Code "acq557317" in the designated field. The $100 discount will be automatically applied, and you can also enjoy an additional 50% off on your purchase. This Coupon Code is valid for both new and existing TEMU customers, making it a great opportunity for everyone to save on their shopping. The $100 coupon bundle can be combined with other available discounts, such as the 30% off code for fashion, home, and beauty categories, allowing you to maximize your savings. ➥ Temu Coupon Code $100 Off {acq557317} Colombia ➥ Temu Coupon Code 40 Off {acq557317} Colombia ➥ Temu Coupon Code 50 Off {acq557317} Colombia ➥ Temu Coupon Code 70 Off {acq557317} Colombia ➥ Temu Coupon Code 90 Off {acq557317} Colombia ➥ Temu Coupon Code 30 Off {acq557317} Colombia ➥ Temu Coupon Code First Order {acq557317} Colombia ➥ Temu Coupon Code Existing User {acq557317} Colombia ➥ Temu Coupon Code 90 Off {acq557317} or {acq557317} Colombia Temu Coupon Code Colombia $100 Off [acq557317] For New Users 2024 Temu has rapidly gained popularity as a go-to shopping destination, offering a vast array of trending products at unbeatable prices. To welcome new users, Temu is excited to offer the exclusive Temu coupon code $100 off [acq557317]. Alongside this, existing customers can enjoy significant savings with the acq557317coupon code. Why You Should Embrace Temu Coupon Codes Colombia Temu has revolutionized online shopping by providing an extensive range of products, from fashion and electronics to home goods and accessories. Coupled with fast delivery and free shipping to numerous countries, Temu has become a preferred choice for budget-conscious shoppers. Now, imagine enjoying these benefits with an additional $100 off your purchase! That's where our Temu coupon codes come in. <get $50="" off="" your="" first="" temu="" order!=""> Use Code {acq557317} Now! |Exclusive Offer: $50 Off Your First Temu Purchase with Code {acq557317}| <save big!="" $50="" off="" your="" first="" order="" on="" temu=""> with Code {acq557317} |Unlock $50 Savings on Temu> First Order Using {acq557317}| $50 Off Your Initial Temu Order Use Code {acq557317} Today! <get $50="" off="" temu’s="" first="" purchase=""> with Code {acq557317} |Don’t Miss Out: $50 Off Your First Temu Order| Use Code {acq557317} <$50 Discount on Your First Temu Purchase> Use {acq557317} |Amazing $50 Off on Your First Temu Order| with Code {acq557317} <start shopping="" with="" $50="" off="" on="" temu!=""> Use Code {acq557317} |First Order Special: $50 Off at Temu| Use {acq557317} 🥳 <save $50="" on="" your="" first="" temu="" purchase!=""> Apply Code {acq557317} 🥳 |Hot Deal: $50 Off Your First Order on Temu| Code {acq557317} <exclusive $50="" off="" on="" your="" first="" temu="" order!=""> Use Code {acq557317} |First-Time Shopper? Get $50 Off at Temu| Use Code {acq557317} <get $50="" off="" your="" first="" temu="" order!=""> Use Code {acq557317} Now! |Exclusive Offer: $50 Off Your First Temu Purchase with Code {acq557317}| </get></exclusive></save></start></get></save></get> Unveiling Top Temu Coupon Codes for August & September 2024 To maximize your savings, consider these exceptional Temu coupon codes: acq557317: $100 off for new users - A fantastic welcome offer. acq557317: $100 off for existing customers - A reward for loyalty. acq557317: $100 extra off - Boost your savings significantly. acq557317: Free gift for new users - A delightful surprise. acq557317: $100 coupon bundle - A comprehensive savings package. Navigating the Path to Temu Savings Redeeming your Temu coupon code is a straightforward process: Create a Temu account or log in to your existing one. Explore Temu's vast collection and add your desired items to your cart. Proceed to checkout and apply your coupon code at the designated box. Witness the magic unfold as your discount is instantly applied to your order total. Unlock Extraordinary Savings with Temu Coupon Code $100 Off [acq557317] The Temu coupon code $100 off [acq557317] is a fantastic opportunity for new users to experience the Temu shopping thrill with significant savings. Imagine purchasing your favourite items at a discounted price. This coupon empowers you to enjoy a wide range of products without breaking the bank. Unleash the Power of Temu Coupon Codes Flat $100 discount: Enjoy a substantial reduction on your entire order. $100 discount for new users: A generous welcome offer for first-time shoppers. $100 off for existing customers: A reward for your loyalty to Temu. $100 coupon for new customers: A fantastic incentive to try Temu. Temu $100 off for old users: A token of appreciation for your continued support. Elevate Your Temu Shopping Experience To optimize your savings journey on Temu, consider these expert tips: Leverage free shipping: Enjoy complimentary delivery on your orders. Explore diverse product categories: Uncover hidden gems and unexpected finds. Stay alert for daily deals and flash sales: Seize limited-time opportunities. Combine coupons with other discounts: Maximize your savings potential. Share your shopping experience: Leave reviews to help others and potentially earn rewards. Utilize social media: Follow Temu on platforms like Instagram and Facebook for exclusive deals and promotions. Join Temu's email list: Stay informed about the latest offers and product launches. Essential Temu Coupon Codes for Unmatched Savings To further enhance your shopping adventure, explore these indispensable Temu coupon codes: acq557317: Temu coupon $100 off for new users acq557317: Temu coupon code $100 off for existing customers acq557317: Temu coupon codes 100% acq557317: Temu coupon $100 off code acq557317: Temu coupon $100 off first-time user Temu Coupon Codes for August 2024: The Key to Massive Discounts This month, Temu offers several enticing Coupon codes tailored to both new and existing users, ensuring everyone can save. Here’s a quick look at the top Temu Coupon codes you can take advantage of this August: [acq557317]: Temu Coupon code $100 off for new users [acq557317]: Temu Coupon code 40% off for new customers [acq557317]: Temu Coupon code 40% extra off [acq557317]: Temu Coupon code for a free gift for new users [acq557317]: Temu $100 Coupon bundle for existing and new users These Temu Coupon codes offer a variety of benefits, from substantial discounts to free gifts and bundled savings. Whether you’re shopping for fashion, electronics, home goods, or more, these codes will ensure you get the best deal possible. Whether you're a seasoned Temu shopper or a new customer, these coupon codes offer an incredible opportunity to save on your purchases. Remember, the Temu coupon code $100 off [acq557317] is a limited-time offer. Don't miss out on this fantastic chance to enjoy significant savings! Embark on your Temu shopping spree today and experience the thrill of unbeatable prices. Temu Coupon Code France: (acq557317) or (acq557317) Temu Coupon Code Sweden : (acq557317) or (acq557317) Temu Coupon Code Australia : (acq557317) or (acq557317) Temu Coupon Code United Kingdom : (acq557317) or (acq557317) Temu Coupon Code Spain : (acq557317) or (acq557317) Temu Coupon Code Italy : (acq557317) or (acq557317) Temu Coupon Code Germany : (acq557317) or (acq557317) Temu Coupon Code Saudi Arabia : (acq557317) or (acq557317) Temu Coupon Code Austria : (acq557317) or (acq557317) Temu Coupon Code Belgium : (acq557317) or (acq557317) Temu Coupon Code Thailand : (acq557317) or (acq557317) Temu Coupon Code Kuwait : (acq557317) or (acq557317) Temu Coupon Code United Arab Emirates : (acq557317) or (acq557317) Temu Coupon Code Switzerland : (acq557317) or (acq557317) Temu Coupon Code Mexico : (acq557317) or (acq557317) Temu Coupon Code New Zealand : (acq557317) or (acq557317) Temu Coupon Code Poland : (acq557317) or (acq557317) Temu Coupon Code United States : (acq557317) or (acq557317) Temu Coupon Code Portugal : (acq557317) or (acq557317) Temu Coupon Code Netherlands : (acq557317) or (acq557317) Temu Coupon Code Brazil : (acq557317) or (acq557317) Temu Coupon Code Colombia : (acq557317) or (acq557317) Temu Coupon Code Chile : (acq557317) or (acq557317) Temu Coupon Code Israel : (acq557317) or (acq557317) Temu Coupon Code Egypt : (acq557317) or (acq557317) Temu Coupon Code Peru : (acq557317) or (acq557317) Temu Coupon Code Ireland : (acq557317) or (acq557317) Temu Coupon Code Hungary : (acq557317) or (acq557317) Temu Coupon Code Romania : (acq557317) or (acq557317) Temu Coupon Code Bulgaria : (acq557317) or (acq557317) Temu Coupon Code Colombia : (acq557317) or (acq557317) Temu Coupon Code Slovenia : (acq557317) or (acq557317) Temu Coupon Code Colombia : (acq557317) or (acq557317) Temu Coupon Code Europe : (acq557317) or (acq557317) Temu Coupon Code Malaysia : (acq557317) or (acq557317) Temu Coupon Code Oman : (acq557317) or (acq557317) Temu Coupon Code Norway : (acq557317) or (acq557317) Temu Coupon Code Switzerland : (acq557317) or (acq557317) Temu Coupon Code Czech Republic : (acq557317) or (acq557317) Temu Coupon Code Asia : (acq557317) or (acq557317) Temu Coupon Code East Asia : (acq557317) or (acq557317) Temu Coupon Code Middle East : (acq557317) or (acq557317) Temu Coupon Code Cyprus : (acq557317) or (acq557317) Temu Coupon Code Central : (acq557317) or (acq557317) Temu Coupon Code Eastern : (acq557317) or (acq557317) Temu Coupon Code Romania : (acq557317) or (acq557317) Temu Coupon Code Canada : (acq557317) or (acq557317) Temu Coupon Code Colombia : (acq557317) or (acq557317) Temu Promo Code-{acq557317} Temu Promo Code: $100 OFF{acq557317} Temu Coupon Code: Free Shipping{acq557317} Temu $100 OFF Code{acq557317} Temu 50% Discount Coupon{acq557317} Temu $120 Coupon Bundle Code{acq557317}{acq557317} Temu Student Discount Coupon Code{acq557317} temu existing user coupon code Using Temu's coupon code [{acq557317}] will get you $100 off, access to exclusive deals, and benefits for additional savings. Save 40% off with Temu coupon codes. New and existing customer offers. temu coupon code May 2024- {acq557317} temu new customer offer{acq557317} temu discount code 2024{acq557317} 100 off coupon code temu{acq557317} temu 100% off any order{acq557317} 100 dollar off temu code{acq557317} What is Temu $100 Coupon Bundle? New Temu $100 coupon bundle includes $120 worth of Temu coupon codes. The Temu $100 Coupon code "{acq557317}" can be used by new and existing Temu users to get a discount on their purchases. Enjoy $100 Off at Temu with Promo Code [acq557317] – Exclusive for August and September 2024! Looking for incredible savings on top-quality products at Temu? Whether you're new to Temu or a seasoned shopper, our special promo code [acq557317] offers you an exclusive chance to save $100 on your purchases throughout August and September 2024. Here's everything you need to know to take full advantage of this fantastic offer. For New Customers: 1. Sign Up and Save Big: • Download the Temu App: Start by downloading the Temu app from your smartphone's app store or visit the Temu website using your computer. Temu's user-friendly interface ensures a smooth shopping experience. • Create an Account: Register for a new account by providing your basic details. This process is quick and straightforward, and it unlocks your access to a $100 discount. • Browse and Add to Cart: Explore Temu's extensive range of products, from stylish fashion items to cutting-edge electronics and home essentials. Add items totaling $100 or more to your cart. This ensures that you meet the minimum purchase requirement to use the promo code. 2. Apply Your Promo Code: • Proceed to Checkout: Once you've filled your cart, go to the checkout page. Here, you'll see a field labeled "Promo Code" or "Discount Code." • Enter Code [acq557317]: Input the promo code [acq557317] into the designated field and click "Apply." The $100 discount will be automatically applied to your total. • Review and Complete Purchase: Verify that the discount has been applied to your order. Complete the payment process and enjoy your shopping spree with a $100 discount! Tip for New Customers: This exclusive offer is valid only during August and September 2024. Make sure to use the code [acq557317] within this period to maximize your savings. For Existing Customers: 1. Shop and Save with Ease: • Log Into Your Account: If you're a returning Temu shopper, simply log into your existing account on the Temu app or website. • Explore and Add Items: Browse through the extensive product catalog. From the latest gadgets to home decor, add items totaling $100 or more to your cart. • Prepare for Checkout: Proceed to the checkout page where you'll be able to apply your discount. 2. Redeem Your Promo Code: • Enter Promo Code [acq557317]: In the "Promo Code" field at checkout, enter [acq557317] and click "Apply." The $100 discount will be applied to your order total. • Check and Complete Purchase: Confirm that the discount has been applied correctly to your order. Finalize the payment details to complete your purchase. Tip for Existing Customers: This offer can be combined with other promotions available during August and September, so keep an eye out for additional savings opportunities! How to Redeem the $100 Coupon Code [acq557317]: Whether you are a new or existing customer, here's a step-by-step guide to ensure you don't miss out on this exclusive $100 discount. 1. Sign Up or Log In: • New Customers: Register for a new account on Temu by providing your details on the app or website. • Existing Customers: Log into your current Temu account. 2. Add Items to Your Cart: • Browse Temu's product offerings and add items worth at least $100 to your shopping cart. This qualifies you to use the promo code. 3. Apply the Promo Code: • At the checkout page, find the "Promo Code" box. • Enter the code [acq557317] and click "Apply." The $100 discount will be reflected in your order total. 4. Review and Complete Your Purchase: • Make sure the discount is applied to your order. Review your cart and proceed with payment. • Enjoy your savings and the products you've purchased! Additional Benefits: • Exclusive Deals: Using promo code [acq557317] not only gives you $100 off but may also unlock additional deals and promotions tailored for August and September. • Combining Discounts: You can often combine this promo code with other ongoing promotions for even greater savings. Keep an eye on Temu's website and app for additional offers. • Free Shipping: Depending on the promotion, you might also benefit from free shipping on eligible items. Important Details: • Validity: This $100 off promo code is valid only from August 1, 2024, to September 30, 2024. Make sure to use it within this time frame to take advantage of the offer. • Minimum Purchase: The offer applies to purchases of $100 or more. Ensure your cart meets this minimum before applying the promo code. • One-Time Use: The promo code [acq557317] can typically be used only once per customer. Make sure to apply it to your largest purchase to maximize savings. FAQs: Q: Can new and existing customers both use the promo code [acq557317]? • A: Yes, the promo code is available to both new and existing Temu customers. Q: Is there a minimum purchase requirement to use the promo code? • A: Yes, you need to have a minimum purchase of $100 to apply the $100 discount. Q: Can the promo code be combined with other offers? • A: Yes, in many cases, you can combine the promo code [acq557317] with other ongoing promotions and discounts. Q: What should I do if the promo code does not work? • A: Double-check that the code [acq557317] is entered correctly and that your order meets the minimum purchase requirement. If you continue to have issues, contact Temu's customer service for assistance. Take advantage of this exclusive offer today and enjoy substantial savings on your next Temu purchase. With up to $100 off, there's never been a better time to shop for high-quality products at unbeatable prices. Remember, this offer is only available for a limited time, so don't delay—start shopping and saving now! Are you looking to save big while shopping on Temu? You're in the right place! Temu is quickly becoming a favorite online marketplace, and with our exclusive Temu Coupon Codes like [acq557317], you can enjoy significant discounts, including $100 off your first order and up to 90% off selected items this October 2024. In this article, we’re diving into everything you need to know about using Temu Coupon Codes, including their legitimacy and tips on maximizing your savings. Let’s get started! What is Temu? Temu is an emerging e-commerce platform that offers a wide range of products, including electronics, clothing, accessories, home decor, and much more. Known for its affordability, Temu provides various opportunities to save even more with the right coupon codes. Whether you are a new user or an existing customer, the savings potential is substantial. Temu Coupon Code [acq557317]: What Can You Expect? Here are some of the top offers you can enjoy with the Temu Coupon Code [acq557317]: • $100 Off on your first order • Up to 90% Discount on selected items • 30% Off across various products • Free shipping for new users and first-time customers These promo codes are valid for October 2024, giving you ample time to grab your favorite items without breaking the bank. How to Apply Temu Coupon Code [acq557317]? Applying a Temu Coupon Code like [acq557317] is easy! Here’s how to do it:
Last updated: 2024-10-26
Post by hwillems on Ranges, Lambdas, on Fixed arrays of structs
CODESYS Forge
talk
(Post)
I do datastructures and algorithms in Codesys. For example a Struct of Person with thing's like IdNumber, Name, Age etc. as example. Now i do all kind of calculations, filters. So i have this pretty big Fixed Array with Structs. On this struct i want to do simple stuff you can do easily in C++/Python/Rust etc. For example i want to do this: AvererageAge := Average(Peoples.Age); Then it will return the average of all members ages. Or Sort struct on age etc. Or sort on alphabetical Name. Or use Lambda functions to filter/mutate out things like, filter out everybody above 18 years old. Or remove people who it's name start with "A". Currently i have to write my own custom function for example sorting on Age. And make a super specific function based on that particulare datastructure. Here an Example: (*Before calling this FIlter method, set the mNodeFilterSwitch to the desired filter.*) CASE mNodeFilterSelect OF (********************************[ Status Filters ]***********************************) NodeID: FOR x := ACS_OUT_BEGIN TO ACS_OUT_END BY 1 DO FOR y := ACS_IN_BEGIN TO ACS_IN_END BY 1 DO IF marrNode[y].Status.oiNodeID > marrNode[y + 1].Status.oiNodeID THEN mNodeTemp := marrNode[y + 1]; marrNode[y + 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; Started: FOR x := DES_OUT_BEGIN TO DES_OUT_END BY -1 DO FOR y := DES_IN_BEGIN TO DES_IN_END BY -1 DO IF marrNode[y].Status.oxStarted > marrNode[y - 1].Status.oxStarted THEN mNodeTemp := marrNode[y - 1]; marrNode[y - 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; Starting: FOR x := DES_OUT_BEGIN TO DES_OUT_END BY -1 DO FOR y := DES_IN_BEGIN TO DES_IN_END BY -1 DO IF marrNode[y].Status.oxStarting > marrNode[y - 1].Status.oxStarting THEN mNodeTemp := marrNode[y - 1]; marrNode[y - 1] := marrNode[y]; marrNode[y] := mNodeTemp; END_IF; END_FOR; END_FOR; END_CASE; I have like 30+ of these in the enum. Not really DRY code right? These are custom made bubble sort filters in a function. You pass in the Datastructure, and say what function you want. (This is an enum collection of sorting functions) And then the Array with Nodes of Structs gets ordered. Why can't we have Iterators and Lambda's and build in standard functions like regular languages? Also i use bubble sort because it's the easiest to implement because i can't get this to code DRY. Problem with ST (Even the new one with classes) that it's very limited for programming datastructures and algorithms. Yes you still not want dynamic memory and you need to choose the correct algorithm so you know the most extreme edge cases regarding the time it takes to execute the algorithms.(Real-time execution) How are other people dealing with this? Here for example saw some software using an adjusted ST language and having FOR EACH possibility: https://www.fernhillsoftware.com/help/iec-61131/structured-text/st-for-each.html You can then build your own custom Iterator functions. I wish the IEC 61131-3 standard would be more expressive and having more standard modern features, but still keep close to the fact of no dynamics memory and real-time systems.
Last updated: 2023-08-31
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
Post by fefefede on Get the numer of day
CODESYS Forge
talk
(Post)
Hello i tro to create a program to turn on or off the air condition in relationship temperature and numer of day. I can't get the number of day. I try this after installing SysTime library but this not work and have this error on debug ------ Build started: Application: Device.Sim.Device.Application ------- Typify code... Generate code... [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0032: Cannot convert type 'Unknown type: 'SysTimeCore(TRUE)'' to type 'TIME' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0035: Program name, function or function block instance expected instead of 'SysTimeCore' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0032: Cannot convert type 'Unknown type: 'DayOfWeek(CurrentTime)'' to type 'INT' [ERROR] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0035: Program name, function or function block instance expected instead of 'DayOfWeek' [INFORMATION] giorno_accensione_aria: PLC_PRG Device: PLC Logic: Application: C0181: Related position Build complete -- 4 errors, 0 warnings : No download possible PROGRAM PLC_PRG VAR Temperatura: UDINT; AriaCondizionata: BOOL := FALSE; CurrentDayOfWeek: INT; //Variabile Giorno CurrentTime: TIME; GiornoDellaSettimana: INT; DayOfWeek: INT; END_VAR CurrentTime := SysTimeCore(TRUE); // Ottieni l'ora corrente CurrentDayOfWeek := DayOfWeek(CurrentTime); CASE GiornoDellaSettimana OF 1: // Azioni per Lunedì 2: // Martedì se più 10° accend altrimenti spegni IF Temperatura >= 10 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 3: // Mercoledì se più di 50° accendi altrimenti spegni IF Temperatura >=50 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 4: // Giovedì se più di 40° accendi altrimenti spegni IF Temperatura >=40 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 5: // Venerdì se più di 50° accendi altrimenti spegni IF Temperatura >=50 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 6: // Sabato se più di 25° accendi altrimenti spegni IF Temperatura >=25 THEN AriaCondizionata := TRUE; ELSE AriaCondizionata := FALSE; END_IF 7: // Domenica sempre spenta AriaCondizionata := FALSE; END_CASE
Last updated: 2023-09-14
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 full0pullpolen on Device User Logon
CODESYS Forge
talk
(Post)
The following guide describes how you can adapt the user management for the first time in a project. It deals with the definition of a user and a group to which he belongs. Requirement: the project for which the user management is to be set up is opened. There is no adapted user configuration yet. Select Project Settings ‣ Users and Groups and then the Users tab. The user Owner is already created by default. Click on Add. ⇒ The dialog box Add User appears. Enter a login name, for example ‘Dev1’, and a password. Leave the option Activated activated. Click on OK. ⇒ On creating a group for the first time, CODESYS now requests you to authenticate yourself to perform this action. In this case, enter ‘Owner’ as the current user. Do not enter a password, just click on OK. The user Dev1 appears in the list and is automatically a member of the group 'Everyone'. Change to the tab Groups, in order to add the user to a new group. ⇒ The groups Everyone and Owner have already been created. Click on Add in order to open the dialog box Add Group. Specify at least one name for the new group, for example ‘Developers’. Activate the checkbox next to the entry User ‘Dev1’ in the field Members. Click on OK. ⇒ The group Developers now appears with has user member 'Dev1'. Switch to the Users tab. ⇒ The user Dev1 now appears as a member of the groups ‘Everyone’ and ‘Developers’.
Last updated: 2024-01-24
Post by full0pullpolen on Device User Logon
CODESYS Forge
talk
(Post)
The following guide describes how you can adapt the user management for the first time in a project. It deals with the definition of a user and a group to which he belongs. Requirement: the project for which the user management is to be set up is opened. There is no adapted user configuration yet. Select Project Settings ‣ Users and Groups and then the Users tab. The user Owner is already created by default. Click on Add. ⇒ The dialog box Add User appears. Enter a login name, for example ‘Dev1’, and a password. Leave the option Activated activated. Click on OK. ⇒ On creating a group for the first time, CODESYS now requests you to authenticate yourself to perform this action. In this case, enter ‘Owner’ as the current user. Do not enter a password, just click on OK. The user Dev1 appears in the list and is automatically a member of the group 'Everyone'. Change to the tab Groups, in order to add the user to a new group. ⇒ The groups Everyone and Owner have already been created. Click on Add in order to open the dialog box Add Group. Specify at least one name for the new group, for example ‘Developers’. Activate the checkbox next to the entry User ‘Dev1’ in the field Members. Click on OK. ⇒ The group Developers now appears with has user member 'Dev1'. Switch to the Users tab. ⇒ The user Dev1 now appears as a member of the groups ‘Everyone’ and ‘Developers’.
Last updated: 2024-01-24
Post by full0pullpolen on Device User Logon
CODESYS Forge
talk
(Post)
The following guide describes how you can adapt the user management for the first time in a project. It deals with the definition of a user and a group to which he belongs. Requirement: the project for which the user management is to be set up is opened. There is no adapted user configuration yet. Select Project Settings ‣ Users and Groups and then the Users tab. The user Owner is already created by default. Click on Add. ⇒ The dialog box Add User appears. Enter a login name, for example ‘Dev1’, and a password. Leave the option Activated activated. Click on OK. ⇒ On creating a group for the first time, CODESYS now requests you to authenticate yourself to perform this action. In this case, enter ‘Owner’ as the current user. Do not enter a password, just click on OK. The user Dev1 appears in the list and is automatically a member of the group 'Everyone'. Change to the tab Groups, in order to add the user to a new group. ⇒ The groups Everyone and Owner have already been created. Click on Add in order to open the dialog box Add Group. Specify at least one name for the new group, for example ‘Developers’. Activate the checkbox next to the entry User ‘Dev1’ in the field Members. Click on OK. ⇒ The group Developers now appears with has user member 'Dev1'. Switch to the Users tab. ⇒ The user Dev1 now appears as a member of the groups ‘Everyone’ and ‘Developers’.
Last updated: 2024-01-24
Post by testlogic on Sending Sequential Modbus TCP Packets
CODESYS Forge
talk
(Post)
I have a Modbus TCP slave device where I need to do sequential writes to the same register. The register I'm writing to is kind of like a command line, each packet is a command word encoded in Hexadecimal. I am having difficulty implementing this system in CoDeSys 3.5 SP19. I feel like the structure of the program should be something along the lines of (Pseudocode): ModbusTCPSend(Command Register, Command1) ModbusTCPSend(Command Register, Command2) ModbusTCPSend(Command Register, Command3) I have tried to implement this with a rising edge trigger wMot1OPCode := 16#E1; //Stop Motor & Kill Program xMot1SendOP := TRUE; //Send OP on rising edge xMot1SendOP := FALSE; //Reset wMot1OPCode := 16#9E; //Disable Motor xMot1SendOP :=TRUE; //Send OP on rising edge xMot1SendOP := FALSE; //Reset Where "wMot1OPCode" is the IO map for writing to the command register, and "xMot1SendOP" is the rising edge trigger for that modbus channel. However, this doesn't work. The device never responds to the modbus commands. It seems like the trigger variable is switched too quickly for modbus to send the packet. I know the modbus register is working, because I can set the channel to cyclic and the device will respond. However, I can't use this reliably because I need each command to be sent once, in order. Cyclic keeps re-sending the commands and seems like it could miss a command as well if one was sent in-between cycle time. I have also trying using the Application trigger as described by https://faq.codesys.com/pages/viewpage.action?pageId=24510480, but this is also not working for me. See attached picture for my FBD code. This seems like a simple function, I can't tell what I'm doing wrong here. Thanks for the help.
Last updated: 2024-03-06
Post by manuknecht on Maximum dynamic limits of MC_MoveLinearAbsolute and MC_MoveLinearRelative
CODESYS Forge
talk
(Post)
Hello all I use an axis group with two linear axes in a kinematic system. Using MC_MoveLinearAbsolute and MC_MoveLinearRelative, I am trying to realise dynamic movements (set velocity: 1 m/s, set acceleration: 30 m/s^2) with the highest possible jerk, as I want to compare this with a movement with a trapezoidal velocity profile. However, my measurements show that the axes accelerate with a maximum jerk of approx. 800 m/s^3, even if the value in the function block was set to 10,000 m/s^3. I have already increased the dynamic limits of the two axes accordingly (Velocity: 5000 u/s, Acc-/Deceleration: 250'000 u/s^2, Jerk: 100'000'000 u/s^3, where 1 u = 1 mm), but this had no effect. I have checked the input parameters of the function blocks and the VelFactor, AccFactor and JerkFactor factors are all set to the maximum (value 1). Reducing the cycle time has resulted in a higher jerk, but as we are already working with a cycle time of 1 ms, there is nothing more that can be done here. The axes themselves are still a long way from drawing the maximum current, which is why I assume that this should not be a problem either. Are there other factors or parameters that influence the dynamic limits and therefore allow faster movements? The PLC I am using is a Raspberry Pi 4 and Codesys V3.5 SP20 with all libraries up to date. Thanks in advance Manuel
Last updated: 2024-05-08
Post by tcarlbom on Read tag values using external program
CODESYS Forge
talk
(Post)
This is my first time posting in this forum and I am new to codesys. I am a fullstack developer and I am trying to figure out how the following. What would be the best approach to create a own/custom tag browser? Either directly in codesys ide or using a separate custom program (perhaps a winforms application). 1.a. Shall I parse the .project xml file to get a list of all tags in the project? 1b. Shall I use python scripting in codesys ide to get a list of tags? Once one have selected some tags. These tags shall be exposed to a python program which will be acting as a edge computer. It’s fine to be able to import a file. 2a. I found a library called codesys plchandler which (as I understand) acts a rest api server. Is this correct? If so, can I query the api from a custom python script, ie can query what tags exist in project and or read tag values? My research so far. From earlier projects I know that using opc ua would be perfect for this but from my opinion it’s bloating the plc since it’s resource intensive. So opc ua is not an option. Codesys automation server is neat. But I don’t want to rely on some cloud services and subscription based pricing. There seem to be several interesting codesys libraries like mqtt, tcp server and NVL sender which would help me expose plc tags. But all have a common problem. One have to manually write what tags which will be used in these function blocks. I want a similar experience like “selecting” tags in the opc ua or the codesys tracing, ie a tag browser.
Last updated: 2024-06-28
Post by steven-schalm on Github Actions CI/CD tasks - development topic
CODESYS Forge
talk
(Post)
hello kevinrn, I've been looking for a solution to the CI/CD issue for a long time. Briefly about me... I am 32 and software architect for Codesys V3 and fullstack dev for web (VueJS, NestJS) in a small company in Erfurt (Germany). https://www.rex-at.de/. Through my web part, we already have CI/CD running well via GitLab (YAML-based configuration file (.gitlab-ci.yml), which defines which pipelines and jobs are executed when certain events occur) with everything you know. Stages for npm packages - prepare (GitVersion, npm install or whatever) - build (vite, tsc or whatever) - testing (vitest, jest or whatever) - deploy (npm packages) And similar for monorepo's or backend services (in NestJS) as DockerImages. For Codesys we have been building an OOP framework for years (~50 libraries now), which is currently managed via SVN and a specially written Svn-Watcher (in Python) gets commits and runs and builds everything together and deploys it to an FTP server and network drive. Why do we still have SVN? Because we are unfortunately still tied to the safety integration of Codesys and can therefore only go to SP15 at most with our controller/Eckelmann. But soon there will be an update and there will be no more obstacles to using Git. Hence my questions: 1. the basic idea is to run a local Windows Runner on some machine? 2. install Codesys on the machine where the runner is running? 3. powershell & python scripts are then used to execute builds (compile, build, sign libraries) & deploys? 4. can the Github action also be used in GitLab? ChatGPT has already told me that it's not the same, but it doesn't hurt to ask. Do you have any ideas on this? Greetings :D
Last updated: 2024-08-20
Post by sushela on Temu Coupon Code $100 Off ╰┈➤ USA [ acq615756]
CODESYS Forge
talk
(Post)
Temu Coupon Code $100 Off ➥ [acu577459 & acq615756], TEMU Coupon Code [acu577459 & acq615756]” | $100 OFF & 50% DISCOUNT, TEMU Coupon Code “[acu577459 & acq615756]” ,is an all in one opportunity, which also offers $100 Off & 50% Discount! The TEMU Coupon Code “⟪ acr552049 or acr690202 ⟫” offers an impressive $100 discount and a 50% discount on purchases for both new and existing customers. This special offer is a fantastic opportunity to save significantly on your TEMU shopping experience. By using the Coupon Code “[acu577459 & acq615756]”, you can unlock the $100 coupon bundle, which provides $120 worth of savings. This means that you can enjoy a $100 discount on your order, as well as access to exclusive deals and additional savings opportunities. ⇦ Exclusive Temu coupon Codes ,,,⟪ acr552049 or acr690202 ⟫,,,,, ➤ Offers → Discounts, Student Deals & More ╰┈➤ Best Temu Coupon Codes➤ [acu577459 & acq615756] ⇨ [acu577459 & acq615756] ➥ Up to 50% Off To redeem the TEMU $100 Coupon Code, simply follow these steps: Sign up for a TEMU account on their website or mobile app. Add items worth $100 or more to your shopping cart. During checkout, enter the Coupon Code “acr552049” in the designated field. The $100 discount will be automatically applied, and you can also enjoy an additional 50% off on your purchase. This Coupon Code is valid for both new and existing TEMU customers, making it a great opportunity for everyone to save on their shopping. The $100 coupon bundle can be combined with other available discounts, such as the 30% off code for fashion, home, and beauty categories, allowing you to maximize your savings. ➥ Temu Coupon Code $100 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code 40 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code 50 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code 70 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code 90 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code 30 Off [acu577459 & acq615756]USA ➥ Temu Coupon Code First Order [acu577459 & acq615756]USA ➥ Temu Coupon Code Existing User[acu577459 & acq615756]USA ➥ Temu Coupon Code 90 Off [acu577459 & acq615756]USA Overall, the TEMU Coupon Code [acu577459 & acq615756] is an excellent way to save a significant amount on your purchases, with a $100 discount and a 50% discount on top of that. Take advantage of this fantastic offer and enjoy the benefits of shopping with TEMU. USA Are you looking for the best deals on TEMU? Look no further! The TEMU Coupon Code [acu577459 & acq615756] offers an incredible $100 off and a whopping 50% discount on your purchases. Whether you’re a new customer or a loyal shopper, this code will maximize your savings and enhance your shopping experience. Let’s dive into the details and discover how you can make the most of this fantastic offer. Why Choose TEMU? USA TEMU is a popular online marketplace known for its wide range of products, competitive prices, and excellent customer service. From electronics and fashion to home goods and beauty products, TEMU has something for everyone. With regular promotions and discounts, TEMU ensures that you get the best value for your money. How to Use the TEMU Coupon Code [acu577459 & acq615756] Using the TEMU Coupon Code “acq909783” is straightforward. Follow these simple steps to unlock your $100 off and 50% discount: Visit the TEMU Website or App: Go to the official TEMU website or open the TEMU app on your mobile device. Browse and Shop: Explore the extensive range of products and add your desired items to the shopping cart. Proceed to Checkout: Once you’ve finished shopping, click on the cart icon and proceed to checkout. Enter the Coupon Code: In the Coupon Code field, enter “acq909783” and click apply. Enjoy Your Savings: Watch the total amount drop as the $100 off and 50% discount are applied to your order. Benefits of Using TEMU Coupon Code “acq909783” Significant Savings: Enjoy a substantial discount on your total purchase, making it easier to buy more for less. Wide Range of Products: The Coupon Code is applicable to a vast selection of items, ensuring you can use it on the products you need and love. Easy to Use: The straightforward process of applying the Coupon Code ensures a hassle-free shopping experience. Frequent Promotions: TEMU regularly offers promotional codes and discounts, so keep an eye out for more great deals in the future. Tips for Maximizing Your Savings on TEMU Sign Up for the Newsletter: Stay updated on the latest promotions, new arrivals, and exclusive offers by subscribing to the TEMU newsletter. Follow TEMU on Social Media: Follow TEMU on platforms like Facebook, Instagram, and Twitter for real-time updates on sales and special deals. Download the App: The TEMU app often features app-exclusive discounts and offers, making it a great way to save more. Shop During Sales Events: Keep an eye out for major sales events like Black Friday, Cyber Monday, and seasonal sales for additional discounts. “[USA]” TEMU FIRST ORDER COUPON CODE ,,,||⟪ acr552049 or acr690202 ⟫|| ,,, First Order/Free Shipping TEMU COUPON $100 OFF -[acu577459 & acq615756] .USA Temu Free Gift Code — [acu577459 & acq615756] .USA TEMU Free Gift Code FOR EXISTING CUSTOMERS [acu577459 & acq615756] .USA TEMU Free Gift Code FIRST ORDER -[acu577459 & acq615756] .USA TEMU Free Gift Code REDDIT -[acu577459 & acq615756] .USA TEMU Free Gift Code FOR EXISTING CUSTOMERS REDDIT -[acu577459 & acq615756] .USA TEMU COUPON $100 Free Gift Code OFF NEW USER -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FOR EXISTING CUSTOMERS 2024 -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF CODE -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FIRST ORDER FREE SHIPPING -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FOR EXISTING CUSTOMERS FREE SHIPPING USA -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF HOW DOES IT WORK -[acu577459 & acq615756] . USA TEMU COUPON $100 OFF FOR EXISTING CUSTOMERS CANADA -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF 2024 -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FOR NEW CUSTOMERS -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF CANADA -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FOR EXISTING CUSTOMERS FIRST ORDER — [acu577459 & acq615756] .USA TEMU 300 OFF COUPON BUNDLE -[acu577459 & acq615756] .USA 300 Coupon CodeS -[acu577459 & acq615756] .USA 1 BUCKS TO PHP -[acu577459 & acq615756] .USA IS THERE A COUPON IN THE PHILIPPINES -[acu577459 & acq615756] .USA 300 BUCKS TO PHP -[acu577459 & acq615756] .USA TEMU $100 OFF COUPON -[acu577459 & acq615756] .USA TEMU $100 OFF CODE -[acu577459 & acq615756] .USA TEMU 300 VALUE COUPON BUNDLE -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF FOR EXISTING CUSTOMERS FREE SHIPPING -[acu577459 & acq615756] .USA TEMU Free Gift CODE LEGIT -[acu577459 & acq615756] .USA TEMU Free Gift CODE REDDIT -[acu577459 & acq615756] .USA TEMU 300 OFF Coupon Code FOR EXISTING USERS -[acu577459 & acq615756] .USA TEMU Free Gift Code UK -[acu577459 & acq615756] .USA TEMU Coupon Code $100 OFF FREE SHIPPING -[acu577459 & acq615756] .USA TEMU Coupon CodeS 300 PERCENT OFF -[acu577459 & acq615756] .USA WHAT IS A HIGH COUPON RATE -[acu577459 & acq615756] .USA HOW TO CALCULATE COUPON RATE WITHOUT COUPON PAYMENT -[acu577459 & acq615756] .USA WHAT IS THE COUPON RATE -[acu577459 & acq615756] .USA HOW TO CALCULATE COUPON VALUE -[acu577459 & acq615756] .USA USING COUPONS AND REBATES TO LOWER THE PRICE OF AN ITEM IS AN EXAMPLE OF — [acu577459 & acq615756]USA TEMU 300 DOLLAR OFF COUPON — [acu577459 & acq615756] .USA DOMINOS Coupon Code 300 OFF -[acu577459 & acq615756] . USA DOMINO’S 300 RS OFF Coupon Code -[acu577459 & acq615756] .USA TEMU COUPON $100 OFF EXISTING CUSTOMERS -[acu577459 & acq615756] .USA WHAT IS 10 OFF 300 DOLLARS -[acu577459 & acq615756] .USA 300 OFF Coupon Code — [acu577459 & acq615756]USA 1 CASHBACK ON 300 DOLLARS — [acu577459 & acq615756] .USA IS TEMU 300 OFF COUPON LEGIT — [acu577459 & acq615756]USA TEMU COUPON $100 OFF — [acu577459 & acq615756]USA TEMU COUPON $100 OFF LEGIT — [acu577459 & acq615756]USA WHAT IS A GOOD COUPON RATE — [acu577459 & acq615756]USA TEMU 300 VALUE COUPON — [acu577459 & acq615756]USA 300 DOLLAR OFF SHEIN CODE — [acu577459 & acq615756]USA WHAT IS A ZERO COUPON NOTE — [acu577459 & acq615756] USA TEMU 300 PERCENT OFF COUPON REDDIT — [acu577459 & acq615756]USA USA TEMU 300 OFF COUPON REAL — [acu577459 & acq615756]USA TEMU 300 OFF Coupon Code — [acu577459 & acq615756]USA TEMU COUPON $100 OFF SOUTH AFRICA — [acu577459 & acq615756]USA TEMU COUPON $100 OFF FREE SHIPPING — [acu577459 & acq615756]USA TEMU COUPON $100 OFF FIRST TIME USER — [acu577459 & acq615756]USA TEMU Coupon Code $100 OFF FIRST TIME USER -[acu577459 & acq615756]USA IS THE TEMU 300 OFF COUPON LEGIT -[acu577459 & acq615756]USA TEMU COUPON $100 OFF UK -[acu577459 & acq615756] .USA TEMU Coupon Code 300 OFF UK — [acu577459 & acq615756] .USA HOW MUCH IS 20 OF 300 DOLLARS -[acu577459 & acq615756] .USA TEMU Coupon Code 300 OFF -{[acu577459 & acq615756]USA Final Thoughts The TEMU Coupon Code [acu577459 & acq615756] offering $100 off and a 50% discount is an incredible deal you don’t want to miss. Whether you’re shopping for yourself or looking for the perfect gift, this code will help you save big on a wide range of products. Don’t wait — start shopping on TEMU today and enjoy unbeatable savings!
Last updated: 2024-10-26
Post by ofey on EtherCAT fieldbus
CODESYS Forge
talk
(Post)
Hi, everyone! I'm trying to set up a PLC controller and a connection to an EtherCAT slave device in Codesys. I want to create a flexible program that I can upload to multiple controllers with different remote IO connected (same program). On one plant i may have 5 AI-cards and 3 DO-cards, and on another I may have 4 AI-cards and 2 DO-cards. For not needing to maintain several different programs wih different devices defined in the program (one for each set up) I thought that using a remote IO would make it easier having a single program. That way I could refer to different memory addresses instead of predefined slots/channels and IO's, that would give me errors if there was a different IO on the plant than what the program expected. When I tried setting up the etherCAT master, I saw that I had to define the etherCAT slave devices with the different IO'cards for me to be able to refer to the memory addresses in a PRG. Exactly what I was trying to avoid. My setup is something like a program that can handle 16 separate pump controls. In a year maybe 6 plans get deployed, and depending on how large the project is, the number of pumps can vary between 4 and 16. And the managers dont want to have IO's for all 16 pumps on every cabinet, and I dont want to maintain 16 separate projects files in case of updates etc. I thought the best way to tackle this was having a single project that read/write data to the different pump IO's by remote IO (fieldbus ethercat) addresses. And the number of pump controls are activated by an external GUI. If pump 1-6 is activated by the GUI, then the PLC-program tries to read/write input/outputs from predefined addresses for the expected IO's. My test setup is a PFC200 WAGO controller and a EtherCAT fieldbus coupler (750-354) with some IO. I hope I didn't explain this too horrible, and if there is a more easy and elegant solution for this challenge I appreciate a feedback on this.
Last updated: 2024-04-08
Post by ppix on Establishing TLS Connection with MQTT Broker using MQTT Client SL Package
CODESYS Forge
talk
(Post)
I’m currently working on establishing a TLS connection with an MQTT broker using the MQTT Client SL package in CODESYS. While I’ve successfully established communication with the broker without TLS, I'm encountering issues when trying to enable TLS. In the 'MQTT Explorer' application, I can easily upload the server certificate (.crt), client certificate (.crt), and client key (.key). However, in CODESYS, I can’t find a way to upload my client key (.key file). Here's a summary of my current setup: Certificates: I have uploaded both the client and server certificates to the certificate store under the 'Trusted Certificates' folder in the security screen. TLS Context Initialization: Despite setting the _sCommonName as the name of my client certificate, a new self-signed certificate is created and placed within the device’s certificates. I then need to manually move this certificate to the trusted certificates folder. This results in three certificates in my trusted certs folder: client cert, server cert, and the newly created cert. _ciDefaultCertInfo : MQTT.NBS.CERT_INFO := (psInfo := ADR(_sCommonName), udiSize := TO_UDINT(LEN(_sCommonName))); // CN of the certificate (common name) _sCipherList : MQTT.NBS.CIPHER_LIST := STRUCT(psList := ADR('HIGH'), udiSize := 4); // Cipher string see https://www.openssl.org/docs/man1.1.1/man1/ciphers.html _tlsContext : MQTT.NBS.TLSContext := ( sUseCaseName := _sCommonName, // A certificate is stored in the certificate store with the use case name. You can choose any name. Here we use the common name. ePurpose := MQTT.NBS.PURPOSE.CLIENT_SIDE, // For client certificates set this to NBS.PURPOSE.CLIENT_SIDE sTLSVersion := '1.3', // The TLS version sCipherList := _sCipherList, // Set the cipher list sHostname := sHostname, // The hostname of the broker udiVerificationMode := 2, // 2 => Active Peer verification ciCertInfo := _ciDefaultCertInfo, // Set the cert info itfCertVerifer := 0); // 0 => No Verifier mqttClient : MQTT.MQTTClient := (xUseTLS:=TRUE, itfTLSContext := _tlsContext, itfAsyncProperty := _asyncProperty); Additional Details: In the client FB, I’ve set uiPort:= 8883, xUseTLS:= TRUE, and configured itfTLSContext as mentioned above. The certificates are encrypted with SHA256RSA. sHostname is the IP address of my broker. I’ve attached a copy of the client FB, which shows straight lines where variables are assigned and boxes where they are not. I am currently trying this on the only 2 compatible versions of COSDESYS with my controller (V3.5.15.20 and V3.5.18.40) My Question: How do I correctly set up this mTLS connection? What might I be missing? Any guidance or suggestions would be greatly appreciated, especially considering I’ve already successfully established a non-TLS connection with the same broker. Thank you in advance for your help!
Last updated: 2024-06-19
Post by dantheman on Connecting to SoftPLC Only Works By Turning Off Modbus Ethernet Port
CODESYS Forge
talk
(Post)
I have an IPC with 2 ethernet ports and 1 Wi-Fi. I'm using ModbusTCP with the ethernet port named "enp2s0" connected to my remote I/O. This works fine when testing with Python and also works with CODESYS, but CODESYS is only able to scan for the Linux SoftPLC when I turn off the "enp2s0" interface. In other words, I can't get online with the IDE if I want my ModbusTCP comms to run with CODESYS. I'm using a Linux SoftPLC that has the following entry in CODESYSControl.cfg, hoping that this will allow me to connect with "enp1s0" or "wlp3s0", and leave "enp2s0" for field comms, but this seems to only make the source IP of the ModbusTCP comms to be bound to "enp2s0". That last point is the case only if I don't restart the service, but if I do restart the service after changing the config file, the source IP for the ModbusTCP comms then becomes the one for "enp1s0", which is very confusing to me: [SysSocket] Adapter.0.Name="enp2s0" Adapter.0.EnableSetIpAndMask=1 On the device list, I only have "enp2s0" given as the ethernet device that has the ModbusTCP master & slave beneath it, shown in Screenshot 1. On the IPC, I can ping the ModbusTCP client (remote I/O) from "enp2s0", and I've attached a Wireshark capture of running ModbusTCP from the CODESYS runtime as Screenshot 2, 3 & 4 (again, I can't get online when this is running, I have to turn off "enp2s0" to connect even when it's idle and I don't have an active TCP session with my Python tests). Like I explained above, the source IP is "enp1s0", even though the ethernet device on the project is "enp2s0". I was lucky to catch the red message that showed the source IP that makes sense to me (the one for "enp2s0"), but for some reason that connection was reset and I never saw that packet again. I've also tried this with Auto-reconnect both enabled & disabled, for the ModbusTCP Master device. I also have to turn off "enp1s0" and then turn it on, just so that I can have the ModbusTCP comms running from "enp2s0" (which is not intuitive in any way to me, I'd love some help understanding that phenomenon as well) in the weird manner that I've described above. I would be very appreciative if someone can help me figure out this pickle. I'd love to just connect to CODESYS through my Wi-Fi interface and leave my ethernet ports for field comms.
Last updated: 2024-08-01
Post by thn-power on Updating OPC UA Core Nodeset on PLS
CODESYS Forge
talk
(Post)
Hi After much trail and error I think I found the root cause to my OPC UA problem. The problem is that I cannot manage to build and download a program with a a custom OPC UA Information model. We use a Weidmueller WL2000 PLS, but the problem also exsist on the Win V3 PLC. Our custom information model is based on the latest versions of the OPC UA Core Nodeset v 1.05.03 (2023-09-20) and UA/DI nodeset 1.04.0 (2022-11-03) Those nodesets are installed in the Codesys Information Model Repository (3.5.19.6) However, when trying to build I get the following error. [ERROR] Untitled1: Communication Manager [Device: PLC Logic: Application]: The information model http://opcfoundation.org/UA/ is required by http://bos.org/ with a minimal publication date from 15.12.2023 but the device has only a model from 15.09.2021 installed. Probably the information model from 15.09.2021 is missing in the information model repository. [ERROR] Untitled1: Communication Manager [Device: PLC Logic: Application]: The information model http://opcfoundation.org/UA/DI/ is required by http://bos.org/ with a minimal publication date from 03.11.2022 but the device has only a model from 09.03.2021 installed. Probably the information model from 09.03.2021 is missing in the information model repository. Build complete -- 2 errors, 1 warnings : No download possible I think the problem is that the UA Core nodeset is implemented in the PLC firmware (at least that in Siemens S7), and that only includes the "old" nodeset from 2021-09-21 etc. So the question is, how (or if?) can I transfer the new nodeset to the PLS? I have created separate Information models under Communication manager with the newer code nodesets (UA and DI). But it seems that the compiler does not recognize them being excising, neither in the Codesys IDE or on the PLC. Would have guessed that this is a common issue, sine many manufacturers use the latest versions of the OPC UA standard, and that it would be a solution to the problem.
Last updated: 2024-09-20
Post by george32 on Readable IO names
CODESYS Forge
talk
(Post)
Hello Folks, I have a quite basic understanding of how PLC programming works. However I keep getting stuck on 1 problem I could not get my head around. The problem is as follow: I have a PLC with 60 IO (20 inputs, 40 outputs). Each IO is defined as a function block. Furthermore I have an external IO card connected trough a CanBus connection. This IO card has 4 analog input channels (USINT), 4 digital inputs (Bool) and 4, digital outputs (Bool) Because I have 2 different components which both has data have I made 4 arrays to store the data off every component in one variable. PLC_Input: Array [1..20] of BOOL; PLC_Output: Array [1..40] of BOOL IOCard_Input: Array [1..8] of BOOL IOCard_Output: Array [1..4] of BOOL Because the control and reading of the different in and outputs is done by a TCP connection I want to use some kind of enumeration or struct to give each index a name so that my main would be a little bit more readable instead of all the magic numbers. Also this would make my program more dynamic for the furter in case I need to changes some in the IO nummers. For example: pump is placed on the fysical terminal strip number place 54, which is the 3th output of the IO card in the program: if I am sending a message with value 54 I would like to control IOCard_Output[3]. If there is a solution or methode to get this done, I can eventually do the following in my main program: IOCard_Output[Pump]. I have tried the following: IOCard_Output[Pump - 51] with an enumration but this keeps raising an error I hope some of you could help me further with this problem. In gross lines: I want to couple all the different IO to a more readable name and this readable name should control the right Array index Thanks in advance, George
Last updated: 2024-09-26
Post by jari-koivuluoma on Problem trying Net Base Services 3.5.15.0 TCP connection
CODESYS Forge
talk
(Post)
I have a need to send messages between 2 PLCs and I cant use network variables (because of size limit) so I tried writing this simple test program. This seems to work fine. I can send messages back and forth when a first "Start server" and then "Connect client". See the attached image. However, if I disconnect the client by setting ClientConnect to false and try to re-connect then the TCP_Client just gives me TIMEOUT error. When I stop and start the server again, then Im able to reconnect. How is this supposed to work? Why reconnecting wont work. There is not other way of disconnecting the client than setting xEnable of the TCP_Client to false. This is just a testing program and I will try it on 2 seperate devices once this works. PROGRAM PLC_PRG VAR CONSTANT mySize : UDINT := 255; END_VAR VAR Server: NBS.TCP_Server; ServerIpStr: STRING := '127.0.0.1'; ServerIP: NBS.IP_ADDR; ServerPort: UINT := 50000; ServerConnection: NBS.TCP_Connection; Client: NBS.TCP_Client; ServerRead: NBS.TCP_Read; ServerWrite: NBS.TCP_Write; ServerSend: STRING(mySize); ServerReceive: STRING(mySize); ServerConnect: BOOL; bServerSend: BOOL; IP: NBS.INADDR; ConnectedClientIP: STRING; ClientPort: UINT := 50000; ClientIpStr: STRING := '192.168.1.49'; ClientIP: NBS.IP_ADDR; ClientRead: NBS.TCP_Read; ClientWrite: NBS.TCP_Write; ClientSend: STRING(mySize); ClientReceive: STRING(mySize); ClientConnect: BOOL; bClientSend: BOOL; Error: BOOL; Message: BOOL; END_VAR // Server ServerIP.sAddr := ServerIpStr; Server( ipAddr := ServerIP, uiPort := ServerPort ); ServerConnection( xEnable := Server.xEnable, hServer := Server.hServer, ); IP := ServerConnection.IPAddress; ConnectedClientIP := F_Concat7( BYTE_TO_STRING(IP.S_un_b.s_b1),'.', BYTE_TO_STRING(IP.S_un_b.s_b2),'.', BYTE_TO_STRING(IP.S_un_b.s_b3),'.', BYTE_TO_STRING(IP.S_un_b.s_b4)); ServerRead( xEnable := ServerConnection.xActive, hConnection := ServerConnection.hConnection, szSize := SIZEOF(ServerReceive), pData := ADR(ServerReceive) ); IF ServerRead.xReady AND ServerRead.szCount > 0 THEN Message := TRUE; END_IF IF ServerRead.eError > 0 THEN Error := TRUE; END_IF ServerWrite( xExecute := ServerConnection.xActive AND bServerSend, hConnection := ServerConnection.hConnection, szSize := LEN(ServerSend)+1, pData := ADR(ServerSend) ); IF ServerWrite.xDone THEN bServerSend := FALSE; END_IF IF ServerWrite.eError > 0 THEN Error := TRUE; END_IF // Client ClientIP.sAddr := ClientIpStr; Client( xEnable := ClientConnect, ipAddr := ClientIP, uiPort := ServerPort, udiTimeOut := 10000000 ); ClientRead( xEnable := Client.xActive, hConnection := Client.hConnection, szSize := SIZEOF(ClientReceive), pData := ADR(ClientReceive) ); IF ClientRead.xReady AND ClientRead.szCount > 0 THEN Message := TRUE; END_IF IF ClientRead.eError > 0 THEN Error := TRUE; END_IF ClientWrite( xExecute := Client.xActive AND bClientSend, hConnection := Client.hConnection, szSize := LEN(ClientSend)+1, pData := ADR(ClientSend) ); IF ClientWrite.xDone THEN bClientSend := FALSE; END_IF IF ClientWrite.eError > 0 THEN Error := TRUE; END_IF
Last updated: 2024-10-03
Post by mondinmr on Frustration-Fueled Feedback on Project File Management and Git Integration
CODESYS Forge
talk
(Post)
Good day, I’m writing this message out of frustration regarding the current way project files are saved as encrypted XML and single-file format in CODESYS. I find this approach to be quite tedious for several reasons: Limited Access to Structured Text: Not being able to access Structured Text (ST) externally makes it impossible to work with alternative editors like VSCode. Tools like VSCode are incredibly responsive and feature advanced systems such as GitHub Copilot, which would be a real game-changer when working with ST IEC. While CODESYS works well for small code snippets or debugging, when the codebase grows, switching to VSCode to boost productivity becomes essential, and copy-pasting between environments is a cumbersome workaround. Poor Integration with Git: This file format also makes it very difficult to integrate effectively with Git. I have tested the internal demo, but for advanced merges, it is unusable. Without properly formatted plain text, it’s impossible to leverage the vast ecosystem of external tools around Git that allow smooth merges in heterogeneous teams. File Corruption on Network Drives: I often work from multiple locations with shared network drives. When the development environment saves a file and something goes wrong midway (which can occasionally happen when using VPNs and network drives), the entire project becomes irrecoverable. There’s no way to cancel the save process, and the development environment freezes. This has happened to me at least four times over the past two weeks, and one of those incidents cost me an entire day of work. All of this is particularly disappointing because I truly believe that the libraries, runtime, and overall work done by CODESYS are exceptional. I find it fantastic that there is a platform allowing development of PLCs and control systems using OOP, which is a huge advantage in modern control engineering. I apologize for the rant, but this issue has been extremely frustrating. Best regards.
Last updated: 2024-10-15
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
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
.