DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Dasylab 16 - python script : operation on two inputs and one output

Hello,

 

I'm trying to create a python script to do a special operation on two numbers, and I want to output this single result on the module.

 

I took a look at some samples, and on this question.

I successful created a simple script that does output = input * A + B (A and B two internal parameters of the module).

 

I'm more looking to combine inputs by doing something like output = inputA * InputB (the reality is more complex of course).

 

So my script is for now like this :

 

def DlgInit (self, dlg):
# Initialization of settings dialog
# Click on the help button to get more information.

[...]

self.NumInChannel = 2 # amout of connectors on modules left side
self.NumOutChannel = 1 # amount of connectors on the right side


self.DlgNumChannels = self.NumInChannel
self.DlgMaxChannels = 1 # Ly.MAX_CHANNELS

[...]

def DlgOk (self, dlg):

[...]
self.SetConnectors(self.DlgNumChannels *1 , self.DlgNumChannels /2) 

 

 

And it displays fine.

 

But now I'm stuck on how to code the ProcessValue module. How to reach the two inputs value in the same call ? It looks like I'm not thinking the right way on this.

 

And please note that when I try to run my sheet, DL says that the internal script structure is damaged...

 

Any advice ?

Thanks !

 

Best regards,

 

Benjamin

0 Kudos
Message 1 of 1
(1,478 Views)