Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ni6281 Transmit and Receive Signal

Hi, 

I'd like to build a labview program that I can both send and receive signal with for about 30 minutes in water pipe by using some transducers and transreceivers.

I am using ni6281 daq and I'm planning to use the sampling rate up to 200khz. I have built one program that it can both send and recieve signals but it has some problems as follows: 

1-)Sending and receiving are not synchronized. 

2-) I can't save the data for more than 1 min due to lack of memory problem.

3-)I want to have a signal which can show timing instead of number of samples.  

 

If you could help me to build a bit more engineered program or another similar example that I can play with it would be appreciated. 

 

Thanks

 

 

0 Kudos
Message 1 of 9
(4,590 Views)

Hi Agungor,

 

How are you sending data? From your VI's, all I see is that you are reading in data from a thermocouple. 

 

Are you using 32-bit or 64-bit LabVIEW? 

 

Have you seen the following community example:

https://decibel.ni.com/content/docs/DOC-3882

 

 

0 Kudos
Message 2 of 9
(4,563 Views)

Hi Roxana, Thank you for your reply. I sent you the wrong file. Here check this one out. Btw I couldn't run the program that you have sent me even though I have downloaded NI daqmax Base(I use 64 bit). The example you send me basically does the job but I am planning to add my own function generator by using mathcript in labview. So I don't want to limit to square or sinusoidal shape signals.

0 Kudos
Message 3 of 9
(4,548 Views)

Do you have a windows machine?

 

If so, you will need NI DAQmx Full not Base. The link for the download is the following:

 

http://www.ni.com/download/ni-daqmx-15.0.1/5353/en/

 

You could also look at this chart to make sure that LabVIEW is compatible with version of DAQmx that you have: 

 

http://digital.ni.com/public.nsf/allkb/B0D5630C0A50D5C6862578E800459248

 

 

 

0 Kudos
Message 4 of 9
(4,536 Views)

I fixed it all. 

With this program does it use RSE or Differential mode for receiving data? 

Can you also show me a proper example of writing the datas into txt or csv file format that I can combine with this example? 

Besides, how long do you think I can save data at the rate of 200khz with ni6281 ? With my program I can only read around 1 minute and then due to memory problem the program crashes.

 

Thanks 

0 Kudos
Message 5 of 9
(4,534 Views)

You can do either configuration. There is an option when you create the virtual channel to do either RSE or Differential. The property is called "Input Terminal Configuration."

 

In order to not run into your memory issue, I would do a producer consumer loop:

 

http://www.ni.com/white-paper/3023/en/

 

One while loop will produce the data - that'll be the loop that collects the data , which will contain your daqmx read

The other while loop will consume the data - the loop that writes to a text file. 

 

I would recommend looking at a shipping example that comes with LabVIEW to find a good example for how to write to a text file. You can find that under Help>>Find Examples and search for the example entitled: "Write to Text File amd Read From Text File." Combining that with the producer and consumer loop should alleviate your memory problem issue. 

0 Kudos
Message 6 of 9
(4,524 Views)

I tried to receive the datas for 30 seconds and save it into a file and continously save another 30 secs of data into this file or could be another file as well. 

Where do you think the control for the timing of saving data (in the quee) should be? 

0 Kudos
Message 7 of 9
(4,490 Views)

Hello,

 

I would use a while loop instead of a for loop for the dequeue. You could be running into a case where the while loop takes too long to run and you fill up your memory. I would recommend handling the name and the dequeue all in one while loop. You could put in a wait (ms) function to control how often that loop executes as well for the timing. 

 

 

 

0 Kudos
Message 8 of 9
(4,465 Views)

Hi, 

We can control the dequee part for running 10 secs with this addition however when it comes to writing the file it's still saving it for only 1 sec. Basically I need to record for each 10 sec or whatever input value I placed in it. 

0 Kudos
Message 9 of 9
(4,417 Views)