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

preview_player
Показать описание
TDD is the practice of writing tests before writing the implementation code. Writing software using the practice of TDD is something that has been around in the traditional software development industry for a while, but only recently has gained attention in industrial automation. In this series of videos, we will look at the theory of TDD, and then see how it's done in practice.

Please support this channel by either:
- A donation by using the "Thanks" button under the video

0:00 Introduction
2:49 Theory
7:50 TcUnit
14:17 Practice

#TwinCAT3 #TwinCAT #PLC #Beckhoff
Рекомендации по теме
Комментарии
Автор

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,
:= CsvString,
:= fbFileOpen.hFile);

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

MaurilioPatinoPerez
Автор

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

TheKanuunankuula
Автор

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!

RaimundoBuckfield
Автор

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.

pietgeursen
Автор

Thanks Jakob! Would you share this project with us?

serhatozyildiz
Автор

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...

Runtimevic
Автор

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

SuperHexadecimal
Автор

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.

steventrompet