cancel
Showing results for 
Search instead for 
Did you mean: 

How to build a Flow that can be toggled between Probe and TCP mode?

Ubus99
Associate III

I would like to use the toggle UI element to switch between two paths: probe send and receive, and TCP send and receive.

The rest of the pipeline should remain the same.

1 ACCEPTED SOLUTION

Accepted Solutions
stephane.legargeant
ST Employee

Hello

Do you mean one sub flow with STLink probe, and another using a TCP node ?

It is possible to use some "switch" nodes to connect one path or the other one :

  • Add the toggle button, and store the value "probe" or"TCP" in a the flow context (with a "change" node : set flow.myswitch to msg.payload)
  • Add a "switch" node on probe path, with the condition flow.myswitch== probe
  • Add another switch on TCP path, with the condition flow.myswitch==TCP

When the toggle is moved, the flow variable is set, and will activate one path or the other.

Here is an example :

0693W00000KZyThQAL.pngLet us know if this is answering your question.

Best regards

View solution in original post

2 REPLIES 2
stephane.legargeant
ST Employee

Hello

Do you mean one sub flow with STLink probe, and another using a TCP node ?

It is possible to use some "switch" nodes to connect one path or the other one :

  • Add the toggle button, and store the value "probe" or"TCP" in a the flow context (with a "change" node : set flow.myswitch to msg.payload)
  • Add a "switch" node on probe path, with the condition flow.myswitch== probe
  • Add another switch on TCP path, with the condition flow.myswitch==TCP

When the toggle is moved, the flow variable is set, and will activate one path or the other.

Here is an example :

0693W00000KZyThQAL.pngLet us know if this is answering your question.

Best regards

Thank you for your answer, this should work.

That being said, judging from the Icon, the "switch" node looks like it switches between two paths, which would be a great function to have.