12-08-2019 06:23 PM - editado 12-08-2019 06:26 PM
Hola,
¿como puedo recorrer un objeto de tipo "menu ring"?
Me explico: quiero realizar un programa que recorra un espectro de frecuencias, desde una frecuencia inicial hasta una final, ambas seleccionadas en dos menus ring. Las frecuencias no son secuenciales, comienzan en 25 Hz, 30Hz, 50 Hz... y así, no tienen un paso fijo.
Se me ocurrió incrementar en una unidad el primer menú ring y usar la puerta lógica Round Toward +Infinity, pero no funciona (si está seleccionado 25 Hz, redondea a 26 y no a 30).
No se me ocurre como puedo llevarlo al cabo, ¿quizás con algún property node?
Gracias de antemano
¡Resuelto! Ir a solución.
el 12-08-2019 06:36 PM
12-08-2019 07:41 PM - editado 12-08-2019 08:01 PM
I've already done that, but my problem is that I don't know how to go over each value automatically.
This is part of my block diagram. I introduce an Initial frequency (choosen by user), which goes to a .vi of my instrument. Then I increment the frequency (that's what I want that it occurs automatically, to the next value of the menu ring), and I compare it with Final frequency (also choosen by user). If it is greater, leaves the loop.
I want to eliminate the Step block and end the loop at Final frequency.
el 12-08-2019 10:04 PM
Since all your options have the numeric value written in each option, you could do something as simple as parsing that string to get the frequency. This method would be pretty straight forward, given an Enum with the options ordered:
However, if you plan to have an "Invalid" option, or more complex options sometime in the future, I recommend exploring the use of a Map that links your Enum values with their frequency.
All the best,
el 12-09-2019 10:25 AM
Thank you so much!!
With your help, I found a way to do the same with menu rings 🙂
Thanks!
el
12-09-2019
01:07 PM
- fecha de última edición
04-30-2025
06:50 PM
por
Content Cleaner