General Category > EasyPLC v.4.x

Problem with script code


I 've maked a Block script procedure and I wanted to pass some parameters.
I'm calling this block from the Phase 1 of Level 1 in a Ladder segment, but always I receive a compilation error and I don't know how to solve it.
I attach the plc program.
Can you help me?.


[attachment deleted by admin]

The Block script procedures can't use parameters if are called from the Ladder language, however can use parameters if are called in the same script code.

Sub Test()

Dim n

n= Add(1,2)

End Sub

Function Add(n1,n2)

Add = n1 + n2

End Sub

But for your case you must use the Configurable Blocks, this components are script functions that can be used from the Ladder language passing parameters and returning values is are needed. I attach your code programmed with this component.

I hope this help you. Regards.

[attachment deleted by admin]

Thank you very much, now I understand the configurable blocks concept!.
Congratulations for this fantastic software!.


[0] Message Index

Go to full version