General Category > EasyPLC v.4.x

Problem with script code

(1/1)

Luis_IngSL:
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?.

Thanks.

[attachment deleted by admin]

EasyPLC_Master:
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.
Example:

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]

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

Navigation

[0] Message Index

Go to full version