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.
09-20-2021 08:09 AM - edited 09-20-2021 08:10 AM
Hello GerdW,
How to find a counter that increments when the 'save' case is executed? I am stuck here for sometime.
Thanks.
Pradeep.
09-20-2021 09:13 AM
Hi Pradeep,
@pclab wrote:
How to find a counter that increments when the 'save' case is executed?
Use a shift register to hold the "counter" value.
Increment that value in the "save" state, but keep it unchanged in the other states…
09-20-2021 10:02 AM - edited 09-20-2021 10:58 AM
Thank you GerdW! I should have done that myself. But I had done enough for today. Anyway, I had cleared all errors and saw the run arrow button.
But I need to be cautious about some other issues that may pop up. Plus, I need to consider the suggestions that you and Altenbach pointed out in the earlier posts. But right now I have two questions.
1. To transfer data from other cases, is it ok to tunnel data via a feedback node?
2. Out of curiosity, what are the other programming models other than sequential and state machine that can be used in LabVIEW? How would I determine which to use and when?
Thanks again,
Pradeep.
09-20-2021 02:57 PM
Hi Pradeep,
1. I prefer shift registers in state machines, but feedback nodes basically are the same...
2. LabVIEW comes with a lot of example VIs and projects. Open the "New..." dialog to find a list of several projects explaining programming schemes...
09-21-2021 12:35 PM
Hi GerdW,
I ran into few issues today.
Until the state Cursor, everything was fine. Then I clicked the Normalize button. I am not sure whether normalization is executed.
I suppose the issue is in the 'save' case. The jpg picture is generated. But the text file is empty. Are the feedback nodes proper? Is that how it should be done.
I also find an error with the counter in the 'save' case. If the scan count is set to 2, the 'run' case is executed more than 5 times. I believe it is running infinitely. Kindly point out the errors.
Thank you.
Pradeep.
09-21-2021 01:28 PM - edited 09-21-2021 01:43 PM
Hi Pradeep,
@pclab wrote:
Until the state Cursor, everything was fine. Then I clicked the Normalize button. I am not sure whether normalization is executed.
I suppose the issue is in the 'save' case. The jpg picture is generated. But the text file is empty. Are the feedback nodes proper? Is that how it should be done.
I also find an error with the counter in the 'save' case. If the scan count is set to 2, the 'run' case is executed more than 5 times. I believe it is running infinitely. Kindly point out the errors.
09-22-2021 11:56 PM
Hello GerdW,
Things got moving. I have few issues. One of which is detailed below.
I found that the button clicks are queued up. I mean if I click a button, data acquisition starts. I expect that the button to be disabled at least till the acquisition stops. But if during the acquisition I clicked the same button, it is as if the button click is being queued up and immediately starts data acquisition again after the earlier acquisition stops. I tried 'disable' and 'disable and grayed out' property node, but still it does not help. Even if it is diabled, LabVIEW recognizes the button click and queues up to be executed when it returns to the IDLE state. Is there any other way to come around this problem?
Thank you.
Pradeep.
09-23-2021 01:22 PM - edited 09-23-2021 01:24 PM
@pclab wrote:
Hello GerdW,
Things got moving. I have few issues. One of which is detailed below.
I found that the button clicks are queued up. I mean if I click a button, data acquisition starts. I expect that the button to be disabled at least till the acquisition stops. But if during the acquisition I clicked the same button, it is as if the button click is being queued up and immediately starts data acquisition again after the earlier acquisition stops. I tried 'disable' and 'disable and grayed out' property node, but still it does not help. Even if it is diabled, LabVIEW recognizes the button click and queues up to be executed when it returns to the IDLE state. Is there any other way to come around this problem?
You need to decouple the UI handling from the acquisition work (you still have lengthy interactive code inside the event structure!). Use two parallel loops and ways to communicate between them (e.g. queues etc.). One for UI handling and once for data acquisition. Why do you use "mouse up" events instead of "value change" A "mouse up" will trigger on disabled controls or even on indicators. (You can also configure your events to not lock the panel and set the queue size to 1, but this will not really help you here)