PLC programming using TwinCAT 3 - Test driven development (Part 17a/18)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 25

  • @JakobSagatowski
    @JakobSagatowski  2 ปีที่แล้ว +1

    ⬆Support this channel using the "Thanks" button⬆ or by making a donation through PayPal → www.paypal.com/donate/?hosted_button_id=7FBED5B26KT7S, or by becoming a Patron → www.patreon.com/sagatowski

  • @Toturials
    @Toturials 2 ปีที่แล้ว +1

    Thanks for another awesome Video.👍

  • @TheKanuunankuula
    @TheKanuunankuula 11 หลายเดือนก่อน

    Good tutorial on this. Could you just loop through the array and check each entry like that?

  • @MaurilioPatinoPerez
    @MaurilioPatinoPerez 3 หลายเดือนก่อน

    14:19 is there a reason why eWriteState is written twice at WRITE_EVENT_TRIGGER? or is that a mistake?
    WRITE_EVENT_TRIGGER :
    eWriteState := FILE_OPEN_TRIGGER;
    CsvString := CreateCsvString(stEvent := stEventWrittenToFile);
    fbFilePuts(bExecute := TRUE,
    sLine := CsvString,
    hFile := fbFileOpen.hFile);

    eWriteState := WRITE_EVENT; //it is simply overwritten here right?

  • @TomScryleus
    @TomScryleus 2 ปีที่แล้ว +1

    Good video!

  • @pietgeursen7023
    @pietgeursen7023 2 ปีที่แล้ว +3

    Thank you thank you thank you!
    I've been watching your vids over the last week for work and you're an excellent teacher.
    One question: is there a reason why you split out the library into a separate solution rather than just creating another project in the existing solution? Asking because that's what I'm trying to do and I can't figure out how to make the main project depend on the library.

    • @JakobSagatowski
      @JakobSagatowski  2 ปีที่แล้ว +2

      Thanks for the feedback. It's easier to put the whole project in a build/test-pipeline when it's separated (not covered in this course). Also there are some issues with double ADS-logstr messages if you have more than one project in one solution.

    • @pietgeursen7023
      @pietgeursen7023 2 ปีที่แล้ว

      @@JakobSagatowski yeah I'm setting the double log messages but whatever.

    • @pietgeursen7023
      @pietgeursen7023 2 ปีที่แล้ว

      *seeing

  • @RaimundoBuckfield
    @RaimundoBuckfield ปีที่แล้ว +1

    Hello fellow PLC programmer, I have also worked in the industry for a few years now and I do appreciate your content, especially regarding Beckhoff, as sometimes I feel that their documentation is poor, it may be very useful and organized nevertheless!
    I do have to ask, do you have a "discord" group or somewhere that I might follow and maybe ask questions when in need or help others out when they need? thank you in advance!

    • @JakobSagatowski
      @JakobSagatowski  ปีที่แล้ว

      Hey! Happy you find my material useful. I don't have any discord but it's a great idea!

  • @serhatozyildiz
    @serhatozyildiz 2 ปีที่แล้ว +1

    Thanks Jakob! Would you share this project with us?

    • @JakobSagatowski
      @JakobSagatowski  2 ปีที่แล้ว

      Hey Serhat! All the code will be uploaded to Patreon! (www.patreon.com/sagatowski ).

  • @Bulkje
    @Bulkje 2 ปีที่แล้ว +2

    Hi Jakob, great video! I had some questions, is there any reason to assert all the different parts of the struct individually instead of using AssertEquals on the whole struct? And sometimes an assert fails unexpectedly, is there a way to easily navigate to the test by clicking the error in the error list? Do you have experience with extending testSuites to eachother to test FB's that extend eachother? I also made a playlist with more talks about TDD / CI in general for people who are interested: th-cam.com/play/PLghjDAKvCBYROQSWcSgUHWNGi5g82IF4A.html

    • @JakobSagatowski
      @JakobSagatowski  ปีที่แล้ว +1

      Hi Jesse! The only reason I did separate asserts was that it's much more clear exactly where the problem occured. It's not possible to navigate to the test as the output from TcUnit is just printed into the event log of Visual Studio and it has no tight integration into TwinCAT.

  • @SuperHexadecimal
    @SuperHexadecimal ปีที่แล้ว

    Having to create a task which then runs on the target PLC makes it a bit cumbersome to use I feel. It should just try to run things locally somehow

    • @JakobSagatowski
      @JakobSagatowski  ปีที่แล้ว +1

      You don't need (and shouldn't use) a PLC to run the tests. You can run the tests locally at any point in time. Starting from next version of TwinCAT, you can even run your tests in user-space. Please watch my video about user-space TwinCAT for the details.

    • @SuperHexadecimal
      @SuperHexadecimal ปีที่แล้ว

      Hey, thanks for responding and for the effort with the videos @@JakobSagatowski . The problem is that I have one project and there I have all my code and now some unit tests I am writing thanks to your help. I can of course run it locally for unit testing, but I don't want to have to disable the tasks or something every time I also need to test on hardware. What is your approach for when you develop both using hardware and locally?

  • @Runtimevic
    @Runtimevic 2 ปีที่แล้ว

    hello @jakob,
    As always learning from your videos, I don't know how to fix the error that you mentioned at the beginning that the project had, can you put it somewhere so I can see how it was fixed? Thank you and waiting for the second part...

    • @JakobSagatowski
      @JakobSagatowski  2 ปีที่แล้ว

      Happy you like the video! The second part is already available for all Patrons/members. Thank you!

  • @steventrompet3151
    @steventrompet3151 2 ปีที่แล้ว

    This is your first video where I am dissapointed.
    It can all be near-perfect from a software-dev point of view, but it is near-impossible from a machine-dev point of view.
    I really hope to see how TDD can be applied in a much more intuitive way.

    • @JakobSagatowski
      @JakobSagatowski  2 ปีที่แล้ว +7

      TDD isn't the classical way of doing it, so I can understand it doesn't feel intuitive in the beginning. Sorry to hear you're dissapointed. You can't make everyone in the world happy.

    • @adrianjenkner2775
      @adrianjenkner2775 2 ปีที่แล้ว +1

      The change in thinking about programming that Jacob mentioned in the film cannot be intuitive. This is obvious. Change of thinking = / = intuition.

    • @Flamechr
      @Flamechr ปีที่แล้ว

      Well it can be done. There are 3 types of test I am use to do in software development.
      Unittest integration and system test.
      At the wind company I work with we made a wind farm controller. It had unittest test and a Integration test.
      System test was performed by others.
      The neat part of the Integration test was that it had a build in wind farm simulator. And the Integration test could be run on the developer pc.
      That made it possible to test a feature end to end on the developer pc ❤❤❤.
      At the other firm that build generator controllers we only had unittest and automatic test that was testede directly on the controllers. This was still okay but due to the hardware dependency it quickly became a bottleneck which is not favourable since we want quick feedback from our test.
      Now I have been hired at a hydrogen fuelcell firm as a beckhoff plc developer. My goal is to build a system that I worked with in the wind indrustry because it is fast and scalable. Hopefully one day beckhoff would provide bulk license servers for test or something like that so your tests can be even faster due to paralle testing 🎉❤