12-10-2018 03:04 AM
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?
12-10-2018 10:40 AM
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
12-10-2018 03:47 PM
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).
12-11-2018 07:55 AM
You really need to start reading the help file
Names , scales, all that happy stuff are handled inside DAQmx
12-13-2018 03:06 AM
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
12-13-2018 04:24 AM
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
12-13-2018 11:51 AM
You are setting Start timestamp only you need to add timestamp and wire to that
12-13-2018 03:23 PM
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!
12-13-2018 03:44 PM
12-13-2018 04:06 PM