LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring ON and OFF Time of an LED in VI

Solved!
Go to solution

@VarshiniPasumamula wrote:

Here,i have attached the code that have been implemented.


No, you only attached a picture. A picture of code is NOT "code"! Please attach your VI.

 

  • we need to guess what's in the other cases. We cant' tell what's in the controls.
  • wires flowing and crossing in all directions and sometimes hidden under structures. Way too many wire bends! What a hairball!
  • Way too much duplicate and unnecessary code (Why get the same relative time twice in parallel?)
  • pointless sequence structures. If you place the terminals after the case, you don't need any local variables.
  • convoluted boolean logic.
  • Your highlevel file IO opens and closes the file for every operations. Lots of overhead.. Did you understand y earlier comment for using lowlever file IO?
  • etc.
0 Kudos
Message 11 of 14
(54 Views)

Here,i have attached the implemented vi

  • In One shift register, I used to store rise edge time and other is for fall edge
  • The reason behind the implementation of sequence is, I can measure on and off time once i detect both rising and falling edge only right

Please do let me know the changes that i can make in data logging, this is where i'm facing issue

 

Waiting for your reply 🙂

 

0 Kudos
Message 12 of 14
(48 Views)

Hi Varshini,

 


@VarshiniPasumamula wrote:

Please do let me know the changes that i can make in data logging, this is where i'm facing issue


I did some of Altenbach's suggestions to your VI:

(As you like images of code I do the same… :D)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 14
(42 Views)

You can even do the "T to F", "F to T" and "no change" in one swoop. the just use case specific code. Using an enum makes the code self-documenting and easy to maintain. Many fewer places for bugs to hide. 😄

 

Here's a picture:

 

altenbach_0-1739549547644.png

 

0 Kudos
Message 14 of 14
(27 Views)