LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing Cursor position in the acquired XY graph for further processing

Hello GerdW,

 

How to find a counter that increments when the 'save' case is executed? I am stuck here for sometime.

 

Thanks.

Pradeep.

0 Kudos
Message 11 of 18
(549 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 18
(538 Views)

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.

0 Kudos
Message 13 of 18
(532 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 18
(518 Views)

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.

0 Kudos
Message 15 of 18
(484 Views)

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.


  • Just place a OneButtonDialog in the "Norm" state to know if that state is executed!
  • I replaced your feedback nodes by shift registers (see attachment). I also set ALL important tunnels (references, shift registers) to "connected tunnels" so they NEVER will fail due to "default if unwired" behaviour of "simple" tunnels! I did this for tunnels at the event structure and of the inner case structure!
  • Please cleanup your wiring…
  • Simplify the code, like the string formatting in the "save" state…
  • All those small while loops to check your stage status may still stuck forever when they don't receive the expected data!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 18
(471 Views)

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.

 

0 Kudos
Message 17 of 18
(461 Views)

@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)

0 Kudos
Message 18 of 18
(416 Views)