Right choose for node (equal, select, switch-case)

Здравствуйте!

Вообще, вопроса два, какую ноду выбрать, чтобы программа была корректная? Ну, я помню из программирования SWITCH-CASE, там в зависимости от условия можно было выбрать действие. В XOD как оно работает, никак понять не могу… И стоит ли вообще придумывать, если есть EQUAL? Пока задача маленькая — и так сойдёт. Но как лучше на будущее?

И второй вопрос: Как (см. картинку) отключить ВСЕ реле, если пришло условие 555?

Спасибо!

Google translate: In general, there are two questions, which node to choose so that the program is correct? Well, I remember from programming SWITCH-CASE, there, depending on the condition, you could choose an action. In XOD, how it works, I can’t understand in any way … And is it worth it to invent it at all if there is EQUAL? As long as the task is small, it will do. But what’s better for the future?

And the second question: How (see the picture) to turn off ALL relays if condition 555 has arrived?

The second question is easier to answer: link the equal 555 output to all flip-flop-RST pins to turn off all relays.

XOD has a switch-case node, but it only produces a single output based on multiple compares, it doesn’t give you a way to branch based on input. If the output of ir-read were mostly contiguous numbers, nth-input might be of use, but like the switch-case node, it only produces a single output & doesn’t help you branch based on input.

There is no way in XOD to create a node with variable number of outputs, so there is no way to make a generic node for your task. You could create your own node to do this with a set number of outputs, but it will basically just be grouping the equal nodes inside your new node, so you don’t really gain much.

1 Like

Ага, спасибо!

В целом, по пункту 1 — я так и понял, что пусть оно будет в логике EQUAL, возможно, потом пойму как SWITCH-CASE или SELECT использовать.

Насчёт п. 2 — перенаправил их с 555 на RST и всё работает.

Ещё раз радуюсь, какая XOD бомба! :muscle:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.