LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Resetting LED's

Hello, I previously created a program that uses an accelerometer and a MyDAQ to detect for a fall. This system physically shows that detection by utilizing LED's. I am currently trying to improve on my design by adding a "reset" functionality to the LEDs so that they don't stay on constantly. After doing some searching I found that utilizing an event structure could allow me to perform this functionality however when I implemented this it prevents all of my graphs and other components from running continuously (as they are all in a while loop). Is there a way I can perform my desired function with my code? Or is there a way to fix my current code (attached)? Thank you for the assistance!

0 Kudos
Message 1 of 4
(2,752 Views)

Hi Bryce,

 

you don't have an "issue with resetting LEDs", but you have an "issue with using too many ExpressVIs"!

 

- Why do you need ExpressVIs to simulate waveforms with just one sample?

check.png

- Why do you read 2 analog channels, but keep the code as if it was just one channel?

- Why is there a shift register holding a FALSE constant all the time?

 

when I implemented this it prevents all of my graphs and other components from running continuously

Because you didn't understand how an event structure works!

Use the TimeOut event to keep your loop running - in case you want to stick with the event structure. (I see no reason to do so…)

 

I really recommend to take the free lessons to learn LabVIEW. And to read the basics about DAQmx functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,726 Views)

GerdW,

 

The reason I used ExpressVIs is because it would not allow me to use true or false constants. When I tried it stated that I needed a 1-D boolean array and the only way I knew to solve this was by using a single sample signal. Could you tell me what you used to make the constants work?

 

I am reading two analog channels, but I'm reading the exact same information from both (X and Y from the accelerometer). When creating my program, I designed it to read both and never considered that I might need two programs. I see no use for changing this now.

 

The shift register that you are referring to was one of the only ways I could find to make the "Fall?" light turn on and stay on if it has been triggered.

 

I appreciate your assistance and will look into the LabVIEW lessons. So far I've been self taught from YouTube videos from National Instruments, so these may help me more. 

0 Kudos
Message 3 of 4
(2,701 Views)

Hi Bryce,

 

it stated that I needed a 1-D boolean array

There are two three basic ways to generate a 1D boolean array:

1. Put an array constant in the BD, then place a boolean constant inside the array constant

2. As shown in my image you should use the function BuildArray when you want to build an array from scalar values…

3. There's an InitArray function…

Because all 3 variants are VERY basic LabVIEW stuff I really recommend to take the free lessons for LabVIEW beginners!

 

never considered that I might need two programs

You don't need "two programs"! All I noticed was that your VI isn't programmed in a way it is aware of handling two DAQmx channels…

 

but I'm reading the exact same information from both (X and Y from the accelerometer).

This should be different - or do you move your accelerometer exactly the same in X and Y direction?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,679 Views)