Passing variables through pistons


#43

I’m also trying to pass multiple devices to a other piston, it doesn’t recognize the passed values as devices. Any idea?


#44

I use global variables. In this case, the global variable @WhichEcho carries the device names of the Echos that I want to hear from.

In my speaking piston, the variable EchoSpeaks takes the names of the devices in @WhichEcho


#45

Thanks! Yea i thought globals would work but is a shame we can’t just pass them through directly. Single device does work though.


#46

The globals in my pistons pass multiple devices (at least for the Echos). The only drawback for globals is that those variables aren’t written until the piston is done, so if you call a second piston in the middle of the first, it won’t work.


#47

Is this issue with passing devices as arguments still pending?


#48

I am not sure, I eventually gave up and found a different way to solve my problem.


#49

I think using the wait parameter on the execute piston would have resolved this issue properly.

Basically there are two different methods of executing the piston, and the ‘no wait’ puts the variable thru a conversion process.

I have not tried this, but it is what I see reading the code


#50

It’s relatively easy to pass a device from one piston to another. I do this by passing device names as strings.

It gets a little bit more complicated when you need to pass a few devices. However, this is doable too.

These are pistons which pass and receive one device.



#51

These two samples can pass and receive several devices