From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-28-2019 09:39 AM
Hi everyone,
I am writing a program in LabVIEW for our teststation. It suppose to get the readings from the chip over I2C and control the charger and the discharger. The program is in a very early phase but it already doesnt work properly.
- After I press the START Button the program starts and if I press the START Button again (accidentally or on purpose) it freezes and "disable" all other controls, so I can only stop it by pressing the "Abort Execution".
I am wondering what am I doing wrong, is there anything wrong in my programming technique? I dont know what am I missing out..
Please Advice me, Thanks in Advance.
01-28-2019 09:55 AM
Hi vlado,
After I press the START Button the program starts and if I press the START Button again (accidentally or on purpose) it freezes and "disable" all other controls, so I can only stop it by pressing the "Abort Execution".
This sounds like you are using an event structure. And the event structure is either stuck in an event case or doesn't run in a loop…
Did you read the help for the event structure? Each event case should be executed in a short amount of time to avoid blocking…
01-28-2019 11:07 AM - edited 01-28-2019 11:08 AM
The loop in the second frame can only start once the first sequence frame (containing the event structure) has completed. Once the second loop runs, any press on any of the controls assigned to events will lock up permanently, because all your events are set to lock the front panel until the event completes, but the event structure can never be reached again, meaning they cannot complete.
You need to re-architect the entire code so it can actually breathe.
01-28-2019 11:25 AM
Frame Sequences should almost never be required in a LabVIEW routine. The Principle of Data Flow means (among other things) that wires are usually all you need to enforce order-of-execution, and (more important!) the absence of connecting wires means that you can have parallel execution of code.
I haven't looked at the Tutorial documentation in a long time (a decade?), but remember learning about an Event Loop (an Event structure inside a "Do Forever" For Loop) that passed information about Events as they occurred to a parallel Processing Loop.
Go learn more about Event structures and redesign your Project. Try to do without any Sequence structures -- as I said above, they are almost never required, and usually signal a lack of LabVIEW understanding.
Bob Schor