LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a raw file

Hi

I´ve got two programms which I use for dataevaluation. The first one collects the data from a µC the other one is used to translate the data.

The problem is, if I start my data translater it says... error 116 .... So I tried another programm which ive found in this forum .... basically i could open the file but it was more or less empty ... 3 numbers appear and some 1000 ohters were 0.

 

Hence I would think that my data collector is somehow not working as it should?!

 

The idea of my data managment is to run the program and  store the data every10000 cycles in a file. If i stop the program I want to add the resindual datas which I ve recorded during the program process.

 

I would be super happy if someone could help me, as iam not that experinced I do not know what I did wrong.

Thanks a lot

 

 

Data Collector.JPG

 

 

0 Kudos
Message 1 of 6
(3,340 Views)

Hi Meise,

 

I do not know what I did wrong.

- You only attached an image instead of a VI.

- You always replace the very same array element as you wired a constant to ReplaceArraySubset.

- Your VISA Read-loop seems to look for a termchar. Why don't you use the built-in TermChar feature of the VISA functions?

 

Best regards,
GerdW


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

Hello Kohlmeise,

 

please provide us with more detailed informations.

  1. What does the while-loop do, where you read from the VISA- Port? What is the format of the string you are expecting?
  2. What is the conversion of "Vorzeichenloses Array"? Does it only switch from little endian to big endian?
  3. What does the for-loop do? How do you want to build the 2D- Array, which you want to save to file?

Some things I noticed:

  • since the for loop has several autoindexing inputs, it will loop only to the least number of array elements (could be 6 from the "Vorzeichenloses Array"- conversion)
  • This means, that your pre- initialized arrays (7x10000 and 7x100) will be truncated written back to the shift registers.
  • you write the same data twice to files, but at the end of data aquisition. Why not inside the aquisition- loop, then you don't have to keep it in memory?

 

Greets, Dave
0 Kudos
Message 3 of 6
(3,313 Views)

Here the VI.

Thanks ! 🙂

0 Kudos
Message 4 of 6
(3,308 Views)

1. As I told you in your other thead, you do not need that inner loop.  Let the VISA Read do its job and stop the read when it finds the termination character.  Just set the Bytes To Read to something like 50 and it will stop when it finds the termination character.

2. Since you are logging everything, I would recommend using a Producer/Consumer architecture.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,291 Views)

Hi crossrulz

thanks .... i ve tried that but in my case this resulted in short timeframes where the values stays constant .... in the end i managed the timing problem by better timing  of my µC ... now thats fine 😉

 

Btw an old version of my program doen´t have that timing problem .... maybe it will be a little more helpful...

 

Actually i just tried to simplify the way how the filter works ?!

Could that be the problem ?!....

 

 

 

 

0 Kudos
Message 6 of 6
(3,273 Views)