Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Spreadsheet for DAQ Voltage Range Manipulation

Solved!
Go to solution

Hello, 

 

I have an analogue output NI-9264 module and I'm trying to manipulate DAQ voltage ranges using the "Read Delimited Spreadsheet" VI. 

 

The data from the file path is being saved into Excel as a CSV (Comma delimited file). 


The data that is being passed from CSV is:

 

Min Voltage,Max Voltage

10,3

5,1

3,2

2,3

1,3

 

In order to get rid of the heading I have set the input of "start of read offset" to the value '13'. 

 

However when running the VI 0's appear on the top row, which is an undesired result. 

 

How do you remove the first row from the indicator?

 

Many Thanks 

0 Kudos
Message 1 of 6
(3,054 Views)
Solution
Accepted by topic author neunited

First you don't change the range, you change the output values (range would define the output range of your device -10V to 10V   or 0V to 5V or ...)  don't know if your device supports that feature.. signal generators sometimes do  😉

 

How about read all the file and cut out the first row using the delete from array vi?

 

 

next: you didn't used the array output , you passed the fist row data ([0,0] array here) to the DAQ write 

(try highligth execution and /or probes to see what is happening)

So use the 2D array output of the read file vi, delete the first row and wire it into the loop (that I would change to a FOR loop) and use autoindexing ..

delete from array ex.png

Maybe your last DAQ write should be a [0,0] ... (just in case 😉 )

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 6
(3,039 Views)

Hi Henrik, 

 

Feelin' dank. 

 

I really appreciate your advice with that. 

 

I've attached the new VI with Henrik's advice using array w/subset deleted. 

 

So am I correct in thinking that the new VI I've posted will change the output voltages? The first column would be the min and second column max and then it would wait 5ms before changing to the next row. I haven't received my DAQ hardware yet so I can't check it on the scope. I  just want to make sure my design has the right philosophy Smiley Happy.  

 

Many Thanks

0 Kudos
Message 3 of 6
(2,993 Views)

Sorry, I can't have a look since I'm stuck with LV2012 on my System...

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 6
(2,982 Views)

Sorry Henrik, 


I should have illustrated my block diagram in the screenshot.

 

Block Diagram for Read Spreadsheet for DAQ Voltage Range Manipulation.PNG

 

The question I was referring to is the one at the top whereby delete from array is being connected directly to DAQmx Write. 

 

I also want to create an index array to manipulate different pins during simulation. DAQmx Create Virtual Channel doesn't seem to like this at the moment. 

 

Many Thanks

0 Kudos
Message 5 of 6
(2,977 Views)
Solution
Accepted by topic author neunited

No, that wont work as expected (as far as I assume)

It's obvious that you need to learn more about the basics of LabVIEW.

How often the loop runs is not defined by the user, it's defined by the number of data doubles in your file.

Thats why I suggest the for loop with autoindexing. 

You can still put a (emergency) stop button into your for loop. (rigth click on the border of the loop and choose Conditional Terminal)

Make a copy of vi, remove the DAQ vis and use a indicator as your voltage out. (or a chart )

Now you can test your vi without any extra harbware.

If you hit the lightbulb button, the execution slows down and you can follow the dataflow.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 6 of 6
(2,967 Views)