LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data question

Morning everyone,

 

I am using labview for a data aquisition board to study engines.

This VI interacts with hardware from a company called UEI.

Unfortunately, this code won't run unless it reads that hardware, but it should be pretty simplistic.

I know there are a lot of rookie mistakes in this code, I would appreciate any advice given.

 

All I am looking to do is

1)Obtain the data, and display it on the front screen . Any rate of 2Hz or faster is appropriate. The code does this currently.

2)Record all of the data at a rate of 1Hz or marginally faster. (I don't know how to control recording frequency)

 

I am using a lot of loops here. I'm sure some are unnecessary. I don't know how I can get my data to pull out of those loops to save into my text file. Most of my data that is currently saving are zeros, as the data doesn't come out until the loop finishes iterating.

 

Thanks!

 

-Dave

0 Kudos
Message 1 of 5
(2,376 Views)

Older version attached for those who need it

0 Kudos
Message 2 of 5
(2,365 Views)

Hi lavid,

 

Most of my data that is currently saving are zeros, as the data doesn't come out until the loop finishes iterating.

It's not the loop, which provides this problem. It's the case structure with all those "default if unwired" output tunnels!

- When you want to create a state machine, then do it correctly with a typedefined enum and some shift registers to store data!

- Cleaning up a VI can greatly improve it's readability and so also improve your ability to debug the VI!

- Why don't you use subVIs? Keeping a block diagram to the size of the screen is recommended…

Best regards,
GerdW


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

I was able tp get rid of almost all of my case structures. I dont know how to get rid of the case structure at the bottom however.

 

How can I pull that data out of the case structure?. Or better yet, how can I reprogram this to not use case structures??

I'll post my updated VI soon.

Thanks!

0 Kudos
Message 4 of 5
(2,338 Views)

Hi lavid,

 

I never said you need to get rid of case structures at all!

The problem are those "default if unwired" tunnels at the case structure border!!!

 

Did you check the state machine example coming with LabVIEW? (You will find it when you create a new project from scratch…)

Best regards,
GerdW


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