LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with visa data acquisition

 

 I was forced to bring the serial port and the close visa inside the for loop as otherwise in the 4 wireless comparators to which I am going to make the request the acquired measurements are mixed and therefore by moving the comparator one I get the measurement under the column of 4.
But in this way the sampling frequency was greatly reduced because every time the system has to open and close the connection with the door. Do you know how to solve the problem?
Furthermore, the measures that it reports in excel all end up on the first column which I then redid thanks to the commas, but do you know how to get this thing directly automatically?

0 Kudos
Message 1 of 8
(1,539 Views)

Hi Valery,

 


@Valeryhill4 wrote:
But in this way the sampling frequency was greatly reduced because every time the system has to open and close the connection with the door. Do you know how to solve the problem?

Don't place the Open/Close inside the loop!

When the results are "mixed" then you need to sort them according to your devices…

 


@Valeryhill4 wrote:
Furthermore, the measures that it reports in excel all end up on the first column which I then redid thanks to the commas, but do you know how to get this thing directly automatically?

What should be done "automatically"?

It's your code and you are responsible to create the code correctly, there is no automatism that avoids programmer errors…

 

Why do you still set all those default values at the ConfigureSerialPort function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,508 Views)

If it wears out the opening and closing of the visa, how can I order the sizes? Since in that case if I move comparator 1 the measurement goes to comparator 2 then 3 etc.... as if there was a resonance of the measurement for subsequent loop requests. While inserting it inside I can have all the measurements in an extremely precise way but the only problem is that I can't sample faster than 1 measurement per second.
My goal is to obtain automatic continuous measurements for the 4 comparators as frequently as possible.

0 Kudos
Message 3 of 8
(1,499 Views)

Hi Valery,

 


@Valeryhill4 wrote:

Since in that case if I move comparator 1 the measurement goes to comparator 2 then 3 etc.... as if there was a resonance of the measurement for subsequent loop requests.


My goal is to obtain automatic continuous measurements for the 4 comparators as frequently as possible.


When the shift always is by one request then its easy to reorder the responses!

AFAIK there is an indication in the response string telling you about the sender of the message!? Use that to reorder your response data!

 

Again: when you want to read messages as fast as possible you need to move open/close out of all loops…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(1,494 Views)

For me there is another point: Why do you prevent mixing of answers by opening and closing the interface?

Either there is still data in the receive buffer, which is discarded by closing the Port (receive buffer is "cleaned") or there are timing issues (you are sending the next request, while the device is not yet ready for receiving data).

To check the first you could place a probe behind the VISA Read with a breakpoint.

To check the latter place a "Stall Dataflow" behind the VISA Read and play with the delay time.

 

P.S. Since you expect a TermChar you could make your life easier reading the whole line/answer when not wirering the "Byte Count" terminal at VISA Read.

AND: Place the Open/Close VISA Port outside the loops! GerdW mentioned it already 😀

Greets, Dave
0 Kudos
Message 5 of 8
(1,463 Views)

 In the request code, one of the values ​​just means that the data is deleted from the wireless receiver as soon as it is released. In the handbook of the receiver and transmitter it is written that they can communicate at 2.4 Ghz. Does this mean that I can maintain this communication speed with labview?
Basically the datum of comparator 1 ends up resonating in the array in the answer box of the others. This happens even if I put a very long delay time for each loop, so I can't explain it because in that case there's plenty of time to write and reply anyway.

0 Kudos
Message 6 of 8
(1,383 Views)

Another thing that came into my mind: are you sure about the term char? Normally a line is ended by a newline, which is '\n', which is 0x0A, which is 10 (decimal).

Greets, Dave
0 Kudos
Message 7 of 8
(1,443 Views)

By running the program I noticed that by opening and closing the serial port externally even if I set a huge delay, and therefore I leave all the time to write and read, the measurements appear to arrive all mixed up despite the fact that there is a character in the code that is sent which means that the instrument deletes the data as soon as it is sent. I also noticed that the more I reduce the delay to 0, the more I get only pieces of response string.
As for the termination character, I got it from the instrument manual that I attach, where there are the request data packets from the pc to the instrument. In chapter 7 the request strings are shown. 

0 Kudos
Message 8 of 8
(1,401 Views)