Skip to content

Conversation

@Navid-Mashayekh
Copy link

As you know in PLC world it is very common that we have function blocks which react to some inputs after some delay.
To be able to test these FBs usually we need to use another TON in the test suite, pass the reference of it to the test method and pend the assertions and finish to this timer. Most PLC programs are full of TONs and TOFs and doing this procedure for every test
is quite time consuming!
In this update a function called "AWAIT_ASSERTIONS( AwaitTime : TIME ) is added to be used before writing assertions in test methods.

@HAHermsen
Copy link

Hi,

Great PR, but have you considered using CASE OF constructs in these type of scenario's?
If an FB is State or Timer dependant, I always use CASE OF in order to get the Testee in the right state before asserting it.

With Kind regards

Haico

@Navid-Mashayekh
Copy link
Author

Hi,

Great PR, but have you considered using CASE OF constructs in these type of scenario's? If an FB is State or Timer dependant, I always use CASE OF in order to get the Testee in the right state before asserting it.

With Kind regards

Haico

Hey @HAHermsen

Could you please be more clear about using CASE OF, I did understand your scenario!

I added this feature to be able to halt for a desired time until my FB generates the correct output. Imagine the scenario where you have FB to control a reservoir and you generate an Alarm by a HH floater, but normally due to water ripples you may put a TON of 2 or 3 seconds before generating the alarm. so to test this FB now all you need to do is put AWAITING_ASSERTIONS ( T#4S ) before your assertions in test method.

@sagatowski
Copy link
Member

I'll start reviewing this PR as soon as this PR is completed/merged. Once it's merged, you will most likely need to merge from trunk again as the changes in the PR #159 will most likely break your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants