Read current value of a output port

Hello,
is it possible to read the current value of a output port for an if-statement?
To reference an input port, I use the format IN[portnumber].

For an ouput port, I tried the format OUT[portnumber] but it doesn’t work.
Also the condition with a connected boolean signal behavior does not seem to work either.

grafik

As far as I know you cannot refer to output port in the expression.

Like a hot knife through butter, a statement handler is your friend since it gives you a lot of control. With output ports… if they are not connected to external signal, the port stays false. When a port is connected to external signal, internally a signal is created for the port.

Test - Statement Handler for Output Condition.vcmx (879.4 KB)

You can reference component properties in an expression for the If condition in ‘robot statement’ and it would not throw error if underscore was in the property name. If the property is grouped in tab, it should be referenced with tab name immediately followed by two semi-colons and then immediately followed by property name, e.g. Beer;;AsahiLager

For your use case, is it a must to check the output? And is there a specific robot language or PLC language you are referencing, for example $OUT[] for output monitoring?

Thanks for the quick response.

I will try it with the statement handler first!

I’am trying a virtual commissioning of a production cell with an ABB-Robot.
For communication between the robot and the PLC, I created the required DI/DO’s as boolean signal behavior and then connected them to the corresponding ports of the boolean map using a Python script.
This works fine for a SetBinaryOutput statement in the program editor.
My problem: In the original robot program, however, I also have to query the digital output in an if statement.

I also thought about only using a boolean property for this task, so I can reference the property in an expression for the if statement but also set the value with the AssignVariable statement.

In this case my question is:
Is there a difference between pairing a boolean property and a boolean signal behavoir with the corresponding ports of the PLC?

Another question:
Is it possible to create a wait statement that is evaluating more then one digital input? Is there some work around?
I have to do something like this:
WaitUntil digInput1==False OR digInput2==True

Please excuse my bad English.

Hi Max,

I made this kind of a WaitStatement and I shared it now on the forum. So check this add-on WaitStatement for robot programming

WaitStatement understands inputs, outputs and component properties but it doesn’t support single boolean signal behaviours. If you know python API you can possibly extend it to support boolean signal behaviours.

-k

Hello to this thread,

first of all thank you for the project example it kind of helped.
second, i do not really get it to work on my program.

That would be great if you are able to help me out with this. :smiley:
I have to conveyor belts and a robot. The robot places one box from the one conveyor belt to the other. With signals there is not a problem with that.
Now, I added an cycletimecalculator to keep track of the cycle time of the robot.
My question:
How can I get the Output value from the cycletimecalculator or/and the robot?
I tried adding a new one like on the academy tutorial and also tried the project like zesty did.
I am still getting an error.
Also I tried some code lines of this thread.

In first place I want the output value of the robot (100 and 10), in second place the input value of the cycletimecalculator.
Note: The python script is located at the box behind the robot :smiley:

I would really appreciate if somebody can help me out with this.
Thank you

Bro
(PS: Hopefully this fits for the thread)