⬆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
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?
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.
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.
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!
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
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.
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.
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?
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...
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.
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.
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 🎉❤
⬆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
Thanks for another awesome Video.👍
Good tutorial on this. Could you just loop through the array and check each entry like that?
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?
Good video!
Glad you enjoyed it!
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.
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.
@@JakobSagatowski yeah I'm setting the double log messages but whatever.
*seeing
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!
Hey! Happy you find my material useful. I don't have any discord but it's a great idea!
Thanks Jakob! Would you share this project with us?
Hey Serhat! All the code will be uploaded to Patreon! (www.patreon.com/sagatowski ).
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
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.
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
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.
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?
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...
Happy you like the video! The second part is already available for all Patrons/members. Thank you!
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.
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.
The change in thinking about programming that Jacob mentioned in the film cannot be intuitive. This is obvious. Change of thinking = / = intuition.
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 🎉❤