08-17-2021 12:13 PM
Hi, first of all, I'm a total LabView noob, so please forgive any stupid questions.
What i try to achieve is to pull 2-dimensional sensor data from a serial device as lines of integer sequences, i.e. when sending the command :MEASURE:RAW the device would return the following data:
12 45 12 56
85 12 9 98
87 14 78 10
The sensor data should fill an array which will subsequently be visualized somehow.
As VISA Read terminates when it reads a newline character my naive approach was to execute it once for every line of sensor data in a for-loop. The for-loop itself will be nested in the main while loop, which can be stopped with a button., as shown in the following block diagram:
The problem however is that the both loops only execute one time. Once the for-loop is done for the first time, the while loop just stalls.
I'm sure it's obvious for you experts, but I'm stuck. Any hints are highly appreciated.
Solved! Go to Solution.
08-17-2021 12:30 PM
08-17-2021 12:33 PM
Never mind - the problem was - as mentioned by you in the last point - that the VISA Write was outside the loop and so the VISA read ran into timeouts as there was no more data available to read. Actually the loops continued, but at very low speed.
Grabbed some coffee and was surprised that the thing was in its third loop when I came back...
08-17-2021 12:44 PM
@woyzeck wrote:
Grabbed some coffee and was surprised that the thing was in its third loop when I came back...
Well, the default serial timeout is 10 seconds so it will continue at that pace ad infinitum, never receiving any data. (i.e. the while loop time will be 14x10 seconds).
I still think you have significant code problems (e.g. your tunnel modes, etc.) and we would be happy to point you in the right direction to improve your code 100 fold. :D) As a first step temporarily get rid of the communication and generate simulated data to work things out.