LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Driven State Machine Infinite Run Error

Well, they were my instructor's if you were curious lol

0 Kudos
Message 11 of 25
(1,281 Views)

@User002 wrote:

Well, they were my instructor's if you were curious lol


Ouch! 😮 

 

 

 

 

 

 

0 Kudos
Message 12 of 25
(1,261 Views)

Do you know why Index Array always outputs Initialize in the Start case? From my understanding, the Build Array is only composed of two elements, Finite and Continuous so I'm confused where it comes from. It causes me to get stuck.

Download All
0 Kudos
Message 13 of 25
(1,249 Views)

Here's a hint:

Read the detailed help for "index array" and then tell me why you might end up with a default value.  Oops, that's way more of a hint than I intended.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 14 of 25
(1,238 Views)

No, I'm not following at all. Everything is wired, so default value shouldn't be outputted. I'm thinking it has something to do with the sample mode enum.

0 Kudos
Message 15 of 25
(1,225 Views)

Well, your "sample mode" has three items, so you probably want to have an array of enums with three elements, one for each possibility (even if some might be the same). Am please resize the control so you can see the entire item string!

 

altenbach_0-1651431651277.png

 

 

You know, instead of all these init to defaults cluttering the "initialize?" case, you could use the right method the initialize all to default in one operation, right? Also make sure that all controls have reasonable default values, of course.

 

altenbach_0-1651430642499.png

 

Your events still lock the front panel, preventing you from ever stopping the continuous acquisition modes if you would press any of these buttons if the code is not in the idle state..

 

altenbach_1-1651430770726.png

 

I still don't think you should use an event structure here!

 

Your stop button (and others) still have no label. the label must always be shown on the diagram to keep your sanity. If you don't want to see the label on the front panel, use the "visible items" right-click menu.

Doesn't it seem like a lot of extra work to erase the label for the two channel settings controls, then add a free label to "fake'-label them on the diagram? Next time the diagram is cleaned up, they free labels might end up elsewhere! Herding cats!

 

Don't use two buttons with the same boolean text ("stop"), that's just confusing the user!

 

The "Channel 2" control belongs before the case structure, eliminating the local variable.

 

Not sure why you removed all timing??

0 Kudos
Message 16 of 25
(1,191 Views)

@User002 wrote:

No, I'm not following at all. Everything is wired, so default value shouldn't be outputted. I'm thinking it has something to do with the sample mode enum.


billko_1-1651437408893.png

You're close.  Except your "Sample Mode" enum is not an enum at all - it's a RING, and the "Finite Samples" item has a value of 10178.  You try to index the 10178th element of your array.

The help says:

billko_2-1651437585195.png

And since you are trying to index an element that is out of bounds, it returns the default value of your array element, which is item 1, which is "Initialize".

billko_3-1651437833736.png

Edit:

I think if the enum was strictly typed, it would've carried your default of "Queue" instead of "Initialize".  (Which is still not right.)

 

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 25
(1,174 Views)

Hmmm, I think I solved the Sample Mode issue, but now there's an error with the waveform chart. 

0 Kudos
Message 18 of 25
(1,159 Views)

I replaced it with enums, and it now outputs the correct value, but a new issue is now coming from DAQmx Create Channel

0 Kudos
Message 19 of 25
(1,136 Views)

Think about it.  You can't just arbitrarily replace those ring values with 0, 1, and 2 of the enum.  Take your time, think it through.  Think about the ramifications of what you've just done.  I'm not trying to be coy.  You have to develop these skills if you want to be even moderately successful once you get out of school.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 20 of 25
(1,067 Views)