LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Referencing non-event-source enum

Solved!
Go to solution

Hello all,

 

I want to take three dynamic data streams from a triaxial accelerometer and rearrange which is x, y and z based on the global orientation of the accelerometer so that the global axes remain the same, i.e. if i reposition the accelerometer so that its 'y' axis now points in the global 'z' direction, I want the y data to be linked to the z wire so that saved data is consistent. In the past I've just altered the filename but that solution is pretty clumsy, and I already know how to do that so it's not interesting.

 

I haven't yet made anything workable because I'm just confused so no example VI unfortunately. All I have is three emuns labelled x, y and z, each with x, y and z items to choose from, as below:

 

direction enums.png

 

Say, for example, I set the x enum item to y. I want the y item to be disabled for the y and z enums and I want the x input data to link to the y output data stream. If I choose a second then the third enum item is forced. It sounds simple, and I could do it in order using nested case structures but that's not very flexible at all. I had a go with an event structure but I can't find a way of disabling items in the two enums that aren't the source of the event, and then I have to flip the actual data streams. I thought about putting the items to be disabled into an array and using a FGV inside a case structure but I found myself with problems whichever way I approached it.

 

I'm not necessarily looking for complete solutions, but it would be good to have some ideas and fresh insight so that I can have a go myself.

 

Thanks in advance!

idt

0 Kudos
Message 1 of 6
(2,551 Views)

Here are a couple of rough ideas. Maybe add a shift register for the 3 element array.

 

Example_VI.png

0 Kudos
Message 2 of 6
(2,543 Views)

Thanks Todd, you gave me a few ideas that I've had a go with. Attached is my VI as it stands now. 

 

I still have a couple of strange problems though:

 

  1. The x item is always disabled. I checked all the items are enabled before running the VI but on starting it the x item immediately becomes disabled.
  2. When making the z selection, the y item also becomes disabled.
  3. The z item does not disable when selected.

I'm really not sure what the problem is.

 

Feel free to tear the rest apart also and offer criticism and/or advice/suggestions.

 

Cheers! idt

0 Kudos
Message 3 of 6
(2,492 Views)
Solution
Accepted by AliasAlreadyOnFile

Hi idt,

 

I think you may have misunderstood the array that you are inputing into the disabled items property. The disabled items property will disable the values that have the indices of the array you fed into it. As you have fed an initial array of 3 0's you are selecting the 0th element, which is x in this case, three times and disabling it. If you delete the array constant on the left of your while loop, this will be illustrated by the fact x should no longer be disabled upon running your VI

 

kind regards,

Matt H
Applications Engineer
National Instruments UK
Message 4 of 6
(2,460 Views)

Thank you Matt, this makes completes sense now. So I need an blank initialising array then I input [0], [1], and [2] elements when their corresponding enum items are selected.

    idt

0 Kudos
Message 5 of 6
(2,455 Views)

Taking onboard what Matt said, attached is the new VI. Works ok.

 

Turns out that in a rush I had misread the help on the disableditems[] property node.

0 Kudos
Message 6 of 6
(2,445 Views)