LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data from the same source appears differently when plotted in MatLab or LabView

Ok, here is another attempt at attaching everything.  It is all zipped now, so should no longer be verboten in any manner...

The MatLab scripts should be fairly straightforward, but to not really have to do anything with them just use the PlotScript script.  It has the sampling rate (at least the sampling rate I am 99% sure we were using unless there is something going on in the inner workings between the Front Panel and the actual execution of the data acquisition where the sampling rate ceases to be accurate) already included, and will plot channel 37 (the mechanical switch data) in 20 second increments.

I did not include the LabView vi's, since I'm not really sure what sub-vi's they depend on and where on these computer systems to find all those said vi's.  If anyone thinks they would still be useful, however, I can try attaching them to another message.
0 Kudos
Message 11 of 22
(2,033 Views)
The "LoadData" function in the "PlotScript" file is undefined. Probably a user function.

It would help to know what the format of the file is. Since you indicated that the LabVIEW code is saving the data can you at least post this part of it?
0 Kudos
Message 12 of 22
(2,024 Views)
Without any actual code (just the read part and any calculetions you do).
The data looks like some multiplexed item to me.
Could you give the code that has written this data as well?

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 13 of 22
(2,023 Views)
Crap, you're right, I knew I was forgetting something... it really isn't a complicated function, but it just makes things go smoothly.

I'm sorry, but the format of which file?  I have attached the LabView code, although, like I said, it has been handed down through several people so is a bit of a mess.

I had to attach the MatLab function as a .txt file since .m was apparently not a valid extension for attachments... you should be able to just change it back to .m and it should work.
Download All
0 Kudos
Message 14 of 22
(2,019 Views)
I get the same data as you do:

But why the difficult data-reading in Matlab?
If I am correct you can read easily 2D binarie data into Matlab with a simple Read function. A paramater B indicated that the file is Little Endian binary (opposed to 'b', big endian binay), you only have to skip the 8f5 header (just like I did).

Are you sure your .bin to .mat converter is OK? Your LabVIEWreduced1 picture shows strange steps in the data, it looks like it has mixed some interleaved with block data.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 15 of 22
(2,006 Views)
Well, to be honest, I didn't really know what I was doing in terms of what the contents of the .bin file were.  I asked some of the previous people who had worked with the LabView as well as searching about on the internet for a solution.  I never did seem to manage to get  a .bin to .mat converter working, so I followed someone's advice and dumped it into a comma-deliminated file format since I knew MatLab could read that.  When I tried to just read the binary with MatLab, it kept telling me the data was either the wrong format or corrupt.  Do you know of a good .bin to .mat converter?  I was never able to find one.
0 Kudos
Message 16 of 22
(2,000 Views)
Here's the data + reading code:

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 17 of 22
(1,999 Views)
I was just wondering if you could attach the vi for the code reading... I am following along trying to recreate it, but there are a couple wires that I'm not quite sure where they are pointing.
0 Kudos
Message 18 of 22
(1,992 Views)
Here you go (8.5)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 19 of 22
(1,989 Views)
Thanks!
0 Kudos
Message 20 of 22
(1,985 Views)