LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem between DAQ and serial RS232

Hi all,

Maybe one can come up with an idea for my problem.
I have a data aquisition system and a serial port to transmit information - basically, the output to the serial port is linearly dependent on the input values I get from the DAQ system.
I attached the VI so that my explanations can be understood easier.
I use probes so that I can see what happens in the wires. The observation is that the values to output are lesser than those that come from the input. But the program breaks with this error:
"Error -200279 occurred at DAQmx Read (Analog 2D I32 NChan NSamp).vi:2"
Possible reason(s):

Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<23>
-----
So, I don't understand why should be a DAQ Read VI error, since the same VI , without the part added for writing to the serial, worked well previously.

Is it a problem with the big amount of data that the serial gets and it can't handle it? Is it a good suggestion to downsample before getting to the input of the serial port? If yes, is there a VI for that or an easier solution for this?

I would greatly appreciate any suggestion from you.
Thank you.

Dana
0 Kudos
Message 1 of 2
(2,343 Views)
The addition of your serial write is slowing the loop down quite a bit. You did not attach the subVI MyBasic Serial Write and Read but I suspect it's a simple mod of the shipping example. You should not be using that example in a loop. It opens, configures, and closes the serial port with each iteration. You can also change the DAQmx acquisition to a fixed number of samples. This will acquire x number os samples. send it out the serial port and repeat. You will have gaps in your data. If you really need continuous acquisition, I would suggest you move the serial write to a separate loop and pass the data to it with a queue. The Producer/Consumer design pattern would be a good example to look at.
0 Kudos
Message 2 of 2
(2,340 Views)