From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange results from DAQ via Labview

Solved!
Go to solution

Kit: Labview 14 - NI SCB-68 - NI 6255 DAQ

 

Test: Reading voltages from a force balance in a wind tunnel in wind off then wind on conditions and applying a matrix to give processed force and moment data.

 

Process: Labview reads the voltages to create a zero file, the tunnel is then started, the software then rereads the voltages and takes off the zero readings to give 'live' readings and, when told, reads the voltages again (and saves as a volts file) then removes the zero voltages, applies the matrix and saves as a processed data file.

 

Issue: Labview always reads the zero voltages correctly but then reads almost random numbers from that point on in spite of the code being the same.

What's more confusing is it will work for a period (including tests one evening and the following morning) and then suddenly fail, especially as the voltages at the SCB-68 are always correct.

 

I've tried swopping cables, remaking cables, rerouting power cables, altering the order in which the cables are connected in the SCB-68, rewritten the code and now can't think of anything else to try - hopefully someone on here can come up with something that I've missed

0 Kudos
Message 1 of 9
(1,071 Views)

Hi bean,

 


@Littlebean wrote:

rewritten the code and now can't think of anything else to try - hopefully someone on here can come up with something that I've missed


You missed to attach the code so we can inspect it...

Best regards,
GerdW


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

sorry, should be attached now

 

I'm sure that there are better ways of doing what I need (open to suggestions) but I can't understand how it can work intermittently?

0 Kudos
Message 3 of 9
(1,056 Views)

@Littlebean wrote:

sorry, should be attached now

 

I'm sure that there are better ways of doing what I need (open to suggestions) but I can't understand how it can work intermittently?


That is not your code. That is a picture of your code with most of the relevant information hidden inside express vis. Please attach your actual vi.

0 Kudos
Message 4 of 9
(1,046 Views)

Hi bean,

 


@Littlebean wrote:

sorry, should be attached now


I asked for code and all I got is an image of code...

 


@Littlebean wrote:

I'm sure that there are better ways of doing what I need (open to suggestions) but I can't understand how it can work intermittently?


What about not using al those ExpressVIs? Their DDT datatype also hides a lot of information behind that thick blue line...

What about implementing error handling?

What about using subVIs?

You may also learn about using proper datatypes, like bundling related values into clusters. Learn to use less or no locals.

Best regards,
GerdW


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

ok, should have attached the code now - apologies.

I should also say Labview (or indeed any coding) is not my day job and I'm learning as I go so any advice/pointers greatly appreciated.

Download All
0 Kudos
Message 6 of 9
(1,025 Views)
Solution
Accepted by topic author Littlebean

Hi bean,

 


@Littlebean wrote:

so any advice/pointers greatly appreciated.


I still advice of get rid of ExpressVIs, especially the DAQAssistent.

In my experience it is quite flaky when it comes to continuous operation of longer periods of time...

Example:

Here I just replaced the math ExpressVI and those 5 FromDDT instances...

 

  • I also recommend to use some (better) code architecture. Even a simple state machine would be much better than your large flat sequence. (Why are there empty frames?)
  • You also should think about code comments!
  • Why does the Acquire button has no label in the block diagram? Would you use variables in a text-based language without giving them a label?
  • You should think about your datahandling! Why do you need to scale the "zero voltages" several times (multiply/divide by 1000)? What about clusters?
  • Does your DAQ device handle all the different sample rates correctly?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(993 Views)

thought I'd got rid of those empty frames....will do that now.

can (will) add comments

the scaling is just to make it easier to see on the front screen, it shouldn't be doing that in the final files, will double check that

label added in block diagram now

 

thanks for all your help

 

0 Kudos
Message 8 of 9
(978 Views)

Update: issue has been traced to electrical noise generated by a second pc.................

 

Thank you for all the help and pointers on how I could improve the code, looks like I have much to learn!

0 Kudos
Message 9 of 9
(935 Views)