LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Repeated data.

Solved!
Go to solution

Ok. Now I'll explain. The first VI that i built is what you see in the attachment called VI-1. Everything worked fine here except the fact that after about 50 minutes the program gave me error 200279. All the settings that i had entered (channel number, graphics, numerical indicators) were fine. Trying to solve the error 200279, i reconverted the VI as advised on this thread, but being new in labview i'm having problems now in reordering all the sensors with which i have to work (i mean graphs and numerical indicators). You can see this new attached VI (called VI-2). I think i did everything as you suggested, what am i doing wrong? For now i have inserted only one pressure sensor, i believe that understood the operation of only one then add other sensors will be simple. Can someone definitively correct the VI-2 please?

Download All
0 Kudos
Message 31 of 41
(1,292 Views)

There are several things seriously wrong with your code.  I needed to make several "fixes" to get it to do anything "sensible".

 

Let me begin by saying that I don't have a cDAQ to use as a test device, so I substituted a USB-6002 and used AI0 as my (single) input channel.  I also diagram-disabled the DAQmx Configure Logging.

 

I notice that you are taking 1 Sample (at a time) at 1 Hz, yet you are collecting the (single point) data in a Waveform, which expects an array of data.  I changed the DAQmx Read to "Single Channel, Single Sample, Dbl", diagram-disabled the selection of the second element of the (now-not-present) 1-D Array of Waveforms, and wired the Dbl output wire directly to the multiplication-by-160 function.  [Incidentally, why are you doing this?  DAQmx is designed to report "real values" -- you shouldn't need to scale yourself.  And why add an offset of 0?].

 

I was a little surprised when I ran this program -- the Display updated its time, but showed me no values.  So I "unlocked" the static Y Scale you built into the code, and there were nice data, scrolling across the plot at 1 Hz.

 

See if this description of "How I Fixed Your Code" makes sense to you, and see if you can make the same changes.

 

Bob Schor

0 Kudos
Message 32 of 41
(1,275 Views)

Hello. Thank you for your reply. Reading what you wrote, i understood that you watched VI-2. This is what i did   after the type of solution was suggested to me, but it is not very clear to me. I would prefer to continue to use the VI-1 ... but trying to solve the error 200279 (trying to give a name to each column of the excel file in output). I also downloaded the ADD-IN suggested by the NI website to convert a TDMS file to Excel, but the conversion is very long! To answer your question, if you look at the VI-1, i have to convert a voltage data to a given pressure; this conversion must be linear,so i introduced a scale factor (depends on the sensor i use) and also a value 0 (see it as the value that i can change, at any time, given by 'intercept of a straight line).

0 Kudos
Message 33 of 41
(1,261 Views)

1.png

You really need to start reading the help file

Names , scales, all that happy stuff are handled inside DAQmx


"Should be" isn't "Is" -Jay
Message 34 of 41
(1,246 Views)

Hi guys! I had to add the commands (blocks) "Get Date / Time in seconds" and "Get Date / Time string" to get the correct time and date in the excel data output sheet. I do not understand why it does not work. Did i make a mistake in configuring the "Set dynamic data attributes" block or did I block the blocks badly?

Thanks

0 Kudos
Message 35 of 41
(1,225 Views)

Sorry. I forgot to attach the vi and the image of the error!


@Iskandark wrote:

Hi guys! I had to add the commands (blocks) "Get Date / Time in seconds" and "Get Date / Time string" to get the correct time and date in the excel data output sheet. I do not understand why it does not work. Did i make a mistake in configuring the "Set dynamic data attributes" block or did I block the blocks badly?

Thanks


 

Download All
0 Kudos
Message 36 of 41
(1,220 Views)

You are setting Start timestamp only you need to add timestamp and wire to that


"Should be" isn't "Is" -Jay
0 Kudos
Message 37 of 41
(1,207 Views)

Hello! Thanks for the reply. Could you give me a screenshot of what you mean? Before asking, i read the help of each block, but i don't understand what i need to connect (specifically, i don't understand how to configure "Set Dynamic Data" block and how to connect it to "Get Date / time in second" block. I also believe that the "Get date / time string" is useless. Quite right?) I put the attached VI!

0 Kudos
Message 38 of 41
(1,197 Views)
Solution
Accepted by topic author Iskandark

Capture.PNGCapture1.PNG


"Should be" isn't "Is" -Jay
Message 39 of 41
(1,189 Views)

Thank you very much! 🙂 Tomorrow morning  i will try this solution!!!


@JÞB  ha scritto:

Capture.PNGCapture1.PNG


 

0 Kudos
Message 40 of 41
(1,180 Views)